Endpoints
Get custom attributes schema
Read the contact and conversation attributes your agent can use, with get_procedure_context
API v1's custom attributes endpoint has no direct equivalent. The built-in contact fields and your workspace's custom attributes come back from the Tools API's get_procedure_context tool, as the variables a procedure can use. Each one has its token, name, description and whether it belongs to the contact or the conversation. Archived attributes are left out.
https://api.qwryai.com/public/v1/tools/get_procedure_contextAuthentication
Send your API key as Authorization: Bearer YOUR_API_KEY. The key needs Read actions and procedures. See Authentication.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
chatbotId | string | Yes | The agent's id, from list_agents. |
Request example
curl -X POST 'https://api.qwryai.com/public/v1/tools/get_procedure_context' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"chatbotId": "YOUR_AGENT_ID"}'Response
The attributes are in variables. The response also lists the agent's Actions, the rules for writing procedure steps and the plan's procedure limits.
{
"success": true,
"data": {
"variables": [
{ "token": "contact.email", "name": "Email", "description": "The contact's email address", "group": "contact" },
{ "token": "contact.plan_tier", "name": "Plan tier", "description": "The customer's subscription plan", "group": "contact" }
],
"actions": [],
"rules": {},
"triggers": {},
"quota": {}
}
}| Field | Type | Description |
|---|---|---|
variables[].token | string | The attribute as procedures write it, {{contact.email}}. |
variables[].name | string | Its label. |
variables[].description | string | What it holds. |
variables[].group | string | contact or conversation. |
Creating and editing attributes isn't available through the API. Manage them in the dashboard; see Contacts.
Errors
| HTTP status | code | When |
|---|---|---|
| 400 | CHATBOT_ID_REQUIRED | chatbotId is missing or isn't a valid agent id. |
| 403 | INSUFFICIENT_PERMISSION | The key doesn't hold Read actions and procedures. |
| 404 | CHATBOT_NOT_FOUND | No agent with that chatbotId in your workspace. |
See Error Handling for authentication and rate-limit errors.