Files
dashback/docs/api/routes/agentprinter/_id.patch.md
2026-10-31 21:02:53 +01:00

68 lines
1.2 KiB
Markdown

# `PATCH /agentprinter/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Update agent printer
Updates enabled and/or display order (sort) of an agent printer.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | |
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `enabled` | no | boolean | |
| `sort` | no | integer | |
```json
{
"enabled": true,
"sort": 1
}
```
## Signals
On success, emits SSE signal: `agentprinter` (see [`GET /events`](../events.md)).
## Response `200`
Updated agent printer
```json
{
"agentprinter": {
"id": 1,
"printeragentId": 1,
"type": "…",
"model": "…",
"serial": "…",
"enabled": true,
"sort": 1,
"open": true,
"pause": true,
"error": true,
"online": true,
"labelLength": 1
}
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid input or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 404 | Agent printer not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._