Skip to content

API

Windlass has a versioned HTTP API under /api/v1. The panel is a client of it: there is no private interface the UI uses and you cannot.

The full specification is served by a running instance and lives in the repository:

A test asserts the specification covers the routes that exist, so it does not drift away from the implementation the way a hand-maintained document would.

Scripts, CI jobs and AI agents use an API token. The panel itself uses a session cookie.

An admin creates a token under Settings, API tokens. It is shown once, so store it straight away in a password manager or secret store. Send it as a bearer token:

Terminal window
export WINDLASS_TOKEN=wl_pat_... # from your secret store, not typed into history
curl -sS -H "Authorization: Bearer $WINDLASS_TOKEN" https://panel.example/api/v1/projects
curl -sS -H "Authorization: Bearer $WINDLASS_TOKEN" https://panel.example/api/v1/auth/tokens/current

A token acts as the person who made it, limited to the access chosen when it was created:

Access Acts as Can
Read only viewer Read projects, deployments, logs and metrics
Deploy only viewer, plus five routes Also deploy, roll back, promote staging, restart and back up. Nothing else that writes: no compose, env, files, Git settings, domains, start, stop or restore
Deploy and edit member Also create projects, edit compose and env, deploy, roll back, manage domains and backups
Admin admin Also registries, reading alert channels and deliveries, Git connections, plugins, reading the S3 settings and panel domain, checking for updates, and image pruning

The limit is worked out on every request against the owner’s current role, so demoting the owner reduces what their tokens can do at once, and deleting the owner deletes their tokens. A Deploy only token needs an owner who is a member or admin; if the owner becomes a viewer, it can only read. GET /auth/tokens/current says whether the token can deploy now in can_deploy.

Deploy only is the token to give an AI agent or a CD job: it can ship what is already in Git or roll back to an earlier deployment, but cannot change what a deployment runs. The five routes are POST /projects/{name}/deployments, .../deployments/{number}/rollback, .../deployments/{number}/promote, /projects/{name}/actions/restart and /projects/{name}/backups. To connect an AI agent through MCP rather than these routes, see AI agents (MCP).

Some things a token can never do, whatever its access. They need a person signed in to the panel, and the API answers 403 session_required:

  • create, list or revoke tokens, and manage users or roles
  • set up or remove two-factor authentication, or configure sign-in providers
  • change the panel domain, apply an update, change the S3 backup destination
  • connect GitHub, or create or install the GitHub App
  • open a terminal
  • delete a project, restore a backup over it, or recreate its staging
  • set or turn off a staging’s password

Env values come back masked (********) unless the token was created with Can read env values. Leave it off unless the job has to read secrets. A token without it can still send the masked map back to PUT /projects/{name}/env with one value changed: a key whose value is still ******** keeps what is stored. Writing a .env file that still holds masked values is refused with 400 masked_values. Compose files are masked the same way: inline environment:, build args: and config content: values read as ********, and writing a YAML file that still holds them is refused.

Read only and Deploy only tokens never get env values from the env or file routes, whatever the flag says. Logs are not covered: GET /projects/{name}/logs returns what the containers print, unscrubbed, to any token that can see the project, so an app that prints a secret hands it to every token. (The MCP server’s get_logs scrubs env values first; see AI agents.) A Deploy only token cannot change compose, but anyone who holds one and can push to the project’s Git branch can deploy a commit that prints its environment. On a Deploy and edit token, leaving the flag off is not full protection: such a token can change compose and deploy, and a container it starts can print its environment to the logs. Treat any token that can deploy as able to reach the project’s secrets, and store it as carefully as the secrets themselves.

Every token expires, after 90 days by default and at most 365. Tokens can be revoked at any time in Settings. An admin can also open a user’s tokens from the Users card in Settings and revoke one, or call GET /users/{id}/tokens and DELETE /users/{id}/tokens/{tokenID}. The audit log records which token made each change. Signing out does not end tokens. If an account may have been compromised, revoke its tokens in Settings as well.

Tokens start with wl_pat_ so secret scanners and people recognise one that has leaked. Windlass stores only a SHA-256 hash of the secret part.

If the panel’s hostname is proxied through Cloudflare with a bot challenge, Cloudflare answers API requests with its own 403 page before they reach Windlass, because a script cannot solve a challenge.

With Super Bot Fight Mode (Pro plans and above), add a WAF custom rule with the Skip action for Super Bot Fight Mode, matching requests whose path starts with /api/ and that carry an Authorization header. The free plan’s Bot Fight Mode cannot be skipped by any rule, so the API only works with it turned off. Windlass still checks every token.

The panel signs in and keeps a session cookie:

Terminal window
curl -sS -c jar -X POST https://panel.example/api/v1/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"[email protected]","password":"..."}'
curl -sS -b jar https://panel.example/api/v1/projects

Sessions are server-side rows, so a session can be revoked. Accounts with TOTP send totp_code with the password. An account with TOTP that signs in through GitHub or Google is sent back to the panel with a five-minute ticket and finishes at POST /auth/oauth/totp.

A hundred and six paths in the OpenAPI spec, grouped roughly as:

Group Examples
Projects GET/POST /projects, GET/PUT /projects/{name}/files/{path}, GET/PUT /projects/{name}/env
Deployments GET/POST /projects/{name}/deployments, POST /projects/{name}/deployments/{number}/rollback
Domains GET/POST /projects/{name}/domains, GET /projects/{name}/domains/check, DELETE /projects/{name}/domains/{hostname}
Backups GET/POST /projects/{name}/backups, POST /projects/{name}/backups/{id}/restore, GET/PUT /projects/{name}/backups/schedule, GET/PUT/DELETE /system/backups/encryption, POST /system/backups/encryption/check, GET/PUT /system/backups/settings
Runtime GET /projects/{name}/services, GET /projects/{name}/logs, GET /projects/{name}/drift, GET /projects/{name}/terminal
Platform GET /system/metrics, GET /system/attention, GET/PUT /system/docker/cleanup, GET /system/preflight, GET/POST /system/update, GET /proxy/status, GET /events
Access GET/POST /users, PUT /users/{id}/role, POST /auth/totp/setup, GET/POST /auth/tokens
Git GET/POST /git/connections, PUT /projects/{name}/git, POST /webhooks/{provider}/{project}
Templates GET /templates, POST /templates/{key}
Plugins GET /plugins, POST /plugins/{name}/enable, /plugins/{name}/proxy/{path}

Logs, deployment progress and platform events are Server-Sent Events. GET /events is the platform stream; GET /projects/{name}/deployments/{number}/events follows one deployment.

An SSE connection stays open, which trips up tooling that waits for a request to finish. Consume it as a stream or ask for a bounded read.

GET /projects/{name}/services?stats=1 adds memory_bytes to each running container: memory in use less reclaimable page cache, the figure docker stats shows. Without ?stats=1 the endpoint does not read container stats. A failed stats read leaves the field out.

GET /projects/{name}/logs without ?service= merges every container of the project into one stream, ordered by time, with up to 5000 lines of history (?tail=N). ?follow=false sends the history and closes, which is the bounded read. GET /projects/{name}/drift compares the running containers with the compose file and says which services changed, are missing or no longer in it; the panel does not show it yet.

GET /projects/{name}/terminal is a WebSocket.

State-changing requests are checked against the caller’s role and written to the audit log. The check is in the handler, so it applies equally to the panel, to curl, and to anything else holding a session or a token.

State-changing requests that a browser sends from another origin are refused, including from other subdomains of the panel’s own domain, where your apps may run.

Errors are JSON with a stable code, {"error":{"code":"...","message":"..."}}. A path that does not exist under /api/v1 answers 404 not_found, and a known path called with the wrong method answers 405 method_not_allowed, so a mistyped URL fails rather than returning the panel’s HTML with a 200.

Requests through a plugin’s proxy follow the same roles: any signed-in user can read, and anything other than GET, HEAD or OPTIONS needs member, as does opening a WebSocket. Windlass does not pass the caller’s windlass_session cookie or Authorization header on to the plugin. Other cookies pass through.

Rate limiting applies to authentication endpoints. API tokens are not rate limited: the secret is 160 random bits, so guessing one is not a practical attack.

GET /api/v1/system/health needs no authentication and is the right target for an uptime check.