Zum Inhalt springen

Cancel a queued job

POST
/api/v1/jobs/{job_id}/cancel
curl --request POST \
--url https://example.com/api/v1/jobs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cancel \
--header 'X-Label-Hub-Key: <X-Label-Hub-Key>'

Cancels a job that is in queued state. Returns 409 ProblemDetail when the job is in printing (or any other non-QUEUED) state — mid-print abort is unsafe over TCP/9100 because the raster data is already on the wire. Exception: a page job (IPP printer) that the printer already holds is cancelled at the printer: the hub sends Cancel-Job and answers 202 with the job still printing; the job ends cancelled (or failed/interrupted when the page had started) once the printer confirms.

job_id
required
Job Id
string format: uuid

Successful Response

Media typeapplication/json
JobRead

Serialised view of a Job DB row.

object
created_at
required
Created At
string
error
required
Error
Any of:
string
finished_at
required
Finished At
Any of:
string
id
required
Id
string format: uuid
payload
required
Payload
object
key
additional properties
any
printer_id
required
Printer Id
string format: uuid
result
required
Result
Any of:
object
key
additional properties
any
started_at
required
Started At
Any of:
string
state
required
State
string
template_key
required
Template Key
Any of:
string
updated_at
required
Updated At
string

Example generated

{
"created_at": "example",
"error": "example",
"finished_at": "example",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"payload": {},
"printer_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"result": {},
"started_at": "example",
"state": "example",
"template_key": "example",
"updated_at": "example"
}

Cancel requested at the printer (page job)

Media typeapplication/json
JobRead

Serialised view of a Job DB row.

object
created_at
required
Created At
string
error
required
Error
Any of:
string
finished_at
required
Finished At
Any of:
string
id
required
Id
string format: uuid
payload
required
Payload
object
key
additional properties
any
printer_id
required
Printer Id
string format: uuid
result
required
Result
Any of:
object
key
additional properties
any
started_at
required
Started At
Any of:
string
state
required
State
string
template_key
required
Template Key
Any of:
string
updated_at
required
Updated At
string

Example generated

{
"created_at": "example",
"error": "example",
"finished_at": "example",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"payload": {},
"printer_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"result": {},
"started_at": "example",
"state": "example",
"template_key": "example",
"updated_at": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Example generated

{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}