Cancel a running ingestion job early
Ask an active ingestion job to stop. Cancellation is cooperative: it stops between documents, and what it already ingested stays.
POST
/
knowledge
/
jobs
/
{job_id}
/
cancel
curl --request POST "$MITHUNAI_URL/mithunai/api/v1/knowledge/jobs/9a4c2e71-6b0d-4f38-a5e2-1c7d8f3b6e40/cancel" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"
import os, requests
job_id = "9a4c2e71-6b0d-4f38-a5e2-1c7d8f3b6e40"
response = requests.post(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/knowledge/jobs/{job_id}/cancel",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())
const jobId = '9a4c2e71-6b0d-4f38-a5e2-1c7d8f3b6e40'
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/knowledge/jobs/${jobId}/cancel`,
{
method: 'POST',
headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}` },
},
)
console.log(await response.json())
{ "requested": true }
{ "requested": false }
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }
Cancellation is cooperative. A job that is
pending or queued never starts. A running job stops between documents, and documents ingested before it stops remain in the collection. The job’s status becomes cancelled once it has stopped, so poll Get a job to confirm. A cancellation applies to the current attempt only: if that attempt ends before it next checks, the job keeps the status it ended with, and if it failed and is retried, the retry runs.
requested is false when there is no active job with this ID in your organization. That covers a job that has already ended, an ID that does not exist, and another organization’s job, which are deliberately not distinguished. Only an ID longer than 64 characters returns 404.
Cancelling requires a role that can add documents. A read-only member receives 403.
string
required
Job ID (a UUID).
Response
boolean
required
true when cancellation was recorded on an active job. false otherwise.curl --request POST "$MITHUNAI_URL/mithunai/api/v1/knowledge/jobs/9a4c2e71-6b0d-4f38-a5e2-1c7d8f3b6e40/cancel" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"
import os, requests
job_id = "9a4c2e71-6b0d-4f38-a5e2-1c7d8f3b6e40"
response = requests.post(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/knowledge/jobs/{job_id}/cancel",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())
const jobId = '9a4c2e71-6b0d-4f38-a5e2-1c7d8f3b6e40'
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/knowledge/jobs/${jobId}/cancel`,
{
method: 'POST',
headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}` },
},
)
console.log(await response.json())
{ "requested": true }
{ "requested": false }
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }
Last modified on November 7, 2026
curl --request POST "$MITHUNAI_URL/mithunai/api/v1/knowledge/jobs/9a4c2e71-6b0d-4f38-a5e2-1c7d8f3b6e40/cancel" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"
import os, requests
job_id = "9a4c2e71-6b0d-4f38-a5e2-1c7d8f3b6e40"
response = requests.post(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/knowledge/jobs/{job_id}/cancel",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())
const jobId = '9a4c2e71-6b0d-4f38-a5e2-1c7d8f3b6e40'
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/knowledge/jobs/${jobId}/cancel`,
{
method: 'POST',
headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}` },
},
)
console.log(await response.json())
{ "requested": true }
{ "requested": false }
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }