Skip to content
QwryAI
Documentation
Pages

Endpoints

Delete an action

Delete an Action's draft and its routing through a review, after pausing it

delete_action deletes an Action from the agent's Actions page, together with the routing that lets the agent pick it. The call returns a review; nothing is deleted until you apply it. Published versions, releases and the history of past runs are kept.

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

Authentication

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

Body parameters

NameTypeRequiredDescription
chatbotIdstringYesThe agent's id, from list_agents.
draftIdstringYesThe Action's id, from List actions.
expectedRevisionintegerYesThe Action's current revision.

Request example

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

Response

The review

JSON
{
  "success": true,
  "data": {
    "status": "review_required",
    "reviewId": "8a4c2e60-7b1d-4f39-9e05-3c6d1b2a7f48",
    "tool": "delete_action",
    "changes": [
      {
        "title": "Delete Action draft: Create ticket",
        "before": { "name": "Create ticket" },
        "after": { "deleted": true, "retained": "Immutable compiled versions, releases and execution history" }
      }
    ],
    "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."
  }
}

After you apply it

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

JSON
{
  "success": true,
  "data": {
    "status": "succeeded",
    "reviewId": "8a4c2e60-7b1d-4f39-9e05-3c6d1b2a7f48",
    "tool": "delete_action",
    "data": {
      "applied": true,
      "effect": "deleted_draft",
      "draftId": "action-draft:8c1e5b20-4a7d-4f3e-9b2c-6d0a1e7f3c58",
      "deletedSkillDraftIds": ["skill-draft:create_ticket:2b7d9e41-0c3a-4e65-8f19-a4d2c6b8e017"],
      "retained": "Immutable compiled versions, releases and execution history",
      "receiptId": "<receiptId>"
    },
    "receipt": { "applied": true }
  }
}

deletedSkillDraftIds lists the routing drafts removed with the Action. The receipt is shortened here.

Errors

HTTP statuscodewhen
400INVALID_ARGUMENTSAn argument failed the schema, or the delete can't be prepared: no Action has that id, expectedRevision isn't current, or the Action is still live. 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.
409STALE_REVIEWOn apply: the Action changed after the review. Read it again and call the tool again.
409REVIEW_ALREADY_USED / REVIEW_EXPIREDOn apply: the review was used already, or more than 15 minutes passed.
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