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
curl https://api.platic.ai/v1/custom-fields \
-H "Authorization: Bearer $PLATIC_API_KEY" await platic.customFields.list(); Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
workspace | string | Workspace ID. Required when your credential covers several workspaces (list workspaces); without it the answer is 400 | If 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:
| Field | Description |
|---|---|
id | Unique custom-field identifier (slug derived from the name) |
name | Original field name as defined |
type | Field type (see Create custom field for the full list) |
automatic | Whether the AI should fill the field automatically from the conversation |
overwritable | Whether the AI can overwrite the field's existing value |
description | What the field is used for |
status | Field state: active |
ordered | select only. Whether the options are an ordered sequence (stages/steps) |
options | select 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:
| Field | Description |
|---|---|
defaultFields | The 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 |
Note
When using custom fields in your requests, only use lowercase characters without accents or special characters. Use underscores _ instead of spaces.
Errors
| Status | details.code | When it happens |
|---|---|---|
400 | INVALID_REQUEST | Your 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 |
401 | UNAUTHENTICATED | The credential is missing or invalid |
403 | FORBIDDEN | The credential does not have the Contacts module (Missing contacts permission) |
500 | INTERNAL_ERROR | The 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.