Cancel a running async operation
On this page
POST
/v1/operations/{operation_id}/cancelcancel_operation| Risk | write |
| Authentication | API key or OAuth access token |
| Scopes | none (any valid credential) |
| Idempotency | natural: repeating the call gives the same result |
| Dry run | not applicable |
| Success status | 200 |
| Response type | application/json |
What it does#
- Use when: You started a bulk call by mistake; items not yet applied are skipped.
- Do not use when: it already finished (nothing changes) or you want to undo applied items.
- Side effects: Skips pending items; Items already applied stay applied.
- Reversible: No.
- Required scope: none (any valid credential).
- Idempotency: safe to repeat (same result).
- Typical next step: call get_operation to see what was applied.
Side effects#
- Skips pending items
- Items already applied stay applied
Request#
Path parameters#
| Field | Type | Description |
|---|---|---|
operation_id | string |
Query parameters#
None.
Response#
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
kind | string | yes | |
state | one of "queued", "running", "succeeded", "failed", "canceled" | yes | |
progress | object | yes | |
progress.total | integer, min -9007199254740991, max 9007199254740991 | yes | |
progress.done | integer, min -9007199254740991, max 9007199254740991 | yes | |
progress.counts | object | yes | |
result | any or null | yes | |
problem | any or null | yes | |
created_at | string (date-time) | yes | |
finished_at | string (date-time) or null | yes | |
poll_after_seconds | integer, min -9007199254740991, max 9007199254740991 or null | yes | Suggested wait before asking again; null once finished |
Examples#
canceled#
Request:
curl -X POST 'https://api.seemly.com/v1/operations/opn_0123456789abcdefghjkmnpq/cancel' \
-H "Authorization: Bearer $SEEMLY_API_KEY"const response = await fetch("https://api.seemly.com/v1/operations/opn_0123456789abcdefghjkmnpq/cancel", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
},
});
const result = await response.json();
console.log(response.status, result);import os
import requests
response = requests.post(
"https://api.seemly.com/v1/operations/opn_0123456789abcdefghjkmnpq/cancel",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
},
)
print(response.status_code, response.json())Response: 200:
{
"id": "opn_0123456789abcdefghjkmnpq",
"kind": "bulk_upsert_subscribers",
"state": "canceled",
"progress": {
"total": 500,
"done": 120,
"counts": {
"added_pending": 118,
"invalid": 2
}
},
"result": null,
"problem": null,
"created_at": "2026-02-01T10:00:00Z",
"finished_at": "2026-02-01T10:01:00Z",
"poll_after_seconds": null
}Errors#
Every error is an application/problem+json body with a code, a fix sentence and next_actions. See reading a problem response.