{"openapi":"3.0.0","info":{"title":"Centrali Scheduler Service API","version":"1.0.0","description":"API documentation for the Centrali Scheduler Service - Job scheduling, cron management, and background task execution."},"servers":[{"url":"https://api.centrali.io/scheduler/api/v1","description":"Scheduler Service API"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Job":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"cron_expression":{"type":"string"},"function_id":{"type":"string","format":"uuid"},"workspace_slug":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","failed"]},"last_run":{"type":"string","format":"date-time"},"next_run":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"JobRun":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"job_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","running","completed","failed"]},"started_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"error":{"type":"string"}}},"Error":{"type":"object","properties":{"status":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"}}}}},"security":[{"bearerAuth":[]}],"tags":[{"name":"Jobs","description":"Scheduled job management"},{"name":"Health","description":"Service health"}],"paths":{"/health":{"get":{"summary":"Health check","tags":["Health"],"security":[],"responses":{"200":{"description":"Service healthy"},"503":{"description":"Service unhealthy"}}}},"/version":{"get":{"summary":"Get service version","tags":["Health"],"security":[],"responses":{"200":{"description":"Service version information"}}}},"/jobs":{"get":{"summary":"List scheduled jobs","tags":["Jobs"],"parameters":[{"name":"workspace_slug","in":"query","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"List of jobs"}}},"post":{"summary":"Create a scheduled job","tags":["Jobs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"cron_expression":{"type":"string"},"function_id":{"type":"string","format":"uuid"},"workspace_slug":{"type":"string"}},"required":["name","cron_expression","function_id","workspace_slug"]}}}},"responses":{"201":{"description":"Job created"},"400":{"description":"Invalid request"}}}},"/jobs/{job_id}":{"get":{"summary":"Get job details","tags":["Jobs"],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Job details"},"404":{"description":"Job not found"}}},"put":{"summary":"Update a job","tags":["Jobs"],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"cron_expression":{"type":"string"},"status":{"type":"string"}}}}}},"responses":{"200":{"description":"Job updated"},"404":{"description":"Job not found"}}},"delete":{"summary":"Delete a job","tags":["Jobs"],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Job deleted"},"404":{"description":"Job not found"}}}},"/jobs/{job_id}/runs":{"get":{"summary":"List job runs","tags":["Jobs"],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"List of job runs"}}}},"/jobs/{job_id}/pause":{"post":{"summary":"Pause a job","tags":["Jobs"],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Job paused"}}}},"/jobs/{job_id}/resume":{"post":{"summary":"Resume a paused job","tags":["Jobs"],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Job resumed"}}}},"/jobs/{job_id}/trigger":{"post":{"summary":"Manually trigger a job","tags":["Jobs"],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Job triggered"}}}}}}