Add Multiple Custom Attributes

POSThttps://app.botsi.com/api/v1/web-api/profiles/custom-attributes-all

Creates multiple custom attributes for a single profile in one request.

Follow the notes below for a successful request:
  • Use this endpoint to set several attributes in bulk and reduce the number of API calls.

  • Identify the user by providing either customerUserId or profileId. At least one is required to return the correct result.

    A successful request returns the list of created custom attributes. Each returned id represents a custom attribute ID that can be used later to update the corresponding attribute.

Request Body

application/json

ParameterTypeRequiredDescription
profileIdstringOptionalBotsi profile ID. Provide either profileId or customerUserId
customerUserIdstringRecommendedYour internal user ID. Provide either profileId or customerUserId. Example: user-123
customarrayRequiredArray of custom attribute objects (min 1)
keystringRequiredThe attribute key. Example: user_level
valuestringRequiredThe attribute value. Example: premium

Example Request

{
  "customerUserId": "user-123",
  "custom": [
    { "key": "user_level", "value": "premium" },
    { "key": "subscription_type", "value": "annual" },
    { "key": "referral_source", "value": "facebook" }
  ]
}

cURL Example

curl -X POST "https://app.botsi.com/api/v1/web-api/profiles/custom-attributes-all"      -H "Authorization: {{secret_key}}"      -H "Content-Type: application/json"      -d '{
       "customerUserId": "user-123",
       "custom": [
         { "key": "user_level", "value": "premium" },
         { "key": "subscription_type", "value": "annual" },
         { "key": "referral_source", "value": "facebook" }
       ]
     }'

Response

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

Try It Out

https://app.botsi.com/api/v1/web-api
Response
Click "Send API Request" to see the response here.