Skip to content

Search the documentation by title, section, or page text.

Add Custom Attributes

POST https://api.botsi.com/v2/custom-attributes

Custom attributes enrich a Profile with metadata. Provide as much as possible for better results with Botsi AI Pricing Models.

Request body#

ParameterTypeRequiredDescription
profileIdstringRequiredBotsi profile ID from Create a Profile
customarrayRequiredAttribute objects. Must contain at least one
custom[].keystringRequiredThe attribute key
custom[].valuestringRequiredThe attribute value
curl -X POST "https://api.botsi.com/v2/custom-attributes" \
  -H "Authorization: $BOTSI_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "profileId": "0072102a-c00c-4ea5-9271-1b6e975f2d63",
    "custom": [
      { "key": "user_level", "value": "premium" },
      { "key": "subscription_type", "value": "annual" },
      { "key": "referral_source", "value": "facebook" }
    ]
  }'

Errors#

CodeMessageCause
400custom must contain at least 1 elementsThe custom array was empty
404No profile found by id: 0072102a-c00c-4ea5-9271-1b6e975f2d63No Profile exists for that profileId

Response#

{
  "ok": true,
  "data": [
    { "id": "abc123", "key": "user_level", "value": "premium" },
    { "id": "def456", "key": "subscription_type", "value": "annual" },
    { "id": "ghi789", "key": "referral_source", "value": "facebook" }
  ]
}