meta { name: Regenerate Device Token type: http seq: 1 } put { url: {{base_url}}/api/devices/{{device_id}}/regenerate-token body: none auth: inherit } docs { ## Regenerate Device Token Regenerates auth token for a device, invalidating old token immediately. **Method:** PUT **Endpoint:** /api/devices/{device_id}/regenerate-token **Authentication:** Bearer token (JWT) **Path Parameters:** - `device_id` (string): Device UUID **Response:** - `message` (string): Success message - `auth_token` (string): New auth token - `device` (object): Updated device details - `sync_urls` (object): Device-specific sync URLs with new token **Status Codes:** - 200: Success - 401: Unauthorized - 403: Forbidden (device belongs to different user) - 404: Device not found - 500: Internal server error **Important Notes:** - Old token stops working immediately - Device must be updated with new token to resume syncing - No data loss - device ID remains same **Example Response:** ```json { "message": "Token regenerated successfully", "auth_token": "dev_abc123...", "device": { "id": "uuid-here", "device_name": "My Kobo Clara", "device_type": "kobo", "sync_enabled": true, "auto_sync": true, "sync_frequency_minutes": 5, "created_at": "2026-02-12T10:00:00Z", "device_metadata": "{...}" }, "sync_urls": { "sync_url": "http://localhost:8765/api/sync/kobo/dev_new_token", "markup": "http://localhost:8765/api/sync/kobo/dev_new_token/markup", "bookmark": "http://localhost:8765/api/sync/kobo/dev_new_token/bookmark", "init": "http://localhost:8765/api/sync/kobo/dev_new_token/v1/initialization" } } ``` **Important Notes:** - Old token stops working immediately - Device must be updated with new token to resume syncing - No data loss - device ID remains same }