API Explorer
Fields Endpoint

This endpoint allows you to list custom contact fields in your account.

Listing Fields

A GET returns the list of custom contact fields for your organization, in the order of last created.

  • key - the unique key of this field (string), filterable as key
  • label - the display label of this field (string)
  • value_type - the data type of values associated with this field (string)

Example:

GET /api/v2/fields.json

Response containing the fields for your organization:

 {
    "next": null,
    "previous": null,
    "results": [
        {
            "key": "nick_name",
            "label": "Nick name",
            "value_type": "text"
        },
        ...
    ]
}

Adding Fields

A POST can be used to create a new contact field. Don't specify a key as this will be generated for you.

  • label - the display label (string)
  • value_type - one of the value type codes (string)

Example:

POST /api/v2/fields.json
{
    "label": "Nick name",
    "value_type": "text"
}

You will receive a field object (with the new field key) as a response if successful:

{
    "key": "nick_name",
    "label": "Nick name",
    "value_type": "text"
}

Updating Fields

A POST can also be used to update an existing field if you include it's key in the URL.

Example:

POST /api/v2/fields.json?key=nick_name
{
    "label": "New label",
    "value_type": "text"
}

You will receive the updated field object as a response if successful:

{
    "key": "nick_name",
    "label": "New label",
    "value_type": "text"
}