Update Custom Attribute
PUThttps://app.botsi.com/api/v1/web-api/profiles/custom-attributes
Updates an existing custom attribute for a profile.
Follow the notes below for a successful request:-
Use this endpoint to modify previously stored metadata (for example, upgrading a user tier from
premiumtovip). -
When updating an attribute, store the returned attribute
idso it can be referenced later. -
Identify the user by providing either
customerUserIdorprofileId. At least one is required to return the correct result.A successful request returns the updated custom attribute.
Request Body
application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
profileId | string | Optional | Botsi profile ID. Provide either profileId or customerUserId. Example: 0072102a-c00c-4ea5-9271-1b6e975f2d63 |
customerUserId | string | Recommended | Your internal user ID. Provide either profileId or customerUserId. Example: user-123 |
custom | object | Required | Custom attribute object |
key | string | Required | The attribute key. Example: user_level |
value | string | Required | The attribute value. Example: vip |
attrId | string | Required | The ID of the custom attribute to update. Example: abc123 |
Example Request
{
"profileId": "0072102a-c00c-4ea5-9271-1b6e975f2d63",
"custom": {
"key": "user_level",
"value": "vip",
"attrId": "abc123"
}
}
cURL Example
curl -X PUT "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": "vip",
"attrId": "abc123"
}
}'
Response
200Attribute updated successfully
{
"ok": true,
"data": {
"id": "abc123",
"key": "user_level",
"value": "vip"
}
}
Try It Out
https://app.botsi.com/api/v1/web-api
Response
Click "Send API Request" to see the response here.