Files
dashback/docs/api/routes/agent/pair.post.md
2026-10-30 18:09:31 +01:00

56 lines
1.1 KiB
Markdown

# `POST /agent/pair`
Public. No cookie required.
Pair printer agent
Public, unauthorized endpoint used by the printer agent to complete pairing using a 6-digit PIN.
Updates `clientserial`, `clientmodel`, and `agentversion`, clears the pairing PIN, and returns a device authentication token.
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `pairingpin` | yes | string | |
| `clientserial` | no | string | |
| `clientmodel` | no | string | |
| `agentversion` | no | string | |
```json
{
"pairingpin": "123456",
"clientserial": "SN-987654321",
"clientmodel": "Epson TM-T88VI",
"agentversion": "1.0.0"
}
```
## Response `200`
Pairing successful
```json
{
"id": 1,
"name": "…",
"companyId": 1,
"token": "…",
"pairedAt": "…",
"clientserial": "…",
"clientmodel": "…",
"agentversion": "…",
"sort": 1
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Missing or invalid pairing PIN — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._