Skip to content

Give up a held tape batch

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

Discards a run that waits for a confirmation or stopped (#277): the labels of the waiting parts are cancelled (run_discarded), a stopped run’s failed labels stay as they are, and the run is forgotten. A printing run answers 409 run_not_held. Held runs live in memory: a hub restart fails every label that waited for a confirmation (tape_run_interrupted), also a part that was continued but had not started, and a stopped run can then no longer be reprinted (run is null, this answers 404). A held run counts against LABELYARD_MAX_QUEUED_RUNS_PER_KEY (default 20) of its key, not against the printer’s cap: over it a new batch of that key answers 429 too-many-queued-runs until a run is continued, reprinted to the end or discarded. At most five runs per printer are held, at most two of one key: a further held run discards that key’s own oldest (run_discarded_limit), never another key’s. While the five places are taken, a batch of more than 50 labels from a key without a held run there gets 429 too-many-queued-runs; smaller batches are always taken. All callers without a key (SSO users) count as one key; a browser session signed in with a key counts as that key.

batch_id
required
Batch Id
string format: uuid

Successful Response

The key lacks the print scope or may not use this printer.

No such batch, or no tape run of it that waits for an action.

run_not_held.

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"
}
]
}