launchroom
API and CLI

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.

API tokens page: CLI install command and launchroom login, and a GitHub Actions token with read, deploy, env:read and env:write scopes and a Revoke button.API tokens page: CLI install command and launchroom login, and a GitHub Actions token with read, deploy, env:read and env:write scopes and a Revoke button.
Install the CLI, sign in without copying a token, and create scoped tokens for CI.

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 → API tokens (in the You group) with Create token. Creating a token asks for your password.

  • 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.
  • Abilities narrow what the token can do. The effective rights are your role in the team and the token's abilities, whichever is less.
  • Expiry is mandatory: 7 days, 30 days, 90 days or 1 year.
  • Shown once. Copy the token when it's shown. launchroom only keeps a hash. Tokens look like <id>|lr_pat_….
  • The token list shows when and from which IP each token was last used, and warns when one expires within 7 days. Revoke ends a token at once.
  • Removing someone from the team deletes their tokens for that team.

Abilities

AbilityAllowsTypical use
readProjects, environments, services, deployments, logs, servers and domains (always on)Status checks
deployDeploy a commit, apply staged changes, redeploy, roll back, cancelCI deploys
env:readVariable names and non-secret valuesLocal development
env:writeCreate, change and delete variables (staged until the next deploy)launchroom env set
secrets:readSecret values, each read auditedenv pull and run with secrets
domains:writeAdd and remove custom domainsAutomation
data:transferImport into databases and volumes, export and download their data, each auditedlaunchroom db import, db export

deploy, env:read and env:write are ticked by default. secrets:read and data:transfer are opt-in and only work for owners and admins. No token can manage servers, members, the team, backup settings or 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.

Basics

Base URLhttps://<your dashboard>/api/v1
AuthenticationAuthorization: Bearer <token>
FormatJSON in and out. Times are ISO 8601 in UTC
IDsPublic 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.

CodeStatusMeaning
unauthenticated401No token, an unknown token, or an expired one
forbidden403Your role doesn't allow it
missing_ability403The token lacks the ability named in ability
not_found404Doesn't exist, or belongs to another team
method_not_allowed405Wrong HTTP method
conflict409The current state doesn't allow it
idempotency_key_in_progress409A request with this key is still running
idempotency_key_reused422The key was used for a different request
validation_failed422Invalid input, details in fields
rule_violationvariesA launchroom rule refused it, for example rolling back to a deployment whose image is gone
rate_limited429Too many requests. Wait for Retry-After seconds
server_error500Something went wrong on our side. Safe to retry

Rate limits

LimitValue
Requests per token300 per minute
Changes (POST, PATCH, DELETE) per token60 per minute, on top

Responses carry X-RateLimit-* headers.

Idempotency

Creating requests (deployments, deploys of staged changes, variables, domains, rollbacks, redeploys) 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.

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"
EventData
linesNew lines and a cursor. The event id is the cursor
statusThe deployment's status changed
endThe deployment finished. The stream closes
reconnectThe 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), source (all, runtime, build), service and q.

What the API covers

AreaEndpoints
Who am IGET /me
Projects and environmentsList and read projects, their environments and services
DeploymentsList, create, read; redeploy, roll back, cancel; logs and log streams
VariablesList, create, change, delete; read one value; the resolved env of a service (?secrets=1 to include secrets when allowed)
DomainsList, add, remove
ServersList and read
Import and exportUpload a file in parts, start and follow an import, start an export, make a one-use download link
launchroom.jsonExport 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.

On this page