meta { name: Resolve Conflict type: http seq: 3 } post { url: {{base_url}}/api/conflicts/{{conflict_id}}/resolve body: json auth: inherit } headers { Authorization: Bearer {{token}} Content-Type: application/json } body:json { { "winner": "koreader", "manual_data": null, "apply_to_all_future_conflicts": false, "reason": "User chose more recent progress" } } settings { encodeUrl: true timeout: 0 } docs { ## Resolve Conflict Resolves a sync conflict by choosing which source to use for the conflicting data. **Method:** POST **Endpoint:** /api/conflicts/{conflict_id}/resolve **Authentication:** Bearer token **Path Parameters:** - `conflict_id` (string): Conflict UUID **Request Body:** - `winner` (string): Source to choose - `koreader`: Use KOReader device data - `kobo`: Use Kobo device data - `web`: Use web interface data - `manual`: Use custom merged data (requires manual_data) - `manual_data` (object, optional): Required if winner is "manual" - `percentage` (number): Reading progress percentage (0-1) - `epubcfi` (string): EPUB Canonical Fragment Identifier - `chapter` (number, optional): Chapter number - `page` (number, optional): Page number - `apply_to_all_future_conflicts` (boolean): Auto-resolve future conflicts from this source - `reason` (string, optional): Explanation for the resolution choice **Response:** - `conflict_resolved` (boolean): True if successful - `applied_to` (string): What was updated (progress, annotations, etc.) - `devices_synced` (array): List of device IDs that were notified **Status Codes:** - 200: Success - conflict resolved - 400: Invalid request data - 401: Unauthorized - 404: Conflict not found - 500: Internal server error **Example - Choose KOReader:** ```json { "winner": "koreader", "manual_data": null, "apply_to_all_future_conflicts": false, "reason": "More recent progress" } ``` **Example - Manual Override:** ```json { "winner": "manual", "manual_data": { "percentage": 0.43, "epubcfi": "epubcfi(/6/4/2:20)", "chapter": 3 }, "apply_to_all_future_conflicts": false, "reason": "Custom merged position" } ``` **After Resolution:** - Winning data is applied to reading progress - All connected devices notified via WebSocket - Conflict status changes to "user_resolved" - Resolution stored for audit trail **Note:** Manual override allows precise control when automatic resolution doesn't capture the correct state. }