# Register Device Register a new device for sync. **Endpoint**: `POST /api/devices/register` **Auth**: Not required (device registration flow) **Content-Type**: `application/json` ## Request Body | Field | Type | Required | Description | | ----------------- | ------ | -------- | ---------------------------------------- | | device_name | string | Yes | Device name | | device_type | string | Yes | Device type: kobo, koreader, web, mobile | | device_identifier | string | Yes | Hardware-specific ID | ### Example Request ```json { "device_name": "My Kobo Clara", "device_type": "kobo", "device_identifier": "hardware-specific-id" } ``` ## Response (201 Created) ```json { "registration_id": "registration-uuid", "auth_url": "https://bookhoard.com/devices/approve/abc123", "qr_code": "data:image/png;base64,iVBORw0KG...", "expires_in": 300, "poll_interval": 3, "setup_instructions": { "koreader": "Calibre URL: https://bookhoard.com/api/sync/koreader" } } ``` Open `auth_url` (or scan the QR code) while logged in to approve; the registration expires after 5 minutes. Poll `POST /api/devices/register/status` at `poll_interval` seconds until `status` is `approved`, at which point the response includes the device's `auth_token`, `device_id`, and `sync_endpoints`. ## Error Responses | Code | Description | | ---- | ------------------------- | | 400 | Invalid device data | | 409 | Device already registered |