Update Custom Attributes
PUT https://api.botsi.com/v2/custom-attributesUpdate existing attribute values, as when a user upgrades from premium to vip, for example.
Identify the user with profileId. Each attribute is targeted by custom[].key.
Request body#
curl -X PUT "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": "vip" },
{ "key": "subscription_type", "value": "annual" }
]
}'PUT only updates attributes that already exist
The update is atomic. If any key in custom is missing from the Profile, nothing is written and the 404 names the keys it could not find.
Create attributes with Add Custom Attributes first.
Errors#
Response#
{
"ok": true,
"data": [
{ "id": "abc123", "key": "user_level", "value": "vip" },
{ "id": "def456", "key": "subscription_type", "value": "annual" }
]
}