List custom fields

SDK platic.customFields.list()

Find a field’s id and type to save a value on a contact or change the field settings. The response includes workspace custom fields and the built-in fields every contact has.

Example

await platic.customFields.list();

Query parameters

ParameterTypeDescriptionRequired
workspacestringWorkspace ID. Required when your credential covers several workspaces (list workspaces); without it the answer is 400If the credential has several

Response

{
  "status": "success",
  "data": [
    {
      "id": "status",
      "name": "status",
      "type": "text",
      "automatic": false,
      "overwritable": false,
      "description": "Use this field to record the current status of the customer",
      "status": "active"
    },
    {
      "id": "sales_stage",
      "name": "Sales stage",
      "type": "select",
      "automatic": false,
      "overwritable": false,
      "description": "Current stage of the customer in the funnel",
      "status": "active",
      "ordered": true,
      "options": [
        { "id": "new", "label": "New", "order": 0 },
        { "id": "contacted", "label": "Contacted", "order": 1 },
        { "id": "closed", "label": "Closed", "order": 2 }
      ]
    }
  ],
  "defaultFields": [
    {
      "name": "Nombre",
      "id": "name",
      "type": "text",
      "description": "Nombre completo del cliente"
    },
    {
      "name": "Correo electrónico",
      "id": "email",
      "type": "text",
      "description": "Email del cliente"
    }
  ]
}

defaultFields always has the same 12 fields; the example shows two.

Response fields

data is the list of the workspace's custom fields. Each field has:

FieldDescription
idUnique custom-field identifier (slug derived from the name)
nameOriginal field name as defined
typeField type (see Create custom field for the full list)
automaticWhether the AI should fill the field automatically from the conversation
overwritableWhether the AI can overwrite the field's existing value
descriptionWhat the field is used for
statusField state: active
orderedselect only. Whether the options are an ordered sequence (stages/steps)
optionsselect only. Option catalog. Each option includes id, label, and optionally color, order, and archived. A customer's value for this field is an option id

Next to data there is one more field:

FieldDescription
defaultFieldsThe 12 built-in fields every contact has (name, firstname, lastname, email, birthdate, gender, company, country, state, city, address, postalCode). Each one has name, id, type, and description. They are the same in every workspace and cannot be created, changed, or deleted

Errors

Statusdetails.codeWhen it happens
400INVALID_REQUESTYour credential covers several workspaces and you did not send ?workspace=, or you sent one it does not cover. details.available lists the ones you can use
401UNAUTHENTICATEDThe credential is missing or invalid
403FORBIDDENThe credential does not have the Contacts module (Missing contacts permission)
500INTERNAL_ERRORThe fields could not be read. Try again
{
  "code": 403,
  "error": "Forbidden - You don't have permission for this resource",
  "details": {
    "code": "FORBIDDEN",
    "message": "Missing contacts permission"
  }
}

The general error format is in Errors.