cURL
curl -X POST https://api.neuraldraft.io/v1/jobs/job_2Ngd9KqLmRpW/cancel \
-H "Authorization: Bearer ndsk_live_yourkey"await nd.jobs.cancel("job_2Ngd9KqLmRpW");
requests.post("https://api.neuraldraft.io/v1/jobs/job_2Ngd9KqLmRpW/cancel",
headers={"Authorization": f"Bearer {key}"})
<?php
$client->post('jobs/job_2Ngd9KqLmRpW/cancel', [
'headers' => ['Authorization' => 'Bearer '.$key],
]);
{
"id": "job_2Ngd9KqLmRpW",
"type": "blog_post.generate",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"progress": 50,
"message": "<string>",
"steps": [
{
"name": "<string>",
"completed": true,
"active": true
}
],
"result": {},
"error": {
"code": "upstream_unavailable",
"message": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource.",
"code": "not_found",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"code": "validation_failed",
"detail": "One or more fields failed validation.",
"instance": "req_2Nh4PqRsTuVw",
"cost": 1,
"balance": 0,
"errors": {
"customer_email": [
"The customer email field must be a valid email."
],
"starts_at": [
"The starts at field must be a valid ISO 8601 date."
]
}
}Jobs
Cancel a job
Attempts to cancel an in-flight job. Best-effort — already-completed
steps are not undone, but no new work starts. Sets status: cancelled.
POST
/
jobs
/
{id}
/
cancel
cURL
curl -X POST https://api.neuraldraft.io/v1/jobs/job_2Ngd9KqLmRpW/cancel \
-H "Authorization: Bearer ndsk_live_yourkey"await nd.jobs.cancel("job_2Ngd9KqLmRpW");
requests.post("https://api.neuraldraft.io/v1/jobs/job_2Ngd9KqLmRpW/cancel",
headers={"Authorization": f"Bearer {key}"})
<?php
$client->post('jobs/job_2Ngd9KqLmRpW/cancel', [
'headers' => ['Authorization' => 'Bearer '.$key],
]);
{
"id": "job_2Ngd9KqLmRpW",
"type": "blog_post.generate",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"progress": 50,
"message": "<string>",
"steps": [
{
"name": "<string>",
"completed": true,
"active": true
}
],
"result": {},
"error": {
"code": "upstream_unavailable",
"message": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource.",
"code": "not_found",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"code": "validation_failed",
"detail": "One or more fields failed validation.",
"instance": "req_2Nh4PqRsTuVw",
"cost": 1,
"balance": 0,
"errors": {
"customer_email": [
"The customer email field must be a valid email."
],
"starts_at": [
"The starts at field must be a valid ISO 8601 date."
]
}
}Authorizations
Project API key. Pass as Authorization: Bearer ndsk_live_.... Manage
keys via /projects/me/api-keys. Test-mode keys use
the ndsk_test_ prefix.
Path Parameters
Example:
"job_2Ngd9KqLmRpW"
Response
Cancelled.
Example:
"job_2Ngd9KqLmRpW"
Available options:
blog_post.generate, social_post.generate, image.generate, translation.batch, content_plan.generate, website.generate Available options:
pending, processing, completed, failed, cancelled Required range:
0 <= x <= 100Show child attributes
Show child attributes
Result payload when status is completed. Shape depends on type:
blog_post.generate→{ post_id, slug, title }social_post.generate→{ social_post_id, title, platforms }image.generate→{ url, key, width, height }translation.batch→{ keys_translated: int, locales: [string] }
Show child attributes
Show child attributes