meta { name: Link Unlinked Book - Manual Resolution type: http seq: 5 } post { url: {{base_url}}/api/sync/link-book body: json auth: inherit } headers { Authorization: Bearer {{user_token}} Content-Type: application/json } body:json { { "unlinked_book_id": "{{unlinked_book_id}}", "media_item_id": "{{media_item_id}}", "confidence_score": 1.0 } } script:post-response { function onResponse(res) { if (res.getStatus() === 200) { const body = res.getBody(); tests['Status is linked'] = body.status === "linked"; tests('Has unlinked_book_id', body.unlinked_book_id !== undefined); tests('Has media_item_id', body.media_item_id !== undefined); tests('Has message', body.message !== undefined); } } onResponse(res); } settings { encodeUrl: true timeout: 0 } docs { ## Link Unlinked Book - Manual Resolution Manually links an unlinked book to a media item in the library. **Method:** POST **Endpoint:** /api/sync/link-book **Authentication:** Bearer token **Request Body:** - `unlinked_book_id` (string): Unlinked book UUID - `media_item_id` (string): Media item UUID to link to - `confidence_score` (number): Match confidence (0-1, 1.0 for manual) **Response:** - `status` (string): Link status (linked) - `unlinked_book_id` (string): Unlinked book UUID - `media_item_id` (string): Media item UUID - `message` (string): Success message **Status Codes:** - 200: Success - book linked - 400: Invalid request - 401: Unauthorized - 404: Book or media item not found - 500: Internal server error }