Skip to content
QwryAI
Documentation
Pages

Endpoints

Get an action

Read one Action: when the agent uses it, the channels it runs on, its settings, and whether it's live

get_action_build returns an Action the way its editor shows it: its type, name, When to use, whether it runs only inside procedures, its channels and its settings, plus whether it's live. Pass back the same shape to Update an action. For the full stored definition, including the inputs the Action collects, get_automation_detail returns it as JSON in pages.

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

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.
action_idstringYesThe Action's id from List actions. Its actionId reference works too.

The full definition

get_automation_detail takes chatbotId, kind: "ai_action", draftId (the Action's id) and offset. It returns the Action's definition as a JSON string, specJson, 8,000 characters at a time, with revision, contentHash, nextOffset and totalCharacters. Start at 0, then send each nextOffset with expectedHash set to the contentHash until nextOffset is null. The inputs the Action collects are in the definition's contract.inputSchema.

Request example

Bash
curl -X POST 'https://api.qwryai.com/public/v1/tools/get_action_build' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"chatbotId": "YOUR_AGENT_ID", "action_id": "ACTION_ID"}'

Response

JSON
{
  "success": true,
  "data": {
    "action_id": "action-draft:8c1e5b20-4a7d-4f3e-9b2c-6d0a1e7f3c58",
    "buildable": true,
    "build": {
      "type": "escalation",
      "name": "Create ticket",
      "when_to_use": "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.",
      "procedure_only": false,
      "channels": ["api", "web", "agent_page", "email", "facebook", "instagram", "whatsapp"],
      "config": {
        "platform": "qwryai",
        "details_collection": "conversation",
        "ticket_fields": [],
        "tags": [],
        "messages": {
          "informationRequest": "Please share the details for your support request.",
          "queued": "An agent will be connected to the chat shortly.",
          "assigned": "A support agent has joined the conversation.",
          "cancelled": "Ticket creation dismissed",
          "timeout": "Waiting for support agent to join",
          "failure": "Unable to connect to support."
        }
      }
    },
    "live": true,
    "enabled": true
  }
}
FieldTypeDescription
build.typestringThe Action type, such as custom_api, collect_leads, collect_data, escalation (Create ticket), live_chat, web_search, calendly or shopify.
build.namestringThe Action's name.
build.when_to_usestringWhen the agent uses it.
build.procedure_onlybooleantrue when only procedures can run it.
build.channelsarrayWhere it can run. web is the Chat bubble, agent_page the Help Page and facebook Messenger; the others are api, email, whatsapp, instagram, telegram, slack, phone, android_sdk, ios_sdk and so on.
build.configobjectThe type's own settings. get_action_build_schema describes them for each type.
livebooleanWhether customers can use the saved version. Lead forms, tickets, live chat and Shopify Actions save live; editor-built Actions (API, widgets, forms, integrations) go live when published.
enabledbooleanLead forms, tickets, live chat and Shopify Actions: whether it's switched on.
test_statusstringEditor-built Actions only: the last endpoint test's result, or not_run.
pending_change_keystringEditor-built Actions only: the key of a saved change that isn't published yet, or null.
buildablebooleanfalse for an Action whose settings only its dashboard editor can change; reason says why. Read its definition with get_automation_detail.

Errors

HTTP statuscodewhen
400INVALID_ARGUMENTSaction_id is missing, or a get_automation_detail argument is out of range.
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 Action has that id, or get_automation_detail's expectedHash no longer matches because the Action changed. message says which; start again at offset 0.
413RESULT_TOO_LARGEThe answer 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