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 premium to vip).

  • When updating an attribute, store the returned attribute id so it can be referenced later.

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

    A successful request returns the updated custom attribute.

Request Body

application/json

ParameterTypeRequiredDescription
profileIdstringOptionalBotsi profile ID. Provide either profileId or customerUserId. Example: 0072102a-c00c-4ea5-9271-1b6e975f2d63
customerUserIdstringRecommendedYour internal user ID. Provide either profileId or customerUserId. Example: user-123
customobjectRequiredCustom attribute object
keystringRequiredThe attribute key. Example: user_level
valuestringRequiredThe attribute value. Example: vip
attrIdstringRequiredThe 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.