Chuyển đến nội dung tài liệu
Tài liệu dành cho nhà phát triển
API Reference

API Reference

Cancel Jobs

Cancel your API Jobs in the Pending state, before execution preparation begins.

POST/v1/api/job/cancel
Try it out

Request example

bash
curl --fail-with-body --silent --show-error --max-time 30 \
  -X POST "$NORDY_BASE_URL/v1/api/job/cancel" \
  -H "api-key: $NORDY_API_KEY" \
  -H "content-type: application/json" \
  --data '{"job_ids":["68abcdef0123456789abcdef"]}'

Success response200 OK

JSON
{
  "canceled_count": 1,
  "results": [
    { "id": "68abcdef0123456789abcdef", "status": "canceled" }
  ]
}

Authentication

api-keystringrequired

Send the user API key in the api-key request header.

Request body

Content-Type: application/json

job_idsstring[]bodyrequired
An array of 1 to 1,000 Job IDs (24-character hexadecimal strings). Duplicate IDs are processed once. Invalid input rejects the entire request before any cancellation.

Success response

200 OK HTTP 200 can include unsuccessful cancellations; check results[].status for each ID.

canceled_countintegerresponserequired
Number newly canceled by this request.
results[].idstringresponserequired
Requested Job ID.
results[].statuscanceled | already_canceled | not_cancelable | not_foundresponserequired
canceled: newly canceled; already_canceled: previously canceled; not_cancelable: execution preparation has begun or the Job is finished; not_found: missing, another account’s, or not an API Job.

Notes

  • You can cancel Jobs created with any API key on the same account.
  • The queued API status also includes Jobs preparing to execute, which cannot be canceled.

Responses and errors

StatusCodeDescription
400INVALID_JSON, INVALID_INPUTProvide a valid job_ids array.
413REQUEST_BODY_TOO_LARGEThe JSON body exceeds 50 MiB.
415UNSUPPORTED_MEDIA_TYPESend Content-Type: application/json.
400MULTIPLE_AUTH_CREDENTIALSSend the API key without login cookies.
401AUTHENTICATION_REQUIREDMissing or invalid API key.
403USER_SUSPENDED, PRO_SUBSCRIPTION_REQUIRED, INVALID_INPUTThe account is suspended, lacks an active Pro subscription, or cannot access the API.
500INTERNAL_ERRORAn error occurred while processing the request. Check Job status before retrying.