Skip to content
QwryAI
Documentation
Pages

Endpoints

Get a procedure

Read one procedure whole: its trigger, its steps, and the steps as a person reads them

get_automation_detail with kind set to playbook returns a procedure as the Procedures editor holds it: its name and description, its trigger (when to use it, the channels it runs on and any trigger chips), its steps in the format Create a procedure and Update a procedure take, and the same steps as numbered lines with Actions by name.

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

Authentication

Send your API key as Authorization: Bearer YOUR_API_KEY; it needs the Read actions and procedures permission. See Authentication.

Body parameters

NameTypeRequiredDescription
chatbotIdstringYesThe agent's id, from list_agents.
kindstringYesplaybook.
draftIdstringYesThe procedure's id, from List procedures.
offsetintegerYesSend 0. A procedure always comes back whole.

Request example

Bash
curl -X POST 'https://api.qwryai.com/public/v1/tools/get_automation_detail' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"chatbotId": "YOUR_AGENT_ID", "kind": "playbook", "draftId": "PROCEDURE_ID", "offset": 0}'

Response

JSON
{
  "success": true,
  "data": {
    "id": "playbook-draft:5a8d2c71-e94b-4f06-b3a2-7c1e0d9f4b68",
    "revision": 1,
    "updatedAt": "2026-11-30T18:47:24.973Z",
    "kind": "playbook",
    "name": "Lost loyalty card",
    "description": "Handles a customer who says they lost their loyalty card: creates a ticket and arranges a replacement.",
    "trigger": {
      "whenToUse": "The customer says they lost their loyalty card.",
      "channels": ["widget", "conversation", "email", "whatsapp"]
    },
    "steps": [
      { "kind": "instruction", "text": "Ask the customer for their loyalty card number and their email address." },
      { "kind": "instruction", "text": "Create a ticket for the lost loyalty card with [[action:create_ticket:2b7d9e41-0c3a-4e65-8f19-a4d2c6b8e017]]." },
      { "kind": "instruction", "text": "Tell the customer their ticket number is [[action:create_ticket:2b7d9e41-0c3a-4e65-8f19-a4d2c6b8e017#ticketId]]." },
      {
        "kind": "branch",
        "branches": [
          {
            "condition": "The customer wants the new card posted to them",
            "steps": [{ "kind": "instruction", "text": "Confirm their postal address." }]
          }
        ],
        "otherwise": [{ "kind": "instruction", "text": "Tell them they can collect it in store." }]
      },
      { "kind": "message", "text": "Your new card will be ready in 5 working days, {{contact.first_name|there}}." }
    ],
    "steps_readable": [
      "1. Ask the customer for their loyalty card number and their email address.",
      "2. Create a ticket for the lost loyalty card with @Create ticket.",
      "3. Tell the customer their ticket number is @Create ticket → ticketId.",
      "4. If The customer wants the new card posted to them:",
      "   - Confirm their postal address.",
      "   Otherwise:",
      "   - Tell them they can collect it in store.",
      "5. Send message: Your new card will be ready in 5 working days, {{contact.first_name|there}}."
    ],
    "url": "/<workspace>/<agentId>/ai-actions/playbooks/playbook-draft%3A5a8d2c71-e94b-4f06-b3a2-7c1e0d9f4b68",
    "surface": "draft_not_publication"
  }
}
FieldTypeDescription
idstringThe procedure's id.
revisionintegerThe saved revision. Send it as expectedRevision when you delete or pause.
name, descriptionstringThe name and description. description is left out when empty.
triggerobjectwhenToUse (the customer request that starts it) and channels, plus any trigger chips: noReply, repeat, schedules, api, ticketOpened, ticketClosed. null until a trigger is saved.
stepsarrayEach step is { "kind": "instruction", "text" }, { "kind": "message", "text", "subject"? } or a branch with branches (condition, steps) and otherwise. In text, [[actionId]] runs an Action, [[actionId#field]] uses a field of its result, and {{contact.email}} is a variable.
steps_readablearrayThe steps as numbered lines, with Actions by name.
urlstringThe procedure's page in the dashboard, relative to https://www.qwryai.com.
surfacestringAlways draft_not_publication: this is the saved draft. status in List procedures says whether it's live.

Errors

HTTP statuscodewhen
400INVALID_ARGUMENTSkind, draftId or offset is missing or invalid.
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.
409VALIDATION_INVALID_BODYNo procedure has that id in this agent. message says so.
413RESULT_TOO_LARGEThe procedure is over 40,000 bytes.
429INTEGRATION_RATE_LIMIT_EXCEEDEDMore than 2,000 requests in 15 minutes for this key.
500TOOL_FAILEDThe tool failed on our side. Try again.

Authentication and plan errors are listed in Error Handling.

Explore the documentation