runs

Cancel runs in bulk

Cancels up to 100 runs in one environment.

Supports two modes:

  • By IDs: provide run_ids in the request body to cancel specific runs. Query filters are ignored.
  • By filter: omit run_ids and use the query parameters to match runs.

Only runs with status scheduled, queued, started or awaiting_approval are cancelled; other selected runs are skipped. A selection of more than 100 cancellable runs returns 422.

Required permission: runs.cancel.

post/v1/projects/{project_id}/runs/bulk-cancel

Request

  • Base URL
    https://api.connic.co
  • Auth
    HTTP bearer

Path parameters

project_id, string uuid required

ID of the project the API key belongs to.

Query parameters

environment_id, string uuid required

Environment to cancel runs in; only its runs are selected.

deployment_id, string uuid nullable

Only runs executed by this deployment.

start_date, string date-time nullable

Only runs queued at or after this time; applies only together with end_date.

end_date, string date-time nullable

Only runs queued at or before this time; applies only together with start_date.

status_filter, RunStatus[] nullable

Only runs in these statuses. Only scheduled, queued, started and awaiting_approval runs can be cancelled, so other values match no runs.

guardrail_outcome, string[] nullable

Only runs with at least one guardrail intervention of these outcomes.

agent_name, string nullable

Only runs of this agent.

test_name, string[] nullable

Filter by A/B test variant names; use base for runs without a variant

exclude_test_runs, boolean

Exclude runs with a test name

search, string nullable

Run search text or filter expression, as in GET /runs.

Request body

BulkCancelBody required

Runs to cancel.

run_ids, string[] nullable

IDs of the runs to cancel, at most 100. Omit or send null to select runs with the query filters instead; an empty list is rejected.

Response

Successful Response

PublicBulkCancelResponse required
ok, boolean required

Whether the operation succeeded.

cancelled_count, integer required

Number of runs cancelled.

Changes

No recorded changes to this operation across all 17 revisions of this API.