Authentication
Every API request carries an API token in the Authorization header:
Authorization: Bearer lsgbio_YOUR_TOKEN
That is the whole ceremony — no signatures, no request signing, no expiry negotiation. Tokens are opaque random values; the API stores only a hash, so the dashboard can never show you a token again after creation, and neither could anyone else.
Creating and managing tokens
Tokens live in the dashboard at Settings → API:
- Create — name it, pick scopes, copy the value once.
- List — see each token's prefix, scopes, creation date, and last use.
- Revoke — takes effect immediately. The token stops working on its next request.
What authentication failures look like
Missing header:
// 401
{ "error": { "code": "missing_token",
"message": "Provide an API token via Authorization: Bearer <token>." } }
Malformed, unknown, or revoked token (deliberately indistinguishable from one another):
// 401
{ "error": { "code": "invalid_token",
"message": "The API token is not valid or has been revoked." } }
The 401 responses also carry a standard WWW-Authenticate header.
Authentication vs. authorization
Two different failures with two different status codes:
- 401 — who are you? The credential itself is missing or wrong.
- 403 — who are you is fine, but you may not do this. The token works,
but lacks the required scope (
insufficient_scope), or your plan does not include API access (plan_required).
Plan requirement
API access requires the Pro plan. The check runs on every request, not
only at token creation: if a subscription lapses, existing tokens stop working
immediately with 403 / plan_required, and resume automatically when the
plan is active again. Nothing about the token changes — no re-creation needed.
Security properties worth knowing
- Tokens are shown exactly once, at creation. Only a SHA-256 hash is stored.
- Revocation is soft-delete: the row survives for auditability ("what had access to my account"), but the credential is dead.
- A revoked or unknown token produces identical responses — a leaked token that has been revoked confirms nothing about itself.