curl --request POST \
--url 'https://api.computer.stateset.app/api/v1/jobs/cancel-by-tag' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"tags": [
"priority"
],
"reason": "Two-person tent, green — replacement for damaged pole set.",
"dry_run": true
}'
{
"dry_run": false,
"matched": 1,
"cancelled": 1,
"matched_job_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
]
}
Cancel Jobs By Tag V1
Cancel every live job that matches a tag filter. AND-match: a job must carry every supplied tag to be cancelled…
POST
/
api
/
v1
/
jobs
/
cancel-by-tag
curl --request POST \
--url 'https://api.computer.stateset.app/api/v1/jobs/cancel-by-tag' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"tags": [
"priority"
],
"reason": "Two-person tent, green — replacement for damaged pole set.",
"dry_run": true
}'
{
"dry_run": false,
"matched": 1,
"cancelled": 1,
"matched_job_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
]
}
Cancel every live job that matches a tag filter.
AND-match: a job must carry every supplied tag to be cancelled. Only
queued / running / awaiting_approval jobs are affected — terminal
jobs are excluded by the SQL filter, regardless of their tags.
Default
dry_run=true so callers always confirm the count before
issuing a destructive op. Hard cap of 200 cancellations per call to
keep the operation bounded; narrow the filter or call repeatedly if
you legitimately need more.
Request body
CancelByTagRequest
string[]
required
Tag values to match — AND-semantics, same as
GET /jobs?tag=. Up to 10 tags per request.string,null
Optional reason stamped on every cancelled job.
boolean
When true (default), counts what would be cancelled without issuing any cancellations. Always start here; flip to false once the count looks right.
Response
CancelByTagResponse
boolean
required
integer
required
integer
required
string[]
required
IDs of every live job that matched the tag filter, regardless of dry_run. Capped at 200 to avoid huge response bodies; if you hit the cap, narrow your tag filter.
Status codes
| Code | Meaning |
|---|---|
200 | Successful Response |
422 | Validation Error |
curl --request POST \
--url 'https://api.computer.stateset.app/api/v1/jobs/cancel-by-tag' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"tags": [
"priority"
],
"reason": "Two-person tent, green — replacement for damaged pole set.",
"dry_run": true
}'
{
"dry_run": false,
"matched": 1,
"cancelled": 1,
"matched_job_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
]
}
Last modified on August 31, 2026