{"openapi":"3.0.3","info":{"title":"Rouicuk Manager PaaS API","version":"1.0.0","description":"Public API for managing projects, deployments, and infrastructure on the Rouicuk PaaS platform."},"servers":[{"url":"/api/v1","description":"V1 API"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API token with 'rk_' prefix. Obtain via POST /api/tokens."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"Project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"gitUrl":{"type":"string","nullable":true},"gitBranch":{"type":"string"},"serviceCount":{"type":"integer"},"lastDeployAt":{"type":"string","format":"date-time","nullable":true},"latestDeploymentStatus":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ProjectDetail":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"gitUrl":{"type":"string","nullable":true},"gitBranch":{"type":"string"},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"port":{"type":"integer"},"public":{"type":"boolean"},"subdomain":{"type":"string","nullable":true}}}},"deployments":{"type":"array","items":{"$ref":"#/components/schemas/DeploymentSummary"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"DeploymentSummary":{"type":"object","properties":{"id":{"type":"string"},"serviceId":{"type":"string","nullable":true},"status":{"type":"string","enum":["pending","building","deploying","running","failed","stopped"]},"environment":{"type":"string"},"url":{"type":"string","nullable":true},"gitRef":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"finishedAt":{"type":"string","format":"date-time","nullable":true}}},"DeploymentDetail":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"projectSlug":{"type":"string"},"serviceId":{"type":"string","nullable":true},"serviceName":{"type":"string","nullable":true},"gitRef":{"type":"string","nullable":true},"imageTag":{"type":"string","nullable":true},"environment":{"type":"string"},"status":{"type":"string","enum":["pending","building","deploying","running","failed","stopped"]},"url":{"type":"string","nullable":true},"buildLog":{"type":"string","nullable":true},"startedAt":{"type":"string","format":"date-time","nullable":true},"finishedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"DeployRequest":{"type":"object","properties":{"project":{"type":"string","description":"Project slug"},"ref":{"type":"string","description":"Git ref to deploy (branch, tag, or SHA)"},"services":{"type":"array","items":{"type":"string"},"description":"List of service names to deploy. Omit to deploy all."},"env":{"type":"object","additionalProperties":{"type":"string"},"description":"Environment variables to set before deploying"}},"required":["project"]},"DeployResponse":{"type":"object","properties":{"message":{"type":"string"},"deployments":{"type":"array","items":{"type":"object","properties":{"deploymentId":{"type":"string"},"serviceName":{"type":"string"},"url":{"type":"string"}}}}}},"CreateProject":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string","description":"URL-safe identifier (lowercase alphanumeric and hyphens)"},"gitUrl":{"type":"string"},"gitBranch":{"type":"string","default":"main"},"buildContext":{"type":"string","default":"."},"dockerfile":{"type":"string"}},"required":["name","slug"]}}},"paths":{"/projects":{"get":{"summary":"List projects","description":"List all projects owned by the authenticated user.","operationId":"listProjects","responses":{"200":{"description":"List of projects","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create project","description":"Create a new project.","operationId":"createProject","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProject"}}}},"responses":{"201":{"description":"Project created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slug already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{slug}":{"get":{"summary":"Get project by slug","description":"Get detailed project information including services and recent deployments.","operationId":"getProject","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Project details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDetail"}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deploy":{"post":{"summary":"Trigger deployment","description":"Trigger a deployment for a project. Optionally set environment variables and choose specific services.","operationId":"triggerDeploy","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployRequest"}}}},"responses":{"202":{"description":"Deployment started","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deployments/{id}":{"get":{"summary":"Get deployment status","description":"Get the current status and details of a deployment.","operationId":"getDeployment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deployment details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentDetail"}}}},"404":{"description":"Deployment not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}