Buni.aiDocs
API referenceInvocations

Cancel or reschedule an invocation

Changes a run that has not started yet.

PATCH/external-invocations/{invocationId}

Changes a run that has not started yet.

  • cancel stops a scheduled run. Its status becomes CANCELLED.
  • reschedule moves a scheduled run to a new time given by runAt or delaySeconds.

Both only work on async runs whose status is SCHEDULED; anything else returns 409. Token rules are the same as for GET.

The same endpoint also accepts approve and reject for an automation run paused at an Approval node. Those two actions are a human decision and need a signed-in Buni.ai user with edit access to the project; an API token cannot approve or reject. Use the dashboard instead.

Authorization

AuthorizationBearer <token>

Authorization: Bearer bai_ext_.... Tokens belong to one project and carry scopes: bot:invoke, flow:trigger, automation:trigger.

In: header

Scope: bot:invoke

Path Parameters

invocationId*string

The invocationId returned when the run was started.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/external-invocations/string" \  -H "Content-Type: application/json" \  -d '{    "action": "cancel"  }'
{  "invocationId": "clx9km1a40031ab12cd34ef41",  "status": "CANCELLED",  "environment": "PRODUCTION",  "triggerSource": "SCHEDULE",  "mode": "ASYNC",  "targetType": "FLOW",  "startedAt": null,  "completedAt": "2026-09-24T11:00:00.000Z",  "durationMs": null,  "errorMessage": null,  "requestPayload": {    "event": "appointment.reminder"  },  "result": null,  "trace": null,  "steps": [],  "callbackAttempts": [],  "scheduledFor": "2026-10-01T08:00:00.000Z",  "schedulerStatus": "CANCELLED",  "schedulerJobName": "external-invocation-clx9km1a40031ab12cd34ef41",  "pendingApproval": null,  "createdAt": "2026-09-24T10:05:00.000Z",  "updatedAt": "2026-09-24T11:00:00.000Z"}