Docs
Open console
Jobs and files

Cancel a job

Stop a queued or running job and get a refund.

v2 previewPOST/v2/jobs/{id}/cancel

Headers

AuthorizationstringRequired
Bearer mk_live_…: your API key. See Authentication.

Path parameters

idstringRequired
The job id a create call answered with.

Outcomes

outcomeMeaning
refundedStopped before it started; credits_refunded are back now.
requestedAlready running: asked to stop, and refunded if nothing is delivered.
too-lateIt had already finished. Nothing changes.
already-settledIt had already failed or been cancelled. Nothing changes.

Response

On success (200): What the cancel did. The JSON is { "success": true, "data": … }, and inside data:

idstringRequired
The job.
outcomestringRequired
What the cancel did: see the table above.refundedrequestedtoo-latealready-settled
refunded_usdnumberRequired
What was refunded now, in US dollars; 0 when a refund waits on the job stopping.
Response headers (4)
X-Request-Idstring
This request, for support and the console log.
RateLimit-Limitinteger
Requests this key may make per minute.
RateLimit-Remaininginteger
Requests left in the current minute.
RateLimit-Resetinteger
Seconds until the current minute resets.

Status codes

200
What the cancel did.
401
The API key is missing, malformed, unknown or revoked.
429
A limit was reached: requests per minute, or a daily or concurrency limit.
Other
Any other error, in the same envelope.

Every error answers { "success": false, "error": { "code", "message" } }. What each code means, and what to do, is on Errors.