Runs & Results
Cancel a run
Cancel a queued or running run. Produced records are kept.
POST
Cancel a run
POST https://api-datahub.octoparse.com/v1/runs/{run_id}/cancel
Authentication: API key required (Authorization: Bearer <API Key>).
Sends a cancel signal and briefly waits (up to 5 seconds) for the executor to respond, then returns the current run object. Queued runs stop immediately; running ones usually stop cooperatively within a few seconds. Records already written are kept (partial is true), remain readable, and are billed only for what was produced.
Ownership matches run detail: you can only cancel runs you started. After cancel, confirm the terminal state with Get a run.
Request
Path parameters
string
required
Run id.
Example request
Response
200 success
data. Fields:
string
required
—
string
—
string
—
string
—
string
—
string
—
enum
required
Values:
PENDING / QUEUED / RUNNING / SUCCEEDED / PARTIALLY_SUCCEEDED / FAILED / CANCELLED / EXPIRED.object
—
object
—
string
—
boolean
—
boolean
true while cancellation has been requested and the run is still winding down (cooperative stop / partial-result recovery). Always false in terminal states (normalized server-side), so clients need not derive it from state.string
—
string
—
string
—
string
—
string
When a worker first claimed the run. Unlike
started_at, this is never rewritten on retry, so it is the anchor for queue time: queued = first_started_at - created_at, and total wall time = finished_at - first_started_at. Deriving queue time from started_at counts earlier attempts as queueing. null only for runs never claimed.string
—
object
Objective usage metering: how much the run did. Kept separate from billing; this is what evaluations compare against.
object
Billing ledger = usage × pricing × billing rules: how much is charged.
object
—
object[]
—
object[]
—
Errors
Error responses use
{"error": {code, category, message, retryable}}. See Errors.