curl -X POST https://api.u1.archetypeai.app/v0.5/batch/jobs/job_2abc3def4ghi5jkl6mno7pqr/cancel \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
job_id = "job_2abc3def4ghi5jkl6mno7pqr"
response = requests.post(
f"https://api.u1.archetypeai.app/v0.5/batch/jobs/{job_id}/cancel",
headers={"Authorization": f"Bearer {api_key}"}
)
result = response.json()
print(f"Job {result['id']} — Status: {result['status']}")
const jobId = 'job_2abc3def4ghi5jkl6mno7pqr';
const response = await fetch(`https://api.u1.archetypeai.app/v0.5/batch/jobs/${jobId}/cancel`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
});
const result = await response.json();
console.log(`Job ${result.id} — Status: ${result.status}`);
{
"id": "job_2abc3def4ghi5jkl6mno7pqr",
"status": "CANCELLED",
"cancelled_at": "2026-04-14T10:10:00Z"
}
{
"code": "NOT_FOUND",
"message": "Job not found",
"error_uid": "err_abc123"
}
{
"code": "CONFLICT",
"message": "Cannot cancel job in COMPLETED state",
"error_uid": "err_def456"
}
{
"detail": "Invalid access with key: api_key_not_found"
}
Jobs
Cancel Job
Cancel a running or pending job
POST
/
batch
/
jobs
/
{id}
/
cancel
curl -X POST https://api.u1.archetypeai.app/v0.5/batch/jobs/job_2abc3def4ghi5jkl6mno7pqr/cancel \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
job_id = "job_2abc3def4ghi5jkl6mno7pqr"
response = requests.post(
f"https://api.u1.archetypeai.app/v0.5/batch/jobs/{job_id}/cancel",
headers={"Authorization": f"Bearer {api_key}"}
)
result = response.json()
print(f"Job {result['id']} — Status: {result['status']}")
const jobId = 'job_2abc3def4ghi5jkl6mno7pqr';
const response = await fetch(`https://api.u1.archetypeai.app/v0.5/batch/jobs/${jobId}/cancel`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
});
const result = await response.json();
console.log(`Job ${result.id} — Status: ${result.status}`);
{
"id": "job_2abc3def4ghi5jkl6mno7pqr",
"status": "CANCELLED",
"cancelled_at": "2026-04-14T10:10:00Z"
}
{
"code": "NOT_FOUND",
"message": "Job not found",
"error_uid": "err_abc123"
}
{
"code": "CONFLICT",
"message": "Cannot cancel job in COMPLETED state",
"error_uid": "err_def456"
}
{
"detail": "Invalid access with key: api_key_not_found"
}
Requires version 1.1.0 or later of the Archetype platform.
Overview
This endpoint cancels a job whose status is currentlyPENDING, RUNNING, or PREEMPTED.
Cancelled jobs cannot be resumed. To pause a job temporarily, use the Pause
Job endpoint instead.
Request
string
required
The unique job identifier
Response
string
The ID of the cancelled job
string
Updated job status (
CANCELLED)string
Timestamp when the job was cancelled
curl -X POST https://api.u1.archetypeai.app/v0.5/batch/jobs/job_2abc3def4ghi5jkl6mno7pqr/cancel \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
job_id = "job_2abc3def4ghi5jkl6mno7pqr"
response = requests.post(
f"https://api.u1.archetypeai.app/v0.5/batch/jobs/{job_id}/cancel",
headers={"Authorization": f"Bearer {api_key}"}
)
result = response.json()
print(f"Job {result['id']} — Status: {result['status']}")
const jobId = 'job_2abc3def4ghi5jkl6mno7pqr';
const response = await fetch(`https://api.u1.archetypeai.app/v0.5/batch/jobs/${jobId}/cancel`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
});
const result = await response.json();
console.log(`Job ${result.id} — Status: ${result.status}`);
{
"id": "job_2abc3def4ghi5jkl6mno7pqr",
"status": "CANCELLED",
"cancelled_at": "2026-04-14T10:10:00Z"
}
{
"code": "NOT_FOUND",
"message": "Job not found",
"error_uid": "err_abc123"
}
{
"code": "CONFLICT",
"message": "Cannot cancel job in COMPLETED state",
"error_uid": "err_def456"
}
{
"detail": "Invalid access with key: api_key_not_found"
}
Only jobs in
PENDING or RUNNING status can be cancelled. Attempting to cancel a job that has already completed, failed, or been cancelled will return a 409 Conflict error.Was this page helpful?