Complete device pairing (confirm challenge)
POST /api/devices/{id}/complete-pairing
Completes pairing for a device owned by the authenticated account using its six-digit pairing code and a 32-byte X25519 public key encoded as base64 or hex. Invalid or expired codes return 400; malformed input returns 422; an unowned/missing device returns 404.
Authenticate with a portal session token.
Parameters
idstring path required
Request body
application/json object
pairing_codestring requiredLength: 6 to 6 characters. Pattern:^[0-9]{6}$public_keyany required32-byte X25519 public key encoded as base64 or hexadecimal.
One of
- string
- string
Generated sample
{
"pairing_code": "string",
"public_key": "string"
}Responses
200 Device paired.
application/json object
deviceobject requiredcreated_atstring (date-time) or nulldevice_fingerprintstring or nulldevice_namestring requiredidinteger requiredis_activeboolean requiredis_onlineboolean requiredlast_seen_atstring (date-time) or nullpairing_completeboolean required
messagestring required
Generated sample
{
"device": {
"created_at": "2026-01-01T00:00:00Z",
"device_fingerprint": "string",
"device_name": "string",
"id": 0,
"is_active": true,
"is_online": true,
"last_seen_at": "2026-01-01T00:00:00Z",
"pairing_complete": true
},
"message": "string"
}400 Pairing code is invalid or expired.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
401 Missing or invalid bearer token.
application/json object
Any keys are accepted.
403 The caller does not meet the route requirements: accepted Terms of Service and Privacy Policy.
application/json object
Any keys are accepted.
404 Device was not found for this account.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
422 Pairing fields or public-key encoding are invalid.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
429 Error response.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
text/html string