{"openapi":"3.0.3","info":{"title":"Dawnrose API","version":"1","description":"Create projects, deploy code, images and repositories, and run them on Dawnrose. Authenticate with `Authorization: Bearer drt_…`: a personal token from Account → Tokens, or a project token from a project's Settings → Tokens. Errors come back as `{ error: { message, hint, code } }` with a 4xx or 5xx status."},"servers":[{"url":"https://app.dawnrose.ai/v1"}],"security":[{"bearer":[]}],"tags":[{"name":"Account","description":"Who the token belongs to and which workspaces it reaches."},{"name":"Projects","description":"Projects hold environments, and environments hold services."},{"name":"Environments","description":"Isolated copies of a project's services, each with its own variables, domains and private network."},{"name":"Services","description":"A service runs one image: from a Docker image, a GitHub repository, or code you send."},{"name":"Code","description":"Send code and Dawnrose builds and deploys it: files as JSON, or a .tar.gz archive."},{"name":"Deployments","description":"Every build and rollout. Wait on one to know when your code is live."},{"name":"Variables","description":"Service and shared variables. Values can reference other services: ${{ Postgres.DATABASE_URL }}."},{"name":"Domains","description":"Generated *.up.dawnrose.ai domains and your own, with automatic TLS."},{"name":"Functions","description":"A service from one TypeScript or Python file: an HTTP handler, or a job on a cron schedule."},{"name":"Templates","description":"Databases and apps that deploy in one call."},{"name":"Tokens","description":"Project tokens: limited to one project, for code that creates and deploys services there."}],"paths":{"/me":{"get":{"operationId":"me","tags":["Account"],"summary":"Who the token belongs to","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects":{"get":{"operationId":"projects.list","tags":["Projects"],"summary":"List projects","parameters":[{"name":"orgId","in":"query","required":false,"description":"Only this workspace","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"projects.create","tags":["Projects"],"summary":"Create a project","description":"Comes with a production environment. Not available to project tokens.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Up to 100 characters"},"description":{"description":"Up to 2000 characters","type":"string"},"region":{"description":"Region id, e.g. eu-central; the platform's default when left out","type":"string"},"orgId":{"description":"Workspace; default your first","type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{id}":{"get":{"operationId":"projects.get","tags":["Projects"],"summary":"Get a project with its services","description":"Returns the project, its environments, and the services of one environment (production unless env is given).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"env","in":"query","required":false,"description":"Environment id or name","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"project":{},"environment":{},"environments":{"type":"array","items":{}},"services":{"type":"array","items":{}}},"required":["project","environment","environments","services"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"projects.update","tags":["Projects"],"summary":"Rename or describe a project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Up to 100 characters","type":"string"},"description":{"description":"Up to 2000 characters","type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"projects.delete","tags":["Projects"],"summary":"Delete a project and everything in it","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"string"}},"required":["deleted"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{id}/environments":{"post":{"operationId":"environments.create","tags":["Environments"],"summary":"Create an environment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Lowercased to letters, digits and dashes, up to 32 characters"},"from":{"description":"Copy the services of this environment","type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/environments/{id}":{"patch":{"operationId":"environments.rename","tags":["Environments"],"summary":"Rename an environment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Lowercased to letters, digits and dashes, up to 32 characters"}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"environments.delete","tags":["Environments"],"summary":"Delete an environment and its services","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"string"}},"required":["deleted"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/environments/{id}/logs":{"get":{"operationId":"environments.logs","tags":["Environments"],"summary":"Runtime logs of every service in the environment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"filter","in":"query","required":false,"description":"Filter expression, e.g. @level:error; @service:name narrows to one service","schema":{"type":"string"}},{"name":"tail","in":"query","required":false,"description":"Last N lines, 1-3000; default 300","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LogLine"}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/environments/{id}/deploy":{"post":{"operationId":"environments.deployChanges","tags":["Environments"],"summary":"Deploy every service with pending changes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"Shown with the deployment, up to 1000 characters","type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deployments":{"type":"array","items":{}}},"required":["deployments"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/environments/{id}/services":{"post":{"operationId":"services.create","tags":["Services"],"summary":"Create a service","description":"With an image or a repo, the first deploy starts at once (deployment in the response). Without a source, send code with the files or upload endpoints. generateDomain gives it a public *.up.dawnrose.ai URL.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Up to 60 characters; taken from the source when left out","type":"string"},"source":{"type":"object","properties":{"image":{"description":"Docker image, e.g. nginx:1.27 or ghcr.io/acme/api:latest","type":"string"},"repo":{"description":"GitHub repository, owner/name","type":"string"},"branch":{"description":"Git branch; the repository's default when left out","type":"string"},"rootDir":{"description":"Subdirectory to build from, for monorepos","type":"string"},"registryUsername":{"description":"For a private image registry, up to 256 characters","type":"string"},"registryPassword":{"description":"For a private image registry, up to 4096 characters; never returned","type":"string"}},"description":"Where the code comes from. Leave it out to send code later with the files or upload endpoints."},"variables":{"type":"object","additionalProperties":{"type":"string"},"description":"Name to value. Values may reference other services: ${{ Postgres.DATABASE_URL }}"},"build":{"type":"object","properties":{"builder":{"description":"auto detects the stack; dockerfile or nixpacks force one","type":"string","enum":["auto","dockerfile","nixpacks"]},"dockerfilePath":{"description":"Relative to the source, up to 512 characters","type":"string"},"buildCommand":{"description":"Up to 8 KB","type":"string"},"installCommand":{"description":"Up to 8 KB","type":"string"},"watchPaths":{"description":"Up to 50 glob patterns; a push touching no matching file doesn't deploy","type":"array","items":{"type":"string"}}},"description":"How the service is built"},"deploy":{"type":"object","properties":{"startCommand":{"description":"Up to 8 KB; detected when left out","type":"string"},"preDeployCommand":{"description":"Runs before each deploy, e.g. migrations","type":"string"},"port":{"description":"Port the app listens on; detected when left out","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replicas":{"description":"0-50, within the plan's limit","type":"integer","minimum":0,"maximum":9007199254740991},"restartPolicy":{"description":"When a stopped container is started again","type":"string","enum":["ON_FAILURE","ALWAYS","NEVER"]},"healthcheckPath":{"description":"Path that must answer before traffic moves to a new deploy, e.g. /health","type":"string"},"healthcheckTimeout":{"description":"Seconds, 1-3600","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cronSchedule":{"description":"Run as a job on this cron schedule instead of serving","type":"string"},"cpuLimit":{"description":"vCPU","type":"number"},"memoryLimitMb":{"description":"Per replica, at least 64 and within the plan's limit","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sleepAfterSeconds":{"description":"Sleep when idle for this long; wake on the next request","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"autoRollback":{"description":"Roll back by itself when a new deploy keeps crashing in its first 10 minutes; default true","type":"boolean"}},"description":"How the service runs"},"volume":{"description":"A persistent volume","type":"object","properties":{"mountPath":{"type":"string","description":"Absolute path in the container, e.g. /data"},"sizeGb":{"description":"At least 0.25, within the plan's volume storage; default what is left, up to 5","type":"number"}},"required":["mountPath"]},"generateDomain":{"description":"Give it a public URL on the platform domain","type":"boolean"},"deployNow":{"description":"Default true when there is a source","type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Service"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}":{"get":{"operationId":"services.get","tags":["Services"],"summary":"Get a service: state, URL, domains and deployments","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Service"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"services.update","tags":["Services"],"summary":"Change a service","description":"Changes are staged; deploy to apply them.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Up to 60 characters","type":"string"},"source":{"type":"object","properties":{"image":{"description":"Docker image, e.g. nginx:1.27 or ghcr.io/acme/api:latest","type":"string"},"repo":{"description":"GitHub repository, owner/name","type":"string"},"branch":{"description":"Git branch; the repository's default when left out","type":"string"},"rootDir":{"description":"Subdirectory to build from, for monorepos","type":"string"},"registryUsername":{"description":"For a private image registry, up to 256 characters","type":"string"},"registryPassword":{"description":"For a private image registry, up to 4096 characters; never returned","type":"string"}},"description":"Where the code comes from. Leave it out to send code later with the files or upload endpoints."},"build":{"type":"object","properties":{"builder":{"description":"auto detects the stack; dockerfile or nixpacks force one","type":"string","enum":["auto","dockerfile","nixpacks"]},"dockerfilePath":{"description":"Relative to the source, up to 512 characters","type":"string"},"buildCommand":{"description":"Up to 8 KB","type":"string"},"installCommand":{"description":"Up to 8 KB","type":"string"},"watchPaths":{"description":"Up to 50 glob patterns; a push touching no matching file doesn't deploy","type":"array","items":{"type":"string"}}},"description":"How the service is built"},"deploy":{"type":"object","properties":{"startCommand":{"description":"Up to 8 KB; detected when left out","type":"string"},"preDeployCommand":{"description":"Runs before each deploy, e.g. migrations","type":"string"},"port":{"description":"Port the app listens on; detected when left out","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replicas":{"description":"0-50, within the plan's limit","type":"integer","minimum":0,"maximum":9007199254740991},"restartPolicy":{"description":"When a stopped container is started again","type":"string","enum":["ON_FAILURE","ALWAYS","NEVER"]},"healthcheckPath":{"description":"Path that must answer before traffic moves to a new deploy, e.g. /health","type":"string"},"healthcheckTimeout":{"description":"Seconds, 1-3600","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cronSchedule":{"description":"Run as a job on this cron schedule instead of serving","type":"string"},"cpuLimit":{"description":"vCPU","type":"number"},"memoryLimitMb":{"description":"Per replica, at least 64 and within the plan's limit","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sleepAfterSeconds":{"description":"Sleep when idle for this long; wake on the next request","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"autoRollback":{"description":"Roll back by itself when a new deploy keeps crashing in its first 10 minutes; default true","type":"boolean"}},"description":"How the service runs"},"autoDeploy":{"description":"Deploy on git push","type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Service"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"services.delete","tags":["Services"],"summary":"Delete a service","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"string"}},"required":["deleted"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/deploy":{"post":{"operationId":"services.deploy","tags":["Services"],"summary":"Deploy the service from its source","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"Shown with the deployment, up to 1000 characters","type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/restart":{"post":{"operationId":"services.restart","tags":["Services"],"summary":"Restart the running deployment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/deployments":{"get":{"operationId":"services.deployments","tags":["Services"],"summary":"List deployments, newest first","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1-200; default 30","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Deployment"}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/logs":{"get":{"operationId":"services.logs","tags":["Services"],"summary":"Runtime logs","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"tail","in":"query","required":false,"description":"Last N lines, 1-5000; default 500","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"since","in":"query","required":false,"description":"ISO timestamp","schema":{"type":"string"}},{"name":"filter","in":"query","required":false,"description":"Filter expression, e.g. @level:error -healthcheck","schema":{"type":"string"}},{"name":"deploymentId","in":"query","required":false,"description":"Only this deployment (dep_…)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LogLine"}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/metrics":{"get":{"operationId":"services.metrics","tags":["Services"],"summary":"CPU, memory, network and HTTP metrics","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"minutes","in":"query","required":false,"description":"Window, up to 43,200 (30 days); default 60. HTTP stats cover at most 24 hours","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/exec":{"post":{"operationId":"services.exec","tags":["Services"],"summary":"Run a command in the service","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"command":{"type":"string","description":"Shell command, up to 64 KB"},"timeoutSec":{"description":"1-600; default 60","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["command"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"exitCode":{"nullable":true,"type":"number"},"output":{"type":"string"},"timedOut":{"type":"boolean"}},"required":["exitCode","output","timedOut"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/http":{"post":{"operationId":"services.request","tags":["Services"],"summary":"Send an HTTP request to the service over the private network","description":"Works without a public domain. The body is cut at 20 KB.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"description":"Letters only, default GET","type":"string"},"path":{"description":"Default /","type":"string"},"headers":{"description":"Request headers","type":"object","additionalProperties":{"type":"string"}},"body":{"description":"Request body as text","type":"string"},"port":{"description":"1-65535; default the port the app listens on","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"body":{"type":"string"}},"required":["status","headers","body"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/files":{"post":{"operationId":"services.deployFiles","tags":["Code"],"summary":"Deploy code sent as files","description":"Builds and deploys exactly these files, like a git push without git. Up to 20 MB in total; send larger sources as an archive with upload.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"Relative path, e.g. src/index.ts"},"content":{"type":"string","description":"The file's contents"},"encoding":{"description":"Default utf8; base64 for binary files","type":"string","enum":["utf8","base64"]}},"required":["path","content"]},"description":"At most 10,000 files and 20 MB in all; relative paths up to 1024 characters and 40 levels deep"},"message":{"description":"Shown with the deployment, up to 1000 characters","type":"string"}},"required":["files"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/upload":{"post":{"operationId":"services.upload","tags":["Code"],"summary":"Deploy a .tar.gz archive","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"message","in":"query","required":false,"description":"Shown with the deployment, up to 1000 characters","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"A gzipped tar of the app's directory, up to 500 MB","content":{"application/gzip":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deployments/{id}":{"get":{"operationId":"deployments.get","tags":["Deployments"],"summary":"Get a deployment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deployments/{id}/wait":{"get":{"operationId":"deployments.wait","tags":["Deployments"],"summary":"Wait until a deployment finishes","description":"Returns as soon as it is no longer queued, building or deploying, or when the timeout runs out.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"timeout","in":"query","required":false,"description":"Seconds, default 600, at most 1800","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deployments/{id}/logs":{"get":{"operationId":"deployments.logs","tags":["Deployments"],"summary":"Build and deploy logs","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"phase","in":"query","required":false,"description":"Both when left out","schema":{"type":"string","enum":["build","deploy"]}},{"name":"tail","in":"query","required":false,"description":"Last N lines, 1-20,000; default 5000","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deployments/{id}/cancel":{"post":{"operationId":"deployments.cancel","tags":["Deployments"],"summary":"Cancel a deployment in progress","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deployments/{id}/redeploy":{"post":{"operationId":"deployments.redeploy","tags":["Deployments"],"summary":"Deploy the same source again","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deployments/{id}/rollback":{"post":{"operationId":"deployments.rollback","tags":["Deployments"],"summary":"Roll back to this deployment's image","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/variables":{"get":{"operationId":"variables.list","tags":["Variables"],"summary":"A service's variables","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"resolved","in":"query","required":false,"description":"Include resolved values","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Variables"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"variables.set","tags":["Variables"],"summary":"Set or delete a service's variables","description":"Staged until the next deploy.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"variables":{"description":"Set these; null deletes","type":"object","additionalProperties":{"nullable":true,"type":"string"}},"raw":{"description":".env text, as an alternative to variables","type":"string"},"replace":{"description":"Delete every variable not in this request","type":"boolean"},"sealed":{"description":"Names whose values can never be read back","type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariablesChanged"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/environments/{id}/variables":{"get":{"operationId":"variables.listShared","tags":["Variables"],"summary":"Shared variables of an environment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Variables"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"variables.setShared","tags":["Variables"],"summary":"Set or delete shared variables","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"variables":{"description":"Set these; null deletes","type":"object","additionalProperties":{"nullable":true,"type":"string"}},"raw":{"description":".env text, as an alternative to variables","type":"string"},"replace":{"description":"Delete every variable not in this request","type":"boolean"},"sealed":{"description":"Names whose values can never be read back","type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariablesChanged"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/domains":{"get":{"operationId":"domains.list","tags":["Domains"],"summary":"A service's domains","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Domain"}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"domains.add","tags":["Domains"],"summary":"Generate a domain, or add your own","description":"Without hostname, generates a domain on up.dawnrose.ai. With hostname, adds a custom domain; the response lists the DNS records to create.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"description":"Your domain, e.g. app.example.com; leave out to generate one","type":"string"},"targetPort":{"description":"Container port, 1-65535; default the port the app listens on","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}/verify":{"post":{"operationId":"domains.verify","tags":["Domains"],"summary":"Check a custom domain's DNS now","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}":{"delete":{"operationId":"domains.delete","tags":["Domains"],"summary":"Remove a domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/environments/{id}/functions":{"post":{"operationId":"functions.create","tags":["Functions"],"summary":"Create a function from one file","description":"Deploys at once. The file is a small server that listens on $PORT; leave out code to start from a working example. With schedule, it runs as a job on that cron schedule and exits.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Service name; function, or job with a schedule, when left out","type":"string"},"runtime":{"description":"Default typescript","type":"string","enum":["typescript","python"]},"code":{"description":"Default: a starter handler","type":"string"},"schedule":{"description":"5-field UTC crontab; runs as a job instead of serving HTTP","nullable":true,"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"description":"The function, with deployment: the first deployment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}/function":{"get":{"operationId":"functions.get","tags":["Functions"],"summary":"A function's code","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Function"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"functions.update","tags":["Functions"],"summary":"Replace a function's code and deploy it","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The whole new file, up to 256 KB"},"schedule":{"description":"5-field UTC crontab; null or an empty string removes it","nullable":true,"type":"string"}},"required":["code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates":{"get":{"operationId":"templates.list","tags":["Templates"],"summary":"List templates","parameters":[{"name":"q","in":"query","required":false,"description":"Matches id, name, description, tags and category; all when left out","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Template"}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/environments/{id}/templates/{templateId}":{"post":{"operationId":"templates.deploy","tags":["Templates"],"summary":"Deploy a template into an environment","description":"postgres, mysql, redis, mongo, n8n, drizzle-studio and the rest of GET /templates. Variables override the template's per service.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"templateId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"variables":{"description":"Service name to the variables to set on it","type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}},"deploy":{"description":"Default true; false only creates the services","type":"boolean"},"serviceName":{"description":"Name for the service of a single-service template","type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"type":"string"},"services":{"type":"array","items":{}},"deployments":{"type":"array","items":{}}},"required":["template","services","deployments"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{id}/tokens":{"get":{"operationId":"tokens.list","tags":["Tokens"],"summary":"List a project's tokens","description":"Needs admin on the project.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Token"}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"tokens.create","tags":["Tokens"],"summary":"Create a project token","description":"The token reaches only this project and acts with your permissions there. Not available to project tokens.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Up to 100 characters","type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedToken"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{id}/tokens/{tokenId}":{"delete":{"operationId":"tokens.delete","tags":["Tokens"],"summary":"Revoke a project token","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"tokenId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"string"}},"required":["deleted"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"drt_… API token"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"hint":{"type":"string"},"code":{"type":"string"}},"required":["message","code"],"description":"What went wrong, what to do next, and a code that doesn't change"}},"required":["error"]},"Me":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"],"description":"Who the token belongs to"},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"role":{"type":"string"},"plan":{"type":"string"}},"required":["id","name","slug","role","plan"]},"description":"Workspaces the token reaches, with your role and their plan"}},"required":["user","workspaces"]},"Environment":{"type":"object","properties":{"id":{"type":"string","description":"env_…"},"projectId":{"type":"string","description":"prj_…"},"name":{"type":"string","description":"e.g. production or staging"},"kind":{"type":"string","description":"production, custom or pr"},"createdAt":{"type":"string","description":"ISO timestamp"}},"required":["id","projectId","name","kind","createdAt"]},"Project":{"type":"object","properties":{"id":{"type":"string","description":"prj_…"},"orgId":{"type":"string","description":"The workspace (org_…)"},"name":{"type":"string","description":"Up to 100 characters"},"description":{"type":"string","description":"Up to 2000 characters"},"region":{"type":"string","description":"Region id"},"restricted":{"type":"boolean","description":"Only people added to the project can see it"},"environments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Its environments"},"createdAt":{"type":"string","description":"ISO timestamp"},"updatedAt":{"type":"string","description":"ISO timestamp"}},"required":["id","orgId","name","description","region","restricted","environments","createdAt","updatedAt"]},"Deployment":{"type":"object","properties":{"id":{"type":"string","description":"dep_…"},"serviceId":{"type":"string","description":"svc_…"},"status":{"type":"string","enum":["QUEUED","INITIALIZING","BUILDING","DEPLOYING","SUCCESS","FAILED","CRASHED","SLEEPING","REMOVING","REMOVED","CANCELLED","SKIPPED"],"description":"Where it is: in progress, live, stopped or over"},"trigger":{"type":"string","description":"What started it, e.g. manual, mcp, webhook, upload, rollback, redeploy, changes or pr"},"message":{"type":"string","description":"The deploy or commit message"},"commitSha":{"nullable":true,"description":"The commit built, for repository sources","type":"string"},"image":{"nullable":true,"description":"The image it runs, once built","type":"string"},"port":{"nullable":true,"description":"The port traffic goes to","type":"number"},"error":{"nullable":true,"description":"Why it failed","type":"string"},"createdAt":{"type":"string","description":"ISO timestamp"},"finishedAt":{"nullable":true,"description":"When it went live or stopped; ISO timestamp","type":"string"}},"required":["id","serviceId","status","trigger","message","commitSha","image","port","error","createdAt","finishedAt"]},"Domain":{"type":"object","properties":{"id":{"type":"string","description":"dom_…"},"serviceId":{"type":"string","description":"svc_…"},"hostname":{"type":"string","description":"e.g. app.example.com"},"url":{"description":"https:// and the hostname","type":"string"},"kind":{"type":"string","enum":["generated","custom"],"description":"generated on the platform domain, or your own"},"targetPort":{"nullable":true,"description":"Container port; null means the port the app listens on","type":"number"},"verified":{"type":"boolean","description":"Ownership proven; generated domains always are"},"tlsStatus":{"type":"string","description":"pending, active or error"}},"required":["id","serviceId","hostname","kind","targetPort","verified","tlsStatus"]},"Service":{"type":"object","properties":{"id":{"type":"string","description":"svc_…"},"name":{"type":"string","description":"Unique in its environment"},"state":{"type":"string","description":"online, deploying, building, crashed, failed, sleeping, cron or idle"},"url":{"nullable":true,"description":"The public URL, once the service has a domain","type":"string"},"privateDomain":{"type":"string","description":"Reachable from the other services in the environment"},"source":{"type":"object","properties":{"type":{"type":"string","enum":["none","git","image","upload"]},"image":{"type":"string"},"repo":{"type":"string"},"branch":{"type":"string"}},"required":["type"],"description":"Where its code comes from"},"domains":{"type":"array","items":{},"description":"Its domains, as Domain objects"},"activeDeployment":{"nullable":true,"description":"The deployment serving traffic"},"latestDeployment":{"nullable":true,"description":"The newest deployment, which may still be in progress"},"createdAt":{"type":"string","description":"ISO timestamp"}},"required":["id","name","state","url","privateDomain","source","domains","activeDeployment","latestDeployment","createdAt"]},"Variables":{"type":"object","properties":{"variables":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"nullable":true,"type":"string"},"sealed":{"type":"boolean"}},"required":["key","value","sealed"]},"description":"Each name with its value; the value is null when sealed"}},"required":["variables"]},"VariablesChanged":{"type":"object","properties":{"changed":{"type":"array","items":{"type":"string"},"description":"Names set"},"removed":{"type":"array","items":{"type":"string"},"description":"Names deleted"},"hint":{"description":"What to do next, usually deploy","type":"string"}},"required":["changed","removed"]},"LogLine":{"type":"object","properties":{"ts":{"type":"string","description":"ISO timestamp"},"message":{"type":"string","description":"The line as the app wrote it"},"level":{"type":"string","description":"debug, info, warn or error"},"stream":{"type":"string","description":"stdout or stderr"},"replica":{"description":"The replica that wrote it","type":"string"}},"required":["ts","message","level","stream"]},"Function":{"type":"object","properties":{"serviceId":{"type":"string","description":"svc_…"},"name":{"type":"string","description":"The function's service name"},"runtime":{"type":"string","enum":["typescript","python"],"description":"typescript runs on Node 22"},"file":{"type":"string","description":"index.ts or main.py"},"code":{"type":"string","description":"The whole file"},"schedule":{"nullable":true,"description":"Its crontab; null for an HTTP function","type":"string"},"updatedAt":{"type":"string","description":"ISO timestamp"}},"required":["serviceId","name","runtime","file","code","schedule","updatedAt"]},"Template":{"type":"object","properties":{"id":{"type":"string","description":"Pass it to templates.deploy"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"What it is, in a sentence"},"category":{"type":"string","description":"e.g. database"},"tags":{"type":"array","items":{"type":"string"},"description":"Words it is found by"},"services":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"description":"The services it creates"}},"required":["id","name","description","category","tags","services"]},"Token":{"type":"object","properties":{"id":{"type":"string","description":"tok_…"},"name":{"type":"string","description":"The name you gave it"},"prefix":{"type":"string","description":"The token's first characters, to tell it apart"},"projectId":{"nullable":true,"description":"The one project it reaches","type":"string"},"lastUsedAt":{"nullable":true,"description":"ISO timestamp; null if never used","type":"string"},"createdAt":{"type":"string","description":"ISO timestamp"}},"required":["id","name","prefix","projectId","lastUsedAt","createdAt"]},"CreatedToken":{"type":"object","properties":{"id":{"type":"string","description":"tok_…"},"name":{"type":"string","description":"The name you gave it"},"token":{"type":"string","description":"Shown once"},"prefix":{"type":"string","description":"The token's first characters, to tell it apart"},"projectId":{"nullable":true,"description":"The one project it reaches","type":"string"}},"required":["id","name","token","prefix","projectId"]}}}}