REST API
Deploy, read status and logs, and manage variables and domains from scripts and CI with team-scoped API tokens that expire.
Everything the CLI does goes through a documented REST API that you can call yourself. It follows the same rules as the dashboard: a token can never do more than the person who created it, and it works inside one team only.


The reference on your dashboard
Your launchroom serves the full interactive reference at /docs/api on your dashboard (for example https://launchroom.example.com/docs/api) once you're signed in: every operation with its ability, parameters, request and response schemas, and a copyable curl. The raw OpenAPI 3.1 document is public at /api/v1/openapi.json. This page covers what you need to get started.
Tokens
Create a token under Settings → Tokens & CLI (in For you) with Create token.
- One team. A token acts as you inside the team that was current when you created it. Everything in your other teams answers
404, as if it didn't exist. - Access narrows what the token can do. Pick Deploy (the default:
read,deploy,env:read,env:writeandfix), Read only, Full access or Custom to tick abilities one by one. The effective rights are your role in the team and the token's abilities, whichever is less. - Full access gives the token everything your role allows, including permissions launchroom adds in later versions. It never goes beyond your role, and if your role changes, the token follows. Because a full-access token gains new powers when you update launchroom, give CI jobs and AI agents a Custom token (or a robot token limited to one project) with only what they need.
GET /meanswersfullAccess: trueand lists what that means today inabilities. - Expiry is mandatory: 7 days, 30 days, 90 days or 1 year. Each option shows the date the token stops working.
- Shown once. Copy the token when it's shown. launchroom only keeps a hash. Tokens look like
<id>|lr_pat_…. In CI, store it asLAUNCHROOM_TOKEN, which the CLI uses withoutlaunchroom login. - The token list shows each token's hint (its prefix and last four characters, such as
lr_pat_…a1b2, so you can match it with the one in your CI settings), its access ("Full access", "Deploy", "Read only" or "Custom, 4 permissions"; a custom token stays custom even when it has every permission today), when and from which IP it was last used, and when it expires. Revoke ends a token at once. Tokens created before hints existed show none. - Removing someone from the team deletes their tokens for that team.
Abilities
| Ability | Allows | Typical use |
|---|---|---|
read | Projects, environments, services, deployments, logs, servers and domains (always on) | Status checks |
deploy | Deploy a commit, apply staged changes, redeploy, roll back, cancel; deploy, restart, stop and start a service | CI deploys |
env:read | Variable names and non-secret values | Local development |
env:write | Create, change and delete variables (staged until the next deploy) | launchroom env set |
secrets:read | Secret values, each read audited | env pull and run with secrets |
domains:write | Add and remove custom domains | Automation |
data:transfer | Import into databases and volumes, export and download their data, each audited | launchroom db import, db export |
run | Run one-off commands in a service's live version, follow and cancel them, each audited | launchroom exec, migrations in CI |
fix | Apply the fix launchroom suggests for a failed deployment and redeploy. Needs deploy too | launchroom fix |
update | Update an app to a newer release launchroom found, after a backup of its data. Needs deploy too | launchroom updates apply |
Deploy grants read, deploy, env:read, env:write and fix (tokens made before fix existed keep their abilities). secrets:read, data:transfer, run and update are opt-in. secrets:read and data:transfer only work for owners and admins, run for people with Console access. No token can manage servers, members, the team, backup settings or open Console and Data sessions.
Actions taken with a token appear in the audit log like the same action in the dashboard, marked as done through that token.
Robot tokens
A personal token stops working when its owner leaves the team. For CI, create a robot token under Settings → Tokens & CLI (in For CI) instead: it belongs to the team and keeps working whoever comes and goes.
- Owners and admins create, rotate and revoke them. Everyone in the team sees them, with who created each one, when it was last used and from where.
- Access and expiry work like a personal token's. A robot never gets more than its abilities: it can't manage servers, members or the team. A full-access robot gets later permissions too, still only inside what it Reaches.
- Reaches limits a robot to All projects, One project, or One service of a project. A limited token answers
403with the codetoken_scopefor anything outside its project or service, and for team-wide endpoints such as servers. Endpoints that take aservice(such asPOST /environments/{environment}/deploymentsor listing deployments) must name the robot's service. Lists only show what it reaches. Each operation in the OpenAPI document says the narrowest reach it serves inx-launchroom-scope(team,project,service, orownfor/me).GET /meanswers the reach asscope(projectId,projectName,serviceId,serviceName;nullwhen the token reaches every project). - Rotate makes a new secret with the same name, access, reach and lifetime. The old one stops at once, so update your CI secret right after.
- Deployments and audit entries show the robot's name. Creating, rotating and revoking are audited.
Basics
| Base URL | https://<your dashboard>/api/v1 |
| Authentication | Authorization: Bearer <token> |
| Format | JSON in and out. Times are ISO 8601 in UTC |
| IDs | Public IDs with a prefix: prj_…, env_…, svc_…, dpl_…, var_…, dom_…, srv_… |
| Single objects | {"data": {…}} |
| Lists | {"data": […], "meta": {"nextCursor": "…"}}. Pass ?cursor= for the next page and ?limit= (up to 100) |
Check your token and see what it can do:
curl -s https://launchroom.example.com/api/v1/me \
-H "Authorization: Bearer $LAUNCHROOM_TOKEN"Errors
Every error has the same shape:
{
"error": {
"code": "missing_ability",
"message": "…",
"ability": "deploy"
}
}Validation errors add fields with messages per field.
| Code | Status | Meaning |
|---|---|---|
unauthenticated | 401 | No token, an unknown token, or an expired one |
forbidden | 403 | Your role doesn't allow it |
missing_ability | 403 | The token lacks the ability named in ability |
not_found | 404 | Doesn't exist, or belongs to another team |
method_not_allowed | 405 | Wrong HTTP method |
conflict | 409 | The current state doesn't allow it |
idempotency_key_in_progress | 409 | A request with this key is still running |
idempotency_key_reused | 422 | The key was used for a different request |
validation_failed | 422 | Invalid input, details in fields |
rule_violation | varies | A launchroom rule refused it, for example rolling back to a deployment whose image is gone |
rate_limited | 429 | Too many requests. Wait for Retry-After seconds |
server_error | 500 | Something went wrong on our side. Safe to retry |
Rate limits
| Limit | Value |
|---|---|
| Requests per token | 300 per minute |
| Changes (POST, PATCH, DELETE) per token | 60 per minute, on top |
Responses carry X-RateLimit-* headers.
Idempotency
Creating requests (deployments, deploys of staged changes, variables, domains, rollbacks, redeploys, and a service's deploy, restart, stop and start) accept an Idempotency-Key header: 1 to 255 characters of letters, digits and _ . : -. Use it in CI so that a retried request never deploys twice:
- The same key with the same request within 24 hours returns the stored response, with
Idempotent-Replayed: true. - The same key with a different request is refused with
422 idempotency_key_reused. - A retry while the first request still runs gets
409 idempotency_key_in_progress. - Server errors (5xx) are not stored, so retrying them is safe.
Deploy a service at a specific commit:
curl -s -X POST https://launchroom.example.com/api/v1/environments/$ENV_ID/deployments \
-H "Authorization: Bearer $LAUNCHROOM_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: ci-$GITHUB_RUN_ID" \
-d '{"service": "'"$SERVICE_ID"'", "sha": "'"$GITHUB_SHA"'"}'The body takes service and one of sha (a full 40-character commit), ref (a branch, main or refs/heads/main) or redeploy: true. Without any of them, the head of the service's tracked branch is deployed. The deployment uses the environment's last applied configuration, the same as a push. Staged changes stay staged. The answer is 202 with the deployment, including its status and dashboardUrl. Poll GET /deployments/{deployment} until finished is true, or follow its logs.
To apply an environment's staged changes instead, POST /environments/{environment}/deploy with an optional message.
Stop, start and restart a service
These are the buttons in the service panel's header (service actions), for one service in one environment. Each needs the deploy ability and your role's deploy permission there, and each is audited.
| Request | What it does | Answer |
|---|---|---|
POST /environments/{environment}/services/{service}/deploy | Deploys the latest version: the latest commit of the tracked branch, or the image tag resolved again. Refused while the service is stopped or has staged changes | 202 with the deployment |
POST …/services/{service}/restart | New containers of the running version, no build, one replica at a time | 202 with service and deployments |
POST …/services/{service}/stop | Stops its containers. Domains show a stopped page; settings, domains, volumes and deployments stay | 200 with service and an empty deployments |
POST …/services/{service}/start | Runs the version that was live when it stopped | 202 with service and deployments |
Restart, stop and start take an optional body {"processes": false} to leave an app's workers and crons as they are. By default they follow the app. A stopped service has status: "stopped" and stoppedAt in GET /environments/{environment}/services/{service}.
curl -s -X POST https://launchroom.example.com/api/v1/environments/$ENV_ID/services/$SERVICE_ID/stop \
-H "Authorization: Bearer $LAUNCHROOM_TOKEN" \
-H "Idempotency-Key: stop-$GITHUB_RUN_ID"Follow logs
Logs stream as server-sent events. A deployment's stream runs until the deployment finishes:
curl -sN https://launchroom.example.com/api/v1/deployments/$DEPLOYMENT_ID/logs/stream \
-H "Authorization: Bearer $LAUNCHROOM_TOKEN"| Event | Data |
|---|---|
lines | New lines and a cursor. The event id is the cursor |
status | The deployment's status changed |
end | The deployment finished with status. The stream closes |
reconnect | The stream closes after 5 minutes. Reconnect with Last-Event-ID (or ?after=) and you lose nothing |
A : ping comment arrives every 15 seconds. GET /environments/{environment}/logs/stream follows the runtime logs of a whole environment the same way, like Live in the Logs explorer, and GET /environments/{environment}/logs runs a search with range (15m, 1h, 24h, 7d, 30d) or a fixed window (from and to, epoch seconds, within the last 30 days), source (all, runtime, build), service and q. Its markers are the deploys of the window, each with a link to the deployment.
Explain and fix a failed deployment
GET /deployments/{deployment}/failure answers what the deployment's page says when it fails: the outcome (title, message, hint), the explanation of a known failure (cause and fix in plain words), the build's hints, the failingStep with its last lines (excerpt, numbered like the deployment's log, secrets masked, the line that reads like the error marked with error: true) and the fixes.
{
"data": {
"title": "Health check timed out",
"explanation": { "key": "health_not_http", "title": "Your app doesn’t answer HTTP on its port", "cause": "…", "fix": "…" },
"failingStep": "health",
"errorLine": 41,
"fixes": [
{ "code": "use_tcp_healthcheck", "label": "Check over TCP and redeploy", "oneClick": true,
"command": "launchroom fix use_tcp_healthcheck --deployment dpl_…" }
]
}
}A fix with oneClick: true is applied with POST /deployments/{deployment}/fixes/{code}. It needs the deploy and fix abilities and your role's right to change the service's settings, the same as Fix and redeploy on the page. Only the fix launchroom suggests for that deployment is accepted. The answer says what happened: deploying (with the new deployment), staged (other changes were staged too, so review and deploy them together) or freeing_disk. Other fixes name the CLI command or dashboard page that applies them.
Previews
GET /projects/{project}/previews?pr=42 returns the preview of pull request 42 (without pr, the newest previews, open ones first): its status, health (building, live, failed, stopped or none), the full headSha, its urls and the current deployment of each service. A preview is ready for a commit when every deployment is finished and built from that commit. launchroom preview wait does this for you in CI.
Decode a ray
POST /traces/decode with {"value": "…"} (the X-Launchroom-Ray header value or the whole header line) returns what the Ray page shows: status, path, the time spent at the edge and in the app, the firewall's decision with its rules, the servers on the way and where the request ended, plus requestId with logsFrom and logsTo to search the service's logs for it. A ray that isn't from one of your team's services gets one answer, whatever the reason.
After a production rollback, auto-deploy is paused. POST /environments/{environment}/auto-deploy/resume (ability deploy) turns it back on.
Run a command
Commands need the run ability and Console access.
| Request | What it does |
|---|---|
GET /environments/{environment}/services/{service}/commands | The service's listed commands: its framework's and the ones launchroom.json names |
POST …/services/{service}/command-runs | Runs {"argv": ["php", "artisan", "migrate:status"]} or {"name": "migrate"}, optional timeoutSeconds (10 to 3600). 201 with the run |
GET …/services/{service}/command-runs | Recent runs, newest first |
GET /command-runs/{run} | One run: status, exitCode, error, who ran it and when |
GET /command-runs/{run}/output/stream | The output as server-sent events: lines, status, then end with the status and exit code |
POST /command-runs/{run}/cancel | Stops it (the container gets 10 seconds to exit) |
A run's status is queued, running, succeeded, failed (with exitCode), timed_out, cancelled or error (it couldn't run, error says why). argv runs without a shell.
Update an app
App updates of apps that run an image:
| Request | What it does |
|---|---|
GET /app-updates | Apps with a newer release or an update in progress, ?project=prj_… for one project: what runs, the candidates launchroom found (biggest change first), the recommended one, a major with its releaseNotesUrl, the update in progress (run) and why an update can't start now (blocker) |
POST /environments/{environment}/services/{service}/update | Updates to {"tag": "v6.3.0"}, one of the candidates. A major needs "releaseNotesRead": true. 202 with the app's updates and the new run |
It needs the deploy and update abilities and your role's right to change the app's settings. The update works like the Update button: a backup of the app's data first, then the new version, and back to the old one if it fails. It's refused while other changes are staged or a deployment is running.
What the API covers
| Area | Endpoints |
|---|---|
| Who am I | GET /me |
| Projects and environments | List and read projects, their environments and services |
| Services | Deploy the latest version, restart, stop, start |
| Deployments | List, create, read; redeploy, roll back, cancel; logs and log streams; why one failed and its fix |
| Previews | A project's previews, or one pull request's |
| Rays | Decode an X-Launchroom-Ray header |
| App updates | List available updates, update an app |
| Variables | List, create, change, delete; read one value; the resolved env of a service (?secrets=1 to include secrets when allowed) |
| Domains | List, add, remove |
| Servers | List and read |
| Import and export | Upload a file in parts, start and follow an import, start an export, make a one-use download link |
launchroom.json | Export an environment, validate a file, preview the changes it would make, see the last read |
Secret values never appear in lists. They come back as null. Reading one needs secrets:read and is audited.
Dashboard domain
Move the dashboard from its install address to your own domain with HTTPS. launchroom verifies the domain before the switch, and the old address keeps forwarding.
CLI
The launchroom command line tool. Sign in from the browser, deploy, follow logs, pull variables into .env and check launchroom.json in CI.