Skip to content
Sign in Create account

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

  • id string path required

Request body

application/json object

  • pairing_code string required
    Length: 6 to 6 characters. Pattern: ^[0-9]{6}$
  • public_key any required

    32-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

  • device object required
    • created_at string (date-time) or null
    • device_fingerprint string or null
    • device_name string required
    • id integer required
    • is_active boolean required
    • is_online boolean required
    • last_seen_at string (date-time) or null
    • pairing_complete boolean required
  • message string 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

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any 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

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

422 Pairing fields or public-key encoding are invalid.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

429 Error response.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string