Skip to content
QwryAI
Documentation
Pages

Endpoints

Update a procedure

Change a procedure's name, description, trigger or steps, or pause and resume it

update_procedure saves a change to an existing procedure: send only what you want to change. New steps replace all of its steps, and a new trigger replaces the whole trigger. The call returns a review; nothing changes until you apply it. To pause or resume a published procedure, use toggle_procedure.

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

Authentication

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

Body parameters

Send at least one of name, description, trigger or steps.

NameTypeRequiredDescription
chatbotIdstringYesThe agent's id, from list_agents.
procedure_idstringYesThe procedure's id, from List procedures.
namestringNoA new name, 1 to 100 characters.
descriptionstringNoA new description, up to 500 characters.
triggerobjectNoThe whole new trigger: whenToUse, channels and every chip to keep. A chip you leave out is removed. Same shape as in Create a procedure.
stepsarrayNoAll the procedure's steps after the change, in the same format as Create a procedure. Read them with Get a procedure and change only what you need.

Request example

Bash
curl -X POST 'https://api.qwryai.com/public/v1/tools/update_procedure' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "chatbotId": "YOUR_AGENT_ID",
    "procedure_id": "PROCEDURE_ID",
    "name": "Replace a lost loyalty card"
  }'

Response

The review

A change to the name, description or steps shows the procedure before and after:

JSON
{
  "success": true,
  "data": {
    "status": "review_required",
    "reviewId": "d2e5f8a1-3b6c-4e90-87d4-1a0b9c8e7f65",
    "tool": "update_procedure",
    "changes": [
      {
        "title": "Save Procedure draft: Replace a lost loyalty card",
        "before": {
          "name": "Lost loyalty card",
          "steps": [
            "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."
          ]
        },
        "after": {
          "name": "Replace a lost loyalty card",
          "steps": [
            "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."
          ],
          "url": "/<workspace>/<agentId>/ai-actions/playbooks/playbook-draft%3A5a8d2c71-e94b-4f06-b3a2-7c1e0d9f4b68"
        }
      }
    ],
    "unchanged": [],
    "expiresAt": "2026-12-01T10:15:00.000Z",
    "next": "Show these changes to the user. Call apply_change with this reviewId only after they approve; the review expires in 15 minutes."
  }
}

A trigger change shows the trigger before and after. A toggle_procedure review is titled Pause Playbook: <name> or Resume Playbook: <name> and shows the deployment's state before and after.

After you apply it

Apply with POST https://api.qwryai.com/public/v1/reviews/{reviewId}/apply:

JSON
{
  "success": true,
  "data": {
    "status": "succeeded",
    "reviewId": "d2e5f8a1-3b6c-4e90-87d4-1a0b9c8e7f65",
    "tool": "update_procedure",
    "data": {
      "applied": true,
      "effect": "saved_draft",
      "draftId": "playbook-draft:5a8d2c71-e94b-4f06-b3a2-7c1e0d9f4b68",
      "revision": 2,
      "receiptId": "<receiptId>",
      "publicationChanged": false
    },
    "receipt": { "applied": true }
  }
}

update_procedure saves the draft: customers keep the published version until you publish the change from the Procedures page or with publish_draft (which needs Change agent settings). A toggle_procedure change applies at once and returns the deployment's new state. The receipt is shortened here.

Errors

HTTP statuscodewhen
400INVALID_ARGUMENTSAn argument failed the schema or the procedure's rules, nothing to change was given, the procedure already has these steps and this name, no procedure has that id, or resuming it would pass the plan's limit of enabled procedures. message says which.
400CHATBOT_ID_REQUIREDchatbotId is missing or isn't a valid agent id.
403INSUFFICIENT_PERMISSIONThe key doesn't hold Change actions and procedures.
404CHATBOT_NOT_FOUNDNo agent with that chatbotId in your workspace.
404AUTOMATION_NOT_FOUNDtoggle_procedure: no draft or deployment with those ids.
409AUTOMATION_CONFLICTtoggle_procedure: the revision or sequence changed since you read them, or the procedure is already in the state you asked for. Read get_automation_publication again.
409STALE_REVIEWOn apply: the procedure changed after the review. Read it again and call the tool again.
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