Accept a Spoolman spool event and print its label
const url = 'https://example.com/api/v1/webhook/spoolman';const options = { method: 'POST', headers: {'X-API-Key': 'example', 'Content-Type': 'application/json'}, body: '{"quantity":1,"spool_id":"example","type":"example"}'};
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/v1/webhook/spoolman \ --header 'Content-Type: application/json' \ --header 'X-API-Key: example' \ --data '{ "quantity": 1, "spool_id": "example", "type": "example" }'Receives a Spoolman webhook event for a spool update and prints the spool label through the print queue, like POST /api/v1/print. Requires the X-API-Key header — returns 503 when the key is not configured, 401 when the key is wrong, 422 when required payload fields are missing and 429 above the per-key rate limit. Printer and lookup errors (no tape, printer disabled or offline, integration failed) are answered as by POST /api/v1/print (409/422/502/503); an unknown spool or product answers 404 app-lookup-not-found and an integration that is not configured 503 integration_not_configured (both in the problem-detail body shape). Nothing is queued. On success returns 202 with the new job’s UUID; the queue worker prints it. One label is printed; quantity is accepted but not printed.
Parameters
Abschnitt betitelt „Parameters“Header Parameters
Abschnitt betitelt „Header Parameters“Request Bodyrequired
Abschnitt betitelt „Request Bodyrequired“Event payload emitted by Spoolman when a spool is updated.
object
Spoolman spool identifier (as a string to accept both int and str JSON input)
Event type string (e.g. ‘updated’, ‘created’, ‘consumed’)
Example generated
{ "quantity": 1, "spool_id": "example", "type": "example"}Responses
Abschnitt betitelt „Responses“Successful Response
202 Accepted response body for both webhook endpoints.
object
UUID of the new print job. Webhook jobs have no owner: an admin or SSO caller can follow it under GET /api/v1/jobs/{job_id}
Example generated
{ "job_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Validation Error