Cancel Job
POST
/api/jobs/{prompt_id}/cancel
const url = 'https://example.com/api/jobs/example/cancel';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/jobs/example/cancel \ --header 'Authorization: Bearer <token>'Take an unfinished job off its node and mark it failed with error “Cancelled”.
A queued job is deleted from the node’s queue. A running one is interrupted only when the node reports it as the job on the GPU, since an untargeted /interrupt stops whatever is running, and older ComfyUI builds ignore the prompt_id it is sent with. If the node doesn’t answer, the job is closed in Studio only.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”prompt_id
required
Prompt Id
string
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
Response Cancel Job Api Jobs Prompt Id Cancel Post
object
key
additional properties
any
Examplegenerated
{}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}