Create custom attribute
POST/v1/chatbots/{chatbotId}/contacts/attributes
Define a custom contact attribute such as plan or company for a chatbot with the legacy v1 API, with a name, a type and a description.
Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.
Adds a custom attribute to the contact schema of a chatbot. Call it before you create or update contacts that carry a new field, such as plan or renewalDate.
Request
POST /v1/chatbots/{chatbotId}/contacts/attributes
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
chatbotId |
string | Yes | The ID of the chatbot, starting with agt_. |
Body fields:
| Name | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | The attribute key. Use letters, numbers and underscores, for example plan. |
type |
string | Yes | One of string, number, boolean or date. |
description |
string | No | What the attribute holds. Helps your team read the contact profile. |
The agent can use attribute values when it answers, for example to treat a pro plan customer differently. Background on contact data is in Contacts overview.
Example request
curl -X POST https://api.askocto.co/v1/chatbots/agt_8f3k2m/contacts/attributes \
-H "Authorization: Bearer $OCTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "plan",
"type": "string",
"description": "The subscription plan of the customer."
}'
const response = await fetch(
"https://api.askocto.co/v1/chatbots/agt_8f3k2m/contacts/attributes",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OCTO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "plan",
type: "string",
description: "The subscription plan of the customer.",
}),
},
)
console.log(await response.json())
Example response
A successful call returns 201 Created.
{
"name": "plan",
"type": "string",
"description": "The subscription plan of the customer.",
"createdAt": "2026-03-14T09:30:00Z"
}
Response fields
| Name | Type | Description |
|---|---|---|
name |
string | The attribute key, used inside the attributes object of a contact. |
type |
string | The value type. |
description |
string | Your description, or an empty string. |
createdAt |
string | ISO 8601 UTC time the attribute was created. |
See all attributes with Get custom attributes schema.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request |
name has characters outside letters, numbers and underscores, or type is unknown. |
| 401 | unauthorized |
The API key is missing, malformed or revoked. |
| 404 | not_found |
No chatbot with this ID exists in your workspace. |
| 409 | conflict |
An attribute with this name already exists. |
| 429 | rate_limited |
Too many requests. Wait for the number of seconds in the Retry-After header. |