Add Single Custom Attribute
POSThttps://app.botsi.com/api/v1/web-api/profiles/custom-attributes
Creates a single custom attribute for a profile.
Follow the notes below for a successful request:-
Use custom attributes to enrich a user profile with application-specific metadata (for example: user tier, referral source, or segmentation labels). This is optional for the core AI Pricing flow.
-
Identify the user by providing either
customerUserIdorprofileId. At least one is required to return the correct result.A successful request returns the newly created custom attribute. The returned
idrepresents the custom attribute ID and can be used later to update this 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 |
custom | object | Required | Custom attribute object |
key | string | Required | The attribute key. Example: user_level |
value | string | Required | The attribute value. Example: premium |
Example Request
{
"profileId": "0072102a-c00c-4ea5-9271-1b6e975f2d63",
"custom": {
"key": "user_level",
"value": "premium"
}
}
cURL Example
curl -X POST "https://app.botsi.com/api/v1/web-api/profiles/custom-attributes" -H "Authorization: {{secret_key}}" -H "Content-Type: application/json" -d '{
"profileId": "0072102a-c00c-4ea5-9271-1b6e975f2d63",
"custom": {
"key": "user_level",
"value": "premium"
}
}'
Response
200Attribute created successfully
{
"ok": true,
"data": {
"id": "yFtuWhuj",
"key": "user_level",
"value": "premium"
}
}
Try It Out
https://app.botsi.com/api/v1/web-api
Response
Click "Send API Request" to see the response here.