API Overview
Everything the CLI does goes through a small, documented REST API under /api/v1. It speaks JSON, authenticates with a Bearer key, streams file contents as raw bodies, and reports errors in one consistent shape.
Base URL and authentication
curl https://store.example.com/api/v1/info \
-H "Authorization: Bearer $VELA_KEY"
- Every request under
/api/requiresAuthorization: Bearer vela_<id>_<secret>— authentication happens before routing, so even unknown endpoints answer 401 without a key. Keys are not accepted in query strings or cookies. GET /healthzis the only unauthenticated endpoint, and it lives outside/api.- Every
GETroute also acceptsHEAD. - Every response carries
X-Request-ID.
{
"server_version": "v0.9.0",
"api_version": 1,
"public_url": "https://store.example.com",
"key": { "id": "7apjsr2yg5", "name": "laptop", "scope": "admin", "prefix": "" },
"limits": {
"max_upload_bytes": 2147483648,
"max_create_bytes": 1048576,
"link_default_ttl": "24h",
"link_max_ttl": "720h"
},
"features": { "symlinks": true }
}
Conventions
| Topic | Rule |
|---|---|
| Media type | Requests and responses are application/json; charset=utf-8, except raw file content. |
| Times | RFC 3339 in UTC, e.g. 2026-10-10T12:00:00Z. |
| Sizes | Bytes, as 64-bit integers. |
| Durations | Strings in Vela syntax: 90m, 2h, 7d, 2w. |
| Strict JSON | Unknown fields are rejected with 400 invalid_request, so a typo never becomes a silent no-op. JSON bodies are capped at 64 KiB. |
| IDs | Lower-case ULIDs. |
Paths in URLs
Object paths appear in the URL after the route, each segment percent-encoded on its own and joined with literal slashes:
reports/Q1 summary.pdf → /api/v1/objects/reports/Q1%20summary.pdf
docs/über.md → /api/v1/content/docs/%C3%BCber.md
Non-canonical paths (a//b, ./, ../) are rejected with 400 invalid_path rather than cleaned up by a redirect. Directory paths end with /. See the path rules.
Errors
All errors share one shape:
{
"error": {
"code": "path_conflict",
"message": "a file exists at a parent path: docs/math",
"details": { "conflicting_path": "docs/math" },
"request_id": "01jab…"
}
}
code is stable and meant for programs; message is for humans; details carries structured context when there is any.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_request | Malformed JSON, unknown fields, bad parameters, TTL above the maximum |
| 400 | invalid_path | Path fails validation (details.reason) |
| 400 | checksum_mismatch | X-Vela-SHA256 did not match the uploaded bytes |
| 401 | unauthorized | Missing, invalid or revoked key |
| 403 | forbidden | Scope too low, or path outside the key's prefix |
| 404 | not_found | Object, link, trash entry, policy or endpoint not found |
| 405 | method_not_allowed | Wrong method; the Allow header lists valid ones |
| 409 | already_exists | Target exists (create, create-only upload, move without overwrite) |
| 409 | path_conflict | File/directory clash |
| 409 | is_symlink | Writing content to a path that holds a symlink |
| 409 | conflict | Other conflicts, e.g. directory policies at a move target |
| 412 | precondition_failed | If-Match / If-None-Match not satisfied |
| 413 | payload_too_large | Above VELA_MAX_UPLOAD or VELA_MAX_CREATE |
| 415 | unsupported_encoding | Inline create with an unknown encoding |
| 429 | rate_limited | Too many failed authentications; see Retry-After |
| 500 | internal | Unexpected error; details only in the server log |
| 503 | unavailable | Shutting down or storage unavailable |
Pagination
Listings return a page and an opaque cursor. Pass the cursor back to get the next page; an empty next_cursor means you have everything. Pages hold 200 entries by default and at most 1000 (limit).
cursor=""
while :; do
page=$(curl -s -H "Authorization: Bearer $VELA_KEY" \
"https://store.example.com/api/v1/objects?prefix=docs/&recursive=true&limit=1000&cursor=$cursor")
echo "$page" | jq -r '.objects[].path'
cursor=$(echo "$page" | jq -r '.next_cursor')
[ -z "$cursor" ] && break
done
Object listings are sorted by path in byte order; the trash is newest first; directory policies follow byte order of their prefixes.
Revisions and preconditions
Metadata responses include an ETag of the form "r<revision>". Send it back to make a change conditional:
| Header | Where | Meaning |
|---|---|---|
If-Match: "r3" | PATCH, DELETE (single object), PUT upload, directory policy writes | Apply only if the current revision is 3; otherwise 412 |
If-None-Match: * | PUT upload, directory policy PUT | Only create; if it exists, 409 already_exists (uploads) or 412 (policies) |
Downloads use a different validator: the content ETag "sha256:<hex>", which works with If-None-Match and If-Range. A PUT with If-Match on a missing object returns 412.
Retries and idempotency
Safe to retry automatically on network errors, 429 and 5xx: GET/HEAD, DELETE, and conditional uploads (If-None-Match: * or If-Match). Not safe: POST /objects, POST /move, POST /symlinks, POST /links and restores — retry those only after checking the state. If a retried create-only upload gets 409 already_exists, compare the existing object's sha256 with yours: a match means the first attempt succeeded.
Compatibility promise
Within API v1 nothing you depend on is removed or changes meaning:
- no endpoint, parameter, header, JSON field or error code is removed or renamed;
- field types, success statuses and value meanings stay the same;
- optional request fields do not become required, and valid input is not rejected later;
- public object URLs and signed-link URL formats keep working.
Additions — new endpoints, optional request fields and headers, response fields, error codes for new situations — can appear in any release, so clients should ignore unknown response fields. A breaking change would ship as /api/v2. api_version in /info tells clients which major version the server speaks.