> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to get all user-defined fields using the web services API

> Describes how to get all user-defined fields using web services

This guide describes how to get all user-defined fields using the web services API.

## Steps

The following REST code snippets use plain http requests to demonstrate how to perform the operation. The WebApi code snippet demonstrates how to perform the same operation using our nuget package [SuperOffice.WebApi][1].

[1]: https://www.nuget.org/packages/SuperOffice.WebApi

<Tabs>
  <Tab title="RESTful REST API">
    The following examples demonstrate how to get all user-defined fields for a company, using the api/v1/Contact/UdefLayout endpoint.
    To get the all user-defined fields for a different entity, use the `api/v1/{entity}/UdefLayout` entity endpoint,
    i.e. `api/v1/Person/UdefLayout`, `api/v1/Project/UdefLayout` etc.

    ```http theme={null}
    GET https://{{env}}.superoffice.com/{{tenant}}/api/v1/Contact/UdefLayout
    Authorization: Bearer {{token}}
    Accept: application/json; charset=utf-8
    ```
  </Tab>

  <Tab title="HTTP RPC Agent API">
    The following examples demonstrate how to get all user-defined fields for a company, using the `OwnerType` parameter.
    To get the all user-defined fields for a different entity, use the appropriate [OwnerType][1] value.

    ```http theme={null}
    POST https://{{env}}.superoffice.com/{{tenant}}/api/v1/Agents/UserDefinedFieldInfo/GetPublishedUserDefinedFieldList
    Authorization: Bearer {{token}}
    Accept: application/json; charset=utf-8
    Content-Type: application/json; charset=utf-8

    {
      "OwnerType": "Contact"
    }
    ```
  </Tab>

  <Tab title="SuperOffice.WebApi">
    The following examples demonstrate how to get all user-defined fields for a company, using the `OwnerType` parameter.
    To get the all user-defined fields for a different entity, use the appropriate [OwnerType][1] value.

    ```csharp theme={null}
    var config = new WebApiOptions(tenant.WebApiUrl);
    config.Authorization = new AuthorizationAccessToken("8A:Cust12345.Example-Token", OnlineEnvironment.SOD);

    var udefAgent = new UserDefinedFieldInfoAgent(config);
    return await udefAgent.GetPublishedUserDefinedFieldListAsync(UDefType.Contact);
    ```
  </Tab>
</Tabs>

[1]: xref:SuperOffice.WebApi.Data.UDefType


## Related topics

- [How to update a user-defined field using the web services API](/en/api/web-services/howto/custom-objects/rest-update-udef-field.md)
- [How to create a user-defined field using the web services API](/en/api/web-services/howto/custom-objects/rest-create-udef-field.md)
- [How to delete a user-defined field using the web services API](/en/api/web-services/howto/custom-objects/rest-delete-udef-field.md)
- [SuperOffice.WebApi.Agents.UserDefinedFieldInfoAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.UserDefinedFieldInfoAgent.md)
- [How to display all user-defined fields](/en/api/web-services/howto/custom-objects/get-udef-list-and-values.md)
- [How to set a user-defined list item on a Udef field (services)](/en/api/web-services/howto/custom-objects/set-udef-listitem-value.md)
