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
customerUserIdorprofileId. At least one is required to return the correct result.A successful request returns the list of created custom attributes. Each returned
idrepresents a custom attribute ID that can be used later to update the corresponding attribute.
Request Body
application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
profileId | string | Optional | Botsi profile ID. Provide either profileId or customerUserId |
customerUserId | string | Recommended | Your internal user ID. Provide either profileId or customerUserId. Example: user-123 |
custom | array | Required | Array of custom attribute objects (min 1) |
key | string | Required | The attribute key. Example: user_level |
value | string | Required | The 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.