Preview

API

Call Wardn over HTTP with an API token. Base URL, authentication, paging, retries and errors, and where the reference for every operation is.

Everything in the web app is built on this HTTP API, so anything you can do there you can script: register a cluster, sync a deployment, release a held snapshot, read Activity. Requests and responses are JSON, and field names are camelCase.

Preview

The API is version v1 but not yet declared stable: an operation can still change before the first stable release. Changes are listed in the Changelog.

This page covers what every call has in common. The reference lists each operation with its parameters, bodies, responses and errors.

Base URL

Every operation is under /api/v1 on your Wardn address. You can check the address and your connection without a credential:

export WARDN_API_URL=https://wardn.example.com
curl -fsS "$WARDN_API_URL/api/v1/health"
{ "status": "ok" }

Authentication

Make an API token in the web app under Settings → API tokens, and send it as a bearer token. A token starts with wrd_.

export WARDN_TOKEN=wrd_...
api() { curl -fsS -H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' "$@"; }

api "$WARDN_API_URL/api/v1/me"

The guides use this api helper in their examples.

A token acts for the person who made it and never for anyone else. What it may do is set when it is made:

SettingMeaning
AccessOne or more rows, each a set of permission keys on one or more places: the whole organization, an environment, a cluster or a deployment. A token holds a key only on the places of a row that lists it.
Expiry30d, 90d, 1y or never, counted from creation.
Rate limitAn optional number of requests per minute. Over it, a call answers 429 with the code token.rate_limited and Retry-After: 60.

Two limits always apply. A token never does more than its owner can do right now, so removing access from the owner removes it from their tokens. And a token cannot create tokens. A token cannot be edited: rotate it to change its secret, or revoke it and make another. The secret is shown once, when it is made.

Give each job the narrowest token that works. A deploy job needs deployment:sync on one deployment, not the whole organization. See API tokens for the web app steps, and Who sees what for why a call outside a token's reach answers 404.

A signed-in browser session also works, with the session cookie in place of the bearer header. Scripts should use a token.

Ids and shapes

  • Paths are plural and kebab-case: /api/v1/role-bindings, /api/v1/pipeline-presets.
  • Ids are UUIDs, such as 7c1f0e1a-5b0e-4d0f-9d77-3c2b5a1d9e10.
  • Times are RFC 3339 in UTC, such as 2026-11-11T09:14:02Z.
  • A PUT replaces the object it addresses with the body you send, so read first and send the whole object back. A PATCH changes only the fields you send.

Paging

Every list is paged with a cursor. limit sets the page size (50 by default, at most 200). When there is more, the response has a nextCursor; send it back as cursor for the next page. The cursor is opaque, so do not build or parse one.

cursor=""
while :; do
  page=$(api "$WARDN_API_URL/api/v1/deployments?limit=100${cursor:+&cursor=$cursor}")
  echo "$page" | jq -r '.items[].name'
  cursor=$(echo "$page" | jq -r '.nextCursor // empty')
  [ -n "$cursor" ] || break
done

Lists hold only what you may see. A page that is empty can mean there is nothing, or nothing you can see.

Safe retries

Every call that changes something accepts an Idempotency-Key header. Repeat a request with the same key and you get the first result again, with Idempotent-Replayed: true, instead of a second change. Results are kept for 24 hours.

key=$(uuidgen)
api -X POST -H "Idempotency-Key: $key" \
  "$WARDN_API_URL/api/v1/deployments/$DEPLOYMENT_ID/sync"
SituationAnswer
Same key, same request, finishedThe first result again, with Idempotent-Replayed: true.
Same key, a different request409 with idempotency.key_reused.
Same key while the first request is still running409 with idempotency.in_progress.
The first attempt failed with a server error, or was refused for sign-in or permissionNot kept. The retry runs again.

Use a new key for each intended change and the same key for each retry of it. Keys are 1 to 255 characters from A-Z a-z 0-9 _ . : -.

Errors

A failed call answers with one shape:

{
  "code": "role.not_found",
  "message": "Role not found.",
  "requestId": "req_..."
}

code is stable, so match on it rather than on message. details may carry more, such as which field was wrong. Quote requestId when you report a problem.

StatusMeaning
400The request is not valid: a field is missing or out of range.
401No valid credential: the token is missing or not valid.
403You can see the thing but may not do this to it. The message names what was missing.
404No such thing, or it is outside what you may see.
409The request conflicts with the current state, such as an apply already under way.
429The token, or your organization, is over its rate limit. Wait the Retry-After seconds.
503A feature this install was not set up with is unavailable, such as the GitHub App.

Retry 429 and 5xx answers after a pause, with the same Idempotency-Key. Do not retry 400, 403 or 404 without changing something.

On the hosted service each organization also has an allowance of requests a minute, shared by its people, its tokens and its agents' MCP calls. Answers carry RateLimit-Limit (the allowance a minute), RateLimit-Remaining and RateLimit-Reset (seconds until it is whole again), so a script can slow down before it is refused; over it, a call answers 429 with the code org.rate_limited. Rolling back, restoring, a bypass, a hotfix and the agent kill switch are never limited, and a limit never fails a deploy that is under way. A self-hosted install has no allowance unless one is set. Live update streams have a cap per organization too: one over it answers 429 with Retry-After: 30. GET /organization/limits reports each of these limits (requests a minute, live streams open, agent jobs running at once) with how much is in use now and any grant that raises it for a while; it needs org:read.

Live updates

GET /api/v1/events is a server-sent events stream of changes in your organization, filtered to what you can see. Resume with the Last-Event-ID header. See Live events.

An example call

Look up a deployment by name, then ask Wardn to apply its snapshot again. This needs two permissions, deployment:read and deployment:sync.

id=$(api "$WARDN_API_URL/api/v1/deployments?q=payments-api" | jq -r '.items[0].id')

api -X POST -H "Idempotency-Key: $(uuidgen)" \
  "$WARDN_API_URL/api/v1/deployments/$id/sync"

A 202 means the snapshot was queued. A 409 means an apply is already queued or under way. Follow the result on the live event stream or by reading the deployment's state.

The reference

One page per operation, grouped by what it works on. Each page names the permission it needs, lists its parameters and request body, shows an example request and every response, and links its schemas.

The reference is generated from the same OpenAPI file the server and the web app are built from, so it cannot drift from them. It has no "try it" console: this site is static and has no way to reach your Wardn for you. Copy the example request, or use the api helper above.

Next

On this page