Endpoints
List actions
List an agent's Actions with whether each is live, 20 per page
automation_drafts with kind set to ai_action lists the Actions on the agent's Actions page: each one's name, description, revision and whether it's switched on for customers. Preview copies and the built-in tools procedures use aren't listed. Actions 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 | ai_action for Actions. (playbook lists procedures; see List procedures.) |
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": "ai_action"}'async function listActions(agentId, apiKey) {
const actions = [];
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: "ai_action", ...(afterId ? { afterId } : {}) }),
}
);
const { data } = await response.json();
actions.push(...data.items);
afterId = data.nextCursor;
} while (afterId);
return actions;
}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": "ai_action"},
)
for action in response.json()["data"]["items"]:
print(action["name"], action["status"])Response
{
"success": true,
"data": {
"kind": "ai_action",
"surface": "authoring_drafts",
"items": [
{
"id": "action-draft:8c1e5b20-4a7d-4f3e-9b2c-6d0a1e7f3c58",
"actionId": "action:create_ticket:2b7d9e41-0c3a-4e65-8f19-a4d2c6b8e017",
"usageScope": { "kind": "reusable" },
"status": "enabled",
"revision": 1,
"updatedAt": "2026-11-30T18:47:10.000Z",
"name": "Create ticket",
"nameTruncated": false,
"description": "Use this when a customer reports a damaged or faulty item. First ask for their email address and what is wrong with the item, then create the ticket.",
"descriptionTruncated": false
},
{
"id": "action-draft:41a7c3e9-5b2d-4c80-a6f1-0e9d8b7c2a35",
"actionId": "action:live_chat:7e2f0b6c-9d41-4a3e-b852-1c6a0f4d9e23",
"usageScope": { "kind": "reusable" },
"status": "enabled",
"revision": 1,
"updatedAt": "2026-11-30T18:47:17.639Z",
"name": "QwryAI live chat",
"nameTruncated": false,
"description": "Use this when the customer asks to speak to a human agent or a real person.",
"descriptionTruncated": false
}
],
"nextCursor": null
}
}| Field | Type | Description |
|---|---|---|
id | string | The Action's draft id. Pass it as draftId or action_id to the other Action tools. |
actionId | string | The Action's reference, as a procedure step names it: [[actionId]]. |
usageScope | object | { "kind": "reusable" } for an Action any procedure or conversation can use, or { "kind": "playbook_private", "playbookId" } for one that belongs to a single procedure. |
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 edit or delete. |
updatedAt | string | When the draft last changed, in ISO 8601. |
name | string | The Action's name, cut to 256 characters; nameTruncated is true when it was cut. |
description | string | When the agent should use it, 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.