API Keys & Scopes

Every API request is authenticated with an API key. Keys have a scope that limits what they can do and an optional prefix that limits where. They are created and revoked only on the server — there is no HTTP endpoint for key management, and therefore no way to escalate privileges through the API.

Key format

vela_7apjsr2yg5_Rpnr-qrO1g8AP3FPVFS9mVpIng-pO3Tf-eW2jnoAR0c
└──┘ └────────┘ └─────────────────────────────────────────┘
prefix  key ID          secret: 32 random bytes, base64url
  • The vela_ prefix makes leaked keys easy to find with secret scanners and grep.
  • The key ID (10 lower-case base32 characters) is public — it appears in logs, key list and whoami.
  • The server stores only SHA-256(secret) and compares it in constant time. The full key is shown exactly once, at creation.

Clients send it in one way only:

GET /api/v1/info HTTP/1.1
Host: store.example.com
Authorization: Bearer vela_7apjsr2yg5_Rpnr-qrO1g8AP3FPVFS9mVpIng-pO3Tf-eW2jnoAR0c

Query parameters and cookies are not accepted, so keys never end up in URLs, logs or browser history.

Browsing with a keyWith the optional web sign-in, you can also paste a key into the index's sign-in form once. The browser then gets a read-only session cookie — never the key itself — that sees exactly what the key's prefix allows, and ends the moment you revoke the key.

Scopes

Scopes are ordered: ro < rw < admin. Each includes everything below it.

Operationrorwadmin
GET /info, list, stat, download through the API✓✓✓
Read directory policies✓✓✓
Create, upload, overwrite✓✓
Change metadata and visibility✓✓
Move and rename✓✓
Delete to the trash, list the trash, restore✓✓
Create, list and revoke signed links✓✓
Create, change and delete directory policies✓✓
Purge (permanent delete), empty the trash✓
Change the root directory policy✓ unrestricted only

Listing signed links needs rw because the listing contains working URLs — read-only keys must not be able to mint access to private files.

Prefixes

A key created with --prefix docs/ sees and changes only paths under docs/. The prefix is checked on every operation:

  • Listing an ancestor (the root, for example) is narrowed to the key's subtree, so the key can navigate to its own files. Listing an unrelated directory is 403.
  • Stat, download, upload, create, patch, delete outside the prefix are 403.
  • Moves check both the source and the target; neither may leave the prefix.
  • Restores check the target path.
  • Trash entries outside the prefix are invisible (404).
  • Links can only be created, listed and revoked for objects within the prefix.
  • Directory policies: collection reads are narrowed; individual reads outside are 403; writes are allowed within the prefix, including the prefix itself.

An admin key with a prefix is valid and has admin rights inside that prefix only. Root policy changes always need an unrestricted admin key.

$ vela whoami
Key:      ci (k3aexph8fa)
Scope:    rw
Prefix:   ci/
Server:   https://store.example.com (velad v0.9.0)
Profile:  ci

$ vela put build.zip releases/
vela: "releases/build.zip" is outside the key's prefix "ci/"
$ echo $?
5

Managing keys

# create
docker exec vela velad key create --name workstation --scope admin
docker exec vela velad key create --name ci --scope rw --prefix ci/
docker exec vela velad key create --name monitoring --scope ro

# capture only the key (details go to stderr)
KEY=$(docker exec vela velad key create --name deploy-bot --scope rw --prefix site/)

# inspect and revoke
docker exec vela velad key list
docker exec vela velad key revoke k3aexph8fa

Names must be unique among active keys; revoking a key frees its name. key list shows ID, name, scope, prefix, creation time, last use (updated at most once a minute) and revocation time.

Recipes

A CI pipeline that publishes builds

docker exec vela velad key create --name github-actions --scope rw --prefix ci/

Store the key as a CI secret and expose it as VELA_KEY. If it leaks, the attacker can touch only ci/ — and cannot purge anything. See Scripting & CI.

One key per person or team

docker exec vela velad key create --name design-team --scope rw --prefix design/
docker exec vela velad key create --name alice-laptop --scope admin

Separate keys make LAST USED meaningful and let you revoke one device without disturbing anyone else.

Read-only access for tooling

docker exec vela velad key create --name backup-verifier --scope ro

A read-only key can list and download everything (within its prefix) but cannot change anything or mint signed links.

Rotating a key

  1. Create the replacement: velad key create --name ci-2026-11 --scope rw --prefix ci/.
  2. Update the consumer (CI secret, vela login) and verify with vela whoami.
  3. Revoke the old key: velad key revoke <old-id>.

Signed links created with a key keep working after the key is revoked — they depend on the separate link signing keys, not on API keys.

Rate limiting of failed attempts

Failed authentications are limited per client IP with a token bucket: 10 failures of burst, refilled at 10 per minute. Beyond that the server answers 429 rate_limited with a Retry-After header. Only failures consume tokens, so correctly configured clients never hit the limit.

The client IP comes from X-Real-IP/X-Forwarded-For only when the request arrives from VELA_TRUSTED_PROXIES. If your proxy is not trusted, every client shares the proxy's IP — and a few failing scripts can lock out everyone. See trusted proxies.

A wrong key always produces the same response, regardless of whether the ID exists:

{
  "error": {
    "code": "unauthorized",
    "message": "invalid or revoked API key",
    "request_id": "01m4tsd3p068rrwsjz4b49tdmd"
  }
}