After creating custom fields in the user interface, you can use the Custom Fields API to manage your custom fields per resource type. You can't create new custom fields via the API.

Custom field type

Each custom field has a defined type, which has a corresponding value format:

TypeValue formatExample
addressAddress
boolbooleantrue
datestring"4/27/2016"
datetimestring"4/28/2016 6:00"
emailstring[email protected]
listobject{"id":1, "name":"ABC"}
multi_select_listarray[{"id":1, "name":"ABC"},{"id":3, "name":"XYZ"}]
numberstring"123.45"
phonestring
stringstring
textstring
urlstringhttp://example.com

JSON format

NameTypeRead onlyDescription
idnumbertrueUnique identifier of the custom field.
namestringtrueName of the custom field.
typestringfalseType of the custom field.
choicesarrayfalseRepresents choices that can be used for this particular custom field (applicable only for multi_select_list and list).
for_companyboolfalseWhether custom field should be available on Contact: Company (applicable only for resource_type=contact).
for_contactboolfalseWhether custom field should be available on Contact: Person (applicable only for resource_type=contact).
created_atstringtrueDate and time of when the custom field was created in UTC (ISO8601 format).
updated_atstringtrueDate and time of the last update in UTC (ISO8601 format).

Retrieve custom field

GET /v2/:resource_type/custom_fields

Returns all custom fields associated with the specified resource type.

Parameters

NameTypeInRequiredDescription
resource_typestringQuerytrueSpecifies the type for which custom fields should be returned. Possible values:lead, contact, deal, prospect_and_customer

Allowed for

  • Agents

Using cURL

curl -v -X GET https://api.getbase.com/v2/contact/custom_fields \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "items": [    {      "data": {        "id": 1,        "name": "Url",        "created_at": "2016-12-13T16:42:44Z",        "updated_at": "2018-05-02T09:27:54Z",        "for_organisation": true,        "for_contact": true,        "type": "url",        "choices": null      },      "meta": {        "type": "custom_field"      }    },    {      "data": {        "id": 2,        "name": "Division Name",        "created_at": "2017-02-15T10:32:57Z",        "updated_at": "2018-09-17T11:24:51Z",        "for_organisation": false,        "for_contact": true,        "type": "string",        "choices": null      },      "meta": {        "type": "custom_field"      }    },    {      "data": {        "id": 3,        "name": "Industry Group",        "created_at": "2018-06-20T14:43:49Z",        "updated_at": "2018-07-04T08:04:06Z",        "for_organisation": true,        "for_contact": true,        "type": "list",        "choices": [          {            "id": 1,            "name": "Capital Goods"          },          {            "id": 2,            "name": "Diversified Financial Services"          },          {            "id": 3,            "name": "Food, Beverage & Tobacco"          }        ]      },      "meta": {        "type": "custom_field"      }    }  ],  "meta": {    "type": "collection",    "count": 3,    "links": {    }  }}