Create a new custom attribute for contacts in a chatbot.
POST https://www.chatbase.co/api/v1/chatbots/{chatbotId}/custom-attributes
<YOUR_API_KEY>
text
number
boolean
date
{ "name": "company", "type": "text", "label": "Company Name", "description": "User's company name" }
Show Custom Attribute Object
{ "message": "Success", "data": { "name": "company", "type": "text", "label": "Company Name", "description": "User's company name", "archived": false } }
{ "message": "Invalid request body", "issues": [ { "field": "type", "message": "Invalid type. Must be one of: text, number, boolean, date" } ] }
{ "message": "Unauthorized access" }
{ "message": "Chatbot not found" }
{ "message": "Rate limit exceeded" }
{ "message": "Error creating contact custom attributes" }
curl -X POST 'https://www.chatbase.co/api/v1/chatbots/5ba682d23d7cf92bef87bfd4/custom-attributes' \ -H 'Authorization: Bearer <YOUR_API_KEY>' \ -H 'Content-Type: application/json' \ -d '{ "name": "company", "type": "text", "label": "Company Name", "description": "User'\''s company name" }'