Skip to content
Docs

External API

Create a custom field

Create a People field in your teamspace from your own system.

Creates a custom field for customers from your own system – for example, a Plan field to hold the plan they’re on in your billing system. The API creates People fields only. Create Conversation fields in Proto. Not sure how to send a request? See Make your first request.

Request

Send a POST request to:

https://v3-api.proto.cx/api/platform/v1/custom-fields/YOUR_TEAMSPACE_ID/create-custom-field

In the body, send the field’s type and name. In the address, replace anything starting with YOUR_ with your own.

There are six types. Dropdown and Single select fields also need their options:

typeShown in Proto asAlso send
textText–
numberNumber–
booleanToggle switch–
datetimeDate–
selectDropdownselect_options
single_selectSingle selectsingle_select_options

A Text field – the same for Number, Toggle switch and Date, with their own type:

{
  "type": "text",
  "name": "Account manager",
  "description": "Who looks after them",
  "default_value": "Sam Tan"
}

A Dropdown field:

{
  "type": "select",
  "name": "Plan",
  "description": "The plan they pay for",
  "select_options": ["Free", "Pro", "Enterprise"],
  "default_value": "Free"
}

A Single select field, with its options in groups. Set every id to "new":

{
  "type": "single_select",
  "name": "Interest",
  "description": "What they want to hear about",
  "single_select_options": [
    {
      "id": "new",
      "name": "Products",
      "options": [
        { "id": "new", "name": "Loans" },
        { "id": "new", "name": "Savings", "description": "Savings accounts" }
      ]
    }
  ]
}
FieldRequiredWhat it is
typeYesOne of the six types in the table above
nameYesThe field’s name – at least 2 characters. No other custom field in your teamspace can have it, including Conversation fields.
descriptionNoWhat the field is for
select_optionsFor selectThe options, with no blanks or repeats. Leave it out for other types.
single_select_optionsFor single_selectGroups of options. Leave it out for other types.
default_valueNoThe value customers get when none is set. It must suit the type, and be one of the options for select. You can’t set one for single_select.

Each item in single_select_options has:

FieldRequiredWhat it is
idYesAlways "new"
nameYesThe group’s name – up to 255 characters. No two groups can have the same name.
optionsYesThe options in the group – at least one

Each item in options has:

FieldRequiredWhat it is
idYesAlways "new"
nameYesThe option’s name – up to 255 characters. No two options in a group can have the same name.
descriptionNoWhat the option means – up to 500 characters

Response

Proto replies 200 OK with the new field. Keep its id.

{
  "id": "01J0ABCDEF1234567890ABCDEF",
  "entity": "customer",
  "type": "select",
  "name": "Plan",
  "description": "The plan they pay for",
  "select_options": ["Free", "Pro", "Enterprise"],
  "single_select_options": null,
  "default_value": "Free"
}

entity is always customer – the field is a People field. For a Single select field, each group gets an id starting cfg_ and each option an id starting cfo_. Send the option’s ID as the field’s value.

Errors

You getWhat it means
400A field with this name already exists, or the options or default value don’t suit the type. The message says which, and data.field names the field.
422type isn’t one of the six, name is too short or an option’s id isn’t "new".

For errors any request can return, see If something goes wrong.

Stuck? Ask Advisor in the Proto dashboard, or contact us.

© Proto