Skip to content
QwryAI
Documentation
Pages

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.

POSThttps://api.qwryai.com/public/v1/tools/get_procedure_context

Authentication

Send your API key as Authorization: Bearer YOUR_API_KEY. The key needs Read actions and procedures. See Authentication.

Body parameters

NameTypeRequiredDescription
chatbotIdstringYesThe agent's id, from list_agents.

Request example

Bash
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.

JSON
{
  "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": {}
  }
}
FieldTypeDescription
variables[].tokenstringThe attribute as procedures write it, {{contact.email}}.
variables[].namestringIts label.
variables[].descriptionstringWhat it holds.
variables[].groupstringcontact or conversation.

Creating and editing attributes isn't available through the API. Manage them in the dashboard; see Contacts.

Errors

HTTP statuscodeWhen
400CHATBOT_ID_REQUIREDchatbotId is missing or isn't a valid agent id.
403INSUFFICIENT_PERMISSIONThe key doesn't hold Read actions and procedures.
404CHATBOT_NOT_FOUNDNo agent with that chatbotId in your workspace.

See Error Handling for authentication and rate-limit errors.

Explore the documentation