Creation and deletion of custom fields

This method allows creating or deleting custom fields one by one or in packages. The user will not be able to change their values from the interface, but can browse them and use them for filtering.

Creation or deletion of a field is also possible from the interface.

Resource URL

POST /private/api/v2/json/fields/set

Parameters

PARAMETERTYPEDESCRIPTION
add Numerated array The list of fields to be added
delete Numerated array The list of fields to be deleted
add/namerequire String Field name
add/request_id Number Unique identifier of a record in client-side program (optional parameter) (information about request_id will not be saved anywhere)
add/typerequire Number Field type (see Account information)
add/element_typerequire Number Entity
add/disabled Number (0,1) Set this flag if you need to disable this field edition in web-interface (by default 1, disabled)
add/originrequire String Unique identifier of the service, which will allow deletion or modification of the field
delete/idrequire Number Unique field identifier, which is indicated for deleting the field
delete/originrequire String Unique identifier of the service, which will allow deletion or modification of the field

Entities

PARAMETERDESCRIPTION
1Contact
2Lead
3Company

Example Request

  1. {
  2.   "request":  {
  3.   "fields":  {
  4.     "add":  [
  5.     {
  6.       "name": "Tracking ID",
  7.       "type": 1,
  8.       "element_type": 2,
  9.       "origin": "528d0285c1f9180911159a9dc6f759b3_zendesk_widget"
  10.     },
  11.     {
  12.       "name": "Company internal deal ID",
  13.       "type": 1,
  14.       "element_type": 3,
  15.       "origin": "6cee3eaa7556679f761adf026e16e5c7_company_id_61f5bec3ff4",
  16.       "disabled": 0
  17.     }
  18.     ],
  19.     "delete": [
  20.     {
  21.       "id": 3655490,
  22.       "origin": "528d0285c1f9180911159a9dc6f759b3_zendesk_widget"
  23.     }
  24.     ]
  25.   }
  26.  }
  27. }

Response Field Guide

PARAMETERDESCRIPTION
idUnique identifier of the new/deleted field
request_idThe unique identifier of the entity in the client program. If request_id not passed in the request, it is automatically generated
server_time The timestamp of the current server time with offset for the time zone of the account (transmitted in the timestamp)

Response Example

  1. {
  2.   "response": {
  3.     "leads": {
  4.       "add": [
  5.         {
  6.           "id": 3655494,
  7.           "request_id": 0
  8.         },
  9.         {
  10.           "id": 3655495,
  11.           "request_id": 1
  12.         }
  13.       ]
  14.     },
  15.     "server_time": 1374756396
  16.   }
  17. }