Endpoints
List procedures
List an agent's procedures with whether each is live, 20 per page
automation_drafts with kind set to playbook lists the procedures on the agent's Procedures page: each one's name, description, revision and whether it's switched on for customers. Steps aren't included; read one procedure with Get a procedure. Procedures come back in id order, 20 at a time.
POST
https://api.qwryai.com/public/v1/tools/automation_draftsAuthentication
Send your API key as Authorization: Bearer YOUR_API_KEY; it needs the Read actions and procedures permission. See Authentication.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
chatbotId | string | Yes | The agent's id, from list_agents. |
kind | string | Yes | playbook for procedures. (ai_action lists Actions; see List actions.) |
afterId | string | No | The nextCursor from the previous page. Leave it out for the first page. |
Request example
curl -X POST 'https://api.qwryai.com/public/v1/tools/automation_drafts' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"chatbotId": "YOUR_AGENT_ID", "kind": "playbook"}'async function listProcedures(agentId, apiKey) {
const procedures = [];
let afterId;
do {
const response = await fetch(
"https://api.qwryai.com/public/v1/tools/automation_drafts",
{
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ chatbotId: agentId, kind: "playbook", ...(afterId ? { afterId } : {}) }),
}
);
const { data } = await response.json();
procedures.push(...data.items);
afterId = data.nextCursor;
} while (afterId);
return procedures;
}import requests
response = requests.post(
"https://api.qwryai.com/public/v1/tools/automation_drafts",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"chatbotId": "YOUR_AGENT_ID", "kind": "playbook"},
)
enabled = [p["name"] for p in response.json()["data"]["items"] if p["status"] == "enabled"]Response
{
"success": true,
"data": {
"kind": "playbook",
"surface": "authoring_drafts",
"items": [
{
"id": "playbook-draft:5a8d2c71-e94b-4f06-b3a2-7c1e0d9f4b68",
"playbookId": "5a8d2c71-e94b-4f06-b3a2-7c1e0d9f4b68",
"status": "enabled",
"revision": 1,
"updatedAt": "2026-11-30T18:47:24.973Z",
"name": "Lost loyalty card",
"nameTruncated": false,
"description": "Handles a customer who says they lost their loyalty card: creates a ticket and arranges a replacement.",
"descriptionTruncated": false
},
{
"id": "playbook-draft:c0f7e3a5-21d8-4b9c-8e46-3a5b7d9f1c02",
"playbookId": "c0f7e3a5-21d8-4b9c-8e46-3a5b7d9f1c02",
"status": "disabled",
"revision": 3,
"updatedAt": "2026-11-30T18:47:27.049Z",
"name": "Speak to a manager",
"nameTruncated": false,
"description": "Hands a customer who asks for a manager about a complaint over to a person.",
"descriptionTruncated": false
}
],
"nextCursor": null
}
}| Field | Type | Description |
|---|---|---|
id | string | The procedure's id. Pass it as draftId or procedure_id to the other procedure tools. |
playbookId | string | The procedure's stable identity, kept across versions. |
status | string | enabled when it's live for customers, disabled otherwise. |
revision | integer | Goes up with every saved change. Send it as expectedRevision when you delete or pause. |
updatedAt | string | When it last changed, in ISO 8601. |
name | string | The name, cut to 256 characters; nameTruncated is true when it was cut. |
description | string | The description, cut to 256 characters, or null; descriptionTruncated says whether it was cut. |
nextCursor | string | Send it as afterId for the next page; null on the last page. |
Errors
| HTTP status | code | when |
|---|---|---|
| 400 | INVALID_ARGUMENTS | kind is missing or isn't ai_action or playbook, or afterId is empty. |
| 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. |
| 429 | INTEGRATION_RATE_LIMIT_EXCEEDED | More than 2,000 requests in 15 minutes for this key. |
| 500 | TOOL_FAILED | The tool failed on our side. Try again. |
Authentication and plan errors are listed in Error Handling.