API for automation¶
Everything the console does goes through a JSON API on the controller's origin. This page covers what you need to drive Liftway from CI pipelines and scripts. Interactive OpenAPI documentation is served by the controller itself at /docs (Swagger UI) and /openapi.json. The developer documentation has the complete endpoint reference.
Authenticate¶
Create a dedicated user, give it a narrow role, and sign in to get a session cookie:
BASE=https://runway.example.com
curl -fsS -c cookies.txt -H 'Content-Type: application/json' \
-d "{\"username\":\"ci-deployer\",\"password\":\"$RUNWAY_PASSWORD\"}" \
"$BASE/api/auth/login"
curl -fsS -b cookies.txt "$BASE/api/auth/session"
The session lasts 12 hours. Scripts do not send an Origin header, so the browser same-origin check does not affect them; if your client does send one, it must equal the Liftway URL.
Never put passwords or tokens in a repository, a URL or command-line arguments that end up in logs.
Launch and follow a template¶
RUN=$(curl -fsS -b cookies.txt -H 'Content-Type: application/json' \
-d '{"extra_vars":{"release":"2026.11.23"},"overrides":{"limit":"web-01"}}' \
"$BASE/api/templates/$TEMPLATE/launch" | jq -r .id)
while :; do
STATUS=$(curl -fsS -b cookies.txt "$BASE/api/runs/$RUN" | jq -r .status)
case "$STATUS" in successful|failed|canceled) break;; esac
sleep 10
done
curl -fsS -b cookies.txt "$BASE/api/runs/$RUN/nodes/job/logs" > output.txt
test "$STATUS" = successful
A single-template run has one step with ID job. Launch returns 202 Accepted and the run; it does not wait.
Do not blindly retry a launch
Launch requests have no idempotency key. After a timeout, list recent runs before launching again.
Main endpoints¶
| Method and path | Purpose |
|---|---|
POST /api/templates/{id}/launch |
Launch a template: extra_vars, inventory_id, survey_answers, overrides |
POST /api/workflows/{id}/runs |
Launch a workflow: inventories, surveys, overrides keyed by step ID |
GET /api/runs |
Paged history (see below) |
GET /api/runs/{run} |
One run with every step's status, without output |
POST /api/runs/{run}/cancel |
Request cancellation |
POST /api/runs/{run}/nodes/{step}/approval |
{"approve": true, "comment": "…"} |
GET /api/runs/{run}/nodes/{step}/logs |
Output (see below) |
GET /api/runs/{run}/nodes/{step}/info |
Who, where, what revision, parameters |
POST /api/projects/{id}/sync, POST /api/inventories/{id}/sync |
Sync now |
GET/POST /api/{collection}, GET/PUT/DELETE /api/{collection}/{id} |
Resources: projects, inventories, templates, credentials, credential_types, execution_environments, organisations, teams, users, and workflows |
GET /healthz, GET /readyz |
Health, no authentication |
Create and update requests send the resource definition (the fields described in each guide), not the response object. Responses wrap it: {"id", "created_at", "updated_at", "definition", …}. Credentials take write-only secret_values and never return them.
History¶
GET /api/runs?page=1&page_size=25&kind=automation&status=failed&workflow_id=…&execution_type=ansible&order=recent
Returns {"items": [...], "total": 1234, "page": 1, "page_size": 25}. page_size is 1–100; kind is all, automation or system; order is recent or type. Items are summaries; fetch /api/runs/{id} for steps. GET /api/jobs returns single jobs and system jobs in the same format. branch codex/highload-s3 — older versions returned a full list.
Output¶
GET /api/runs/{run}/nodes/{step}/logs plain text, complete, streamed
GET /api/runs/{run}/nodes/{step}/logs?tail=true JSON: the latest window
GET /api/runs/{run}/nodes/{step}/logs?before=<cursor> JSON: the window before a cursor
GET /api/runs/{run}/nodes/{step}/logs?after=<cursor> JSON: new lines after a cursor (for following)
GET /api/runs/{run}/nodes/{step}/logs?phase=plan Terraform: the plan's output
JSON pages hold at most 1,024 records going backwards (512 going forwards) and about 2 MiB. Use one direction per request.
Errors¶
| Status | Meaning |
|---|---|
| 400 | The request conflicts with current resources (detail explains) |
| 401 | Not signed in, wrong token, invalid SSO assertion |
| 403 | Cross-origin request, missing permission, closed registration |
| 404 | No such resource, or the feature is disabled |
| 409 | The assistant is disabled |
| 412 | Role policy changed since you read it |
| 422 | Validation failed (detail lists the problems) |
| 429 | Too many failed sign-ins |
| 503 | Database busy or not ready — retry after Retry-After seconds |
Errors are JSON with a detail field (a string). Log endpoints return text; 204 responses have no body.