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/ requires Authorization: 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 /healthz is the only unauthenticated endpoint, and it lives outside /api.
  • Every GET route also accepts HEAD.
  • 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

TopicRule
Media typeRequests and responses are application/json; charset=utf-8, except raw file content.
TimesRFC 3339 in UTC, e.g. 2026-10-10T12:00:00Z.
SizesBytes, as 64-bit integers.
DurationsStrings in Vela syntax: 90m, 2h, 7d, 2w.
Strict JSONUnknown fields are rejected with 400 invalid_request, so a typo never becomes a silent no-op. JSON bodies are capped at 64 KiB.
IDsLower-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.

HTTPCodeWhen
400invalid_requestMalformed JSON, unknown fields, bad parameters, TTL above the maximum
400invalid_pathPath fails validation (details.reason)
400checksum_mismatchX-Vela-SHA256 did not match the uploaded bytes
401unauthorizedMissing, invalid or revoked key
403forbiddenScope too low, or path outside the key's prefix
404not_foundObject, link, trash entry, policy or endpoint not found
405method_not_allowedWrong method; the Allow header lists valid ones
409already_existsTarget exists (create, create-only upload, move without overwrite)
409path_conflictFile/directory clash
409is_symlinkWriting content to a path that holds a symlink
409conflictOther conflicts, e.g. directory policies at a move target
412precondition_failedIf-Match / If-None-Match not satisfied
413payload_too_largeAbove VELA_MAX_UPLOAD or VELA_MAX_CREATE
415unsupported_encodingInline create with an unknown encoding
429rate_limitedToo many failed authentications; see Retry-After
500internalUnexpected error; details only in the server log
503unavailableShutting 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:

HeaderWhereMeaning
If-Match: "r3"PATCH, DELETE (single object), PUT upload, directory policy writesApply only if the current revision is 3; otherwise 412
If-None-Match: *PUT upload, directory policy PUTOnly 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.

Next