Cancel a job
Stop a queued or running job and get a refund.
POST/v2/jobs/{id}/cancelHeaders
AuthorizationstringRequiredBearer mk_live_…: your API key. See Authentication.
Path parameters
idstringRequired- The job id a create call answered with.
Outcomes
| outcome | Meaning |
|---|---|
| refunded | Stopped before it started; credits_refunded are back now. |
| requested | Already running: asked to stop, and refunded if nothing is delivered. |
| too-late | It had already finished. Nothing changes. |
| already-settled | It 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.