Skip to main content
Use this endpoint to attach a custom key-value attribute to a specific Botsify bot user. User attributes let you store contextual information — such as subscription plan, preferred language, or loyalty tier — directly on the user record, which you can then reference in bot flows for personalization or use to build targeted segments. You must supply your bot API key in the body or the X-Api-Key header.

Request

string
required
Your bot’s API key. You may alternatively supply this value in the X-Api-Key request header instead of the body.
string
required
The unique identifier of the target bot user to whom the attribute will be applied.
string
required
The name of the custom attribute you want to set (e.g., plan, city, account_tier).
string
required
The value to assign to the attribute key (e.g., premium, New York, gold).
string
An alternative user identifier. You may supply this instead of or in addition to messenger_user_id when working with users identified by their Messenger session ID.

Example Request

Response

A successful request returns a JSON object confirming that the attribute was stored against the user record. The response echoes back the key and value that were applied, along with the affected user identifier.