{ "openapi": "3.0.0", "info": { "title": "GarminSync Service API - Synchronization Status", "version": "1.0.0", "description": "API for checking the status of synchronization processes." }, "paths": { "/api/sync/status": { "get": { "summary": "Get Synchronization Status", "operationId": "getSyncStatus", "parameters": [ { "name": "job_id", "in": "query", "required": false, "schema": { "type": "string", "format": "uuid" }, "description": "Optional: Filter status by a specific synchronization job ID." }, { "name": "job_type", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "activity_sync", "health_metrics_sync", "workout_upload" ] }, "description": "Optional: Filter status by job type." } ], "responses": { "200": { "description": "Returns the current status of synchronization jobs.", "content": { "application/json": { "schema": { "type": "object", "properties": { "jobs": { "type": "array", "items": { "$ref": "#/components/schemas/SyncJobStatus" } } }, "required": [ "jobs" ] } } } }, "401": { "description": "Unauthorized. User not authenticated." }, "500": { "description": "Internal server error." } }, "tags": [ "Synchronization" ] } } }, "components": { "schemas": { "SyncJobStatus": { "type": "object", "properties": { "job_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the synchronization job." }, "job_type": { "type": "string", "description": "Type of synchronization (e.g., 'activity_sync')." }, "status": { "type": "string", "description": "Current status of the job (e.g., 'pending', 'in_progress', 'completed', 'failed')." }, "progress": { "type": "number", "format": "float", "description": "Percentage completion (0.0 to 1.0)." }, "start_time": { "type": "string", "format": "date-time", "description": "Timestamp when the job started." }, "end_time": { "type": "string", "format": "date-time", "description": "Timestamp when the job ended (if completed or failed)." }, "error_message": { "type": "string", "nullable": true, "description": "Any error message if the job failed." }, "details": { "type": "object", "nullable": true, "description": "Additional job-specific details (e.g., number of items synced, skipped)." } }, "required": [ "job_id", "job_type", "status", "progress", "start_time" ] } } } }