ScriptRuns

Cancel script run

Changed on

Cancels a script run that has not started. A running script runs to its end or its timeout (409 run_not_cancellable).

post/script_runs/{id}/cancel

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Path parameters

id, string required

Script run id (srun_...)

Headers

Idempotency-Key, string

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Response

The cancelled run

ScriptRun required
object, string required
id, string required
status, 'queued' | 'in_progress' | 'completed' | 'failed' | 'cancelled' | 'timed_out' required
result, unknown required
result_truncated, boolean required

The value was too large to return, so result holds the start of its JSON text instead.

output, string nullable required

What the script printed: its start and end when long, with the cut marked.

error, string nullable required
args, string[] required
calls, object[] required

Every tool call the script made, in order: {role, status, read_only, error_code, approval_id}. A 202 call did not run and names its approval.

approvals, Approval[] required

What the script's gated calls froze, as each stands now. Approving one runs that call, never the script again.

pending_approval_ids, string[] required

Approvals still waiting for a decision: POST /approvals/{id}/approve or /deny.

artifacts, Artifact[] required

Files the script wrote to outputDir.

timeout_seconds, integer required
started_at, string nullable required
completed_at, string nullable required
created_at, string date-time required

Changes

    • info

      added the required property approvals/items/details to the response with the status

    • info

      added the required property approvals/items/request to the response with the status

    • warning

      added the new site enum value to the approvals/items/kind response property for the response status