How your own server talks to Cloud Auth without a person being present.
A key inherits the permissions of the account that issued it, and is pinned to the tenant it was issued for. Unlike a person's session it cannot switch tenants, so a leaked key cannot reach across to another one. A service handling several tenants needs a key per tenant.
Put the secret in the X-API-Key header. Nothing else is needed — no Authorization header and no cookie. That header is deliberately not on the CORS allowlist, so a browser cannot send one even by mistake.
curl -X POST https://api.albos.org/auth.v1.AuthService/VerifyToken \
-H "Content-Type: application/json" \
-H "X-API-Key: ca_..." \
-d '{"accessToken":"eyJhbGci..."}'| Purpose | Endpoint | Notes |
|---|---|---|
| Check a token | AuthService/VerifyToken | Whether an access token you were handed is still good. This is what a key is for. |
| Who the account is | AuthService/GetCurrentUser | The account the key was issued by. |
| Which tenants | TenantService/ListMyTenants | The role in each comes back as myRole. |
| Liveness | GET /health | No authentication. Reports whether the database is reachable. |
A key is read-only unless read-write was chosen when it was issued. What a read-only key may call is an allowlist rather than a list of things it may not, so an endpoint added tomorrow is closed to it until somebody decides it is safe.
resource_exhausted.| What happened | What comes back |
|---|---|
| The key is unknown, revoked or expired — or the issuing account has been disabled | unauthenticated (401). Which of these it was is not distinguished. |
| A read-only key attempted a change | permission_denied (403). Retrying will never help. |
| The call needs an authenticator code | permission_denied (403), not 412 — so a client does not retry for ever. |
| The key's own rate limit was reached | resource_exhausted (429). Wait before retrying. |
The full list of codes is in Chapter 6.