Request

URL

GET https://www.chatbase.co/api/v1/chatbots/{chatbotId}/custom-attributes

Path Parameters

chatbotId
string
required

The ID of the chatbot to retrieve custom attributes from

Headers

Authorization
string
required

Bearer <YOUR_API_KEY>

Response

Success Response

  • Status: 200 OK
  • Content-Type: application/json
message
string

Success message

data
array

Array of custom attribute objects

{
  "message": "Success",
  "data": [
    {
      "name": "company",
      "type": "text",
      "label": "Company Name",
      "description": "User's company name",
      "archived": false
    },
    {
      "name": "age",
      "type": "number",
      "label": "Age",
      "description": "User's age",
      "archived": false
    },
    {
      "name": "old_field",
      "type": "text",
      "label": "Deprecated Field",
      "description": "This field is no longer in use",
      "archived": true
    }
  ]
}

The archived field indicates whether the custom attribute is active:

  • false: The attribute is active and can be used
  • true: The attribute is archived and cannot be used for new or updated values

Error Responses

401 Unauthorized

  • Invalid or missing API key
{
  "message": "Unauthorized access"
}

404 Not Found

  • Chatbot not found
{
  "message": "Chatbot not found"
}

429 Too Many Requests

  • Rate limit exceeded
{
  "message": "Rate limit exceeded"
}

500 Internal Server Error

  • Server error occurred
{
  "message": "Error getting contact custom attributes schema"
}

Code Examples