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:

Type Value format Example
address Address
bool boolean true
date string "4/27/2016"
datetime string "4/28/2016 6:00"
email string [email protected]
list object {"id":1, "name":"ABC"}
multi_select_list array [{"id":1, "name":"ABC"},{"id":3, "name":"XYZ"}]
number string "123.45"
phone string
string string
text string
url string http://example.com

JSON format

Name Type Read only Description
id number true Unique identifier of the custom field.
name string true Name of the custom field.
type string false Type of the custom field.
choices array false Represents choices that can be used for this particular custom field (applicable only for multi_select_list and list).
for_company bool false Whether custom field should be available on Contact: Company (applicable only for resource_type=contact).
for_contact bool false Whether custom field should be available on Contact: Person (applicable only for resource_type=contact).
created_at string true Date and time of when the custom field was created in UTC (ISO8601 format).
updated_at string true Date 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

Name Type In Required Description
resource_type string Query true Specifies 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": {    }  }}