cli.sgit.ai / HTTP API / Authentication

Authentication

Moved from sgit.ai. This page was sgit.ai/api/authentication.html (sgit.ai site v0.7.87), moved here on 20 October 2026 as cli.sgit.ai becomes the CLI's main documentation. The text is as it was; links to pages that moved now stay on this site. What moved, and why.

Six headers exist. Which apply depends on the endpoint and on how the server is deployed. None of them is a password, and none of them is stored: the server keeps SHA-256 hashes and compares.

The headers

HeaderWhat it gates
x-sgraph-access-tokenThe SGraph account or deployment. In a single-key self-hosted deployment this gates every route, including reads
x-sgraph-vault-write-keyVault write capability: writes, deletes, destroy, and append configure / purge
x-sgraph-vault-enum-keyAppend lane enumeration: list, fetch, mark-processed
x-vault-read-keyRead key, for public-vault routing
x-vault-publicPublic-vault routing flag
x-sgraph-transfer-delete-authTransfer deletion, SG/Send transfers, not vaults. Carries the secret, never the hash, and only works if a delete_auth_hash was set at create time

One capability is not a header: append_token travels in the request body of /append/write. That is deliberate, see append lanes.

The hash-comparison model

The server never stores a capability key. It stores SHA-256(key) and, on each request, hashes what you presented and compares. Two consequences worth designing around:

Why reads are open by default

GET /api/vault/read/{vault_id}/{file_id} requires no authentication on the shared host, which surprises people. It follows from the encryption model rather than being a gap in it: the bytes are AES-256-GCM ciphertext under a key the server has never seen, and the file IDs are HMAC-derived opaque identifiers that reveal no filename. Serving them to an anonymous caller discloses nothing a reader could use.

It is also the property that makes a published read key work at all, and what lets vault content sit behind an ordinary CDN. If that trade is wrong for your deployment, run in single-key mode, where the access token gates reads too.

What an unauthenticated reader can learn is covered honestly on the security page: object sizes, timing, and approximate activity volume.

See also

This page as markdown · its source, admin/content/api/authentication.md