Authentication
Every request carries a project API token as a bearer token:
GET /v1/releases HTTP/1.1Host: api-public-dev.localeo.appAuthorization: Bearer localeo_9fK2xY7pQ3mNvB8sL1tR4wZ6cD0aJ5hG2eU7iO9kThere are two ways to get one. You create it by hand in the dashboard, for a server or a CI job. Or an AI assistant gets one by signing in to Localeo’s MCP server. Both are the same kind of token, sent the same way, and listed in the same place. There are no cookies and no signed requests.
The token
A token is a localeo_ prefix followed by 40 random characters. The prefix is there so a leaked token is recognisable on sight: in a log, a bug report, or a scanning tool.
Tokens are created in the dashboard under Project → Integrations → API, by a project manager or developer. The full value is returned exactly once, at creation. Localeo stores only a SHA-256 hash of it, so a lost token cannot be recovered. It can only be revoked and replaced. The dashboard shows the first 14 characters (localeo_9fK2xY) so you can tell tokens apart without exposing them.
One project per token
A token belongs to one project, and reaches only that project. This is why no endpoint takes a project ID: the token already determines it, and GET /projects returns a single-element list rather than a directory of everything you can see.
The practical consequence is that a token is a poor secret to share between systems. If two services need access, give them two tokens, so either can be revoked without disrupting the other.
Read and write scopes
Every token has a scope, chosen when it is created:
| Scope | May call |
|---|---|
read | Every GET endpoint. |
write | Everything read may, plus importing translations and creating and publishing releases. |
New tokens are read unless you choose otherwise, and tokens created before scopes existed are read. Give a token write only where something actually writes: a build that downloads bundles needs read, and a sync job that pushes new source strings needs write.
What a token may do
A token acts as the person who created it, with that person’s role on the project as it is now (not as it was when the token was created). Every write checks the role again.
| Creator’s current role | A write token may |
|---|---|
| Manager | Create, rename and delete keys, write values in every language, mark values approved, create and publish releases. |
| Developer | Create, rename and delete keys, write base-language values, create and publish releases. Other languages are refused as forbidden_language, and approved as forbidden_status. |
| Translator, viewer, or no longer in the project | Nothing. Every write is refused with 403. |
This is the same line the dashboard draws, so a token can never do more than its creator could do by hand. Translators and viewers cannot create tokens at all.
Reading does not depend on the creator. A read keeps working after the person who created the token leaves the project or deletes their account, so revoke the token if that is not what you want. Writes stop at once in both cases. A signed-in AI connection goes further and ends entirely.
Writes are attributed to the creator
Everything a token writes appears in the project’s audit log under its creator’s name, followed by the token’s:
Ada Lovelace (token: ci-import)So you can always tell which person stands behind a change, and which of their tokens made it.
Signed-in AI connections
An AI assistant connected through Connect your AI signs in instead of being handed a token. The person signing in picks one project and chooses read only or read & write. What the assistant receives is a project token like any other: it is scoped to that project, acts as that person with their current role, and appears under Project → Integrations → AI assistants as a connected app, named after the client.
Three things differ from a hand-made token. Its access token expires after one hour, and the client renews it on its own with a refresh token. Each renewal starts a fresh 90 days, so a connection in use stays connected, and one left unused for 90 days has to sign in again. It only has a scope the person granted on the consent page. And every renewal checks the person again: if they are no longer a manager or developer on the project, or their account was deleted, the connection is revoked. So it outlives their access by at most the hour its current access token has left, reads included.
Failure modes
Every authentication or authorization failure uses the standard error shape:
| Status | Situation | Response body |
|---|---|---|
401 | No Authorization header, or one not starting with Bearer | {"error": "missing bearer token"} |
401 | Header present but the token is unknown, revoked, expired, or malformed | {"error": "invalid token"} |
403 | A read token on a write endpoint | {"error": "token is read-only"} |
403 | A write token whose creator was deleted, left the project, or is no longer a manager or developer | {"error": "token owner no longer has write access"} |
A 403 means the token itself is valid. Retrying will not help. A new token from someone with the right role will.
On the MCP endpoint a 401 also carries a WWW-Authenticate header pointing at the sign-in metadata, which is how an MCP client knows to start signing in. When a token was sent and refused, the header adds error="invalid_token", so a client renews its access token before it starts a new sign-in.
Revoking a token
Revoke it under Project → Integrations → API. A connected AI is disconnected under Project → Integrations → AI assistants, and disconnecting it also ends its refresh token, so the client cannot sign itself back in without asking you again.
Revocation takes effect on the token’s next request that reaches authentication. Writes and MCP requests always do, but see the caveat below for reads.
Keeping tokens out of the wrong places
Never ship a token in an app, read or write. An app does not need one: it downloads its bundles from the CDN, and those URLs carry no credentials. A token belongs on a server or in a CI environment, where it looks releases up or writes.
Anyone who extracts a token from a shipped app, a public repository or a client-side bundle gets what it grants. A read token reads every value in the project, drafts and unpublished strings included, plus every release’s download URLs, which are themselves unauthenticated and non-expiring. See Releases & bundles. A write token can also change your translations and publish them to every user of your app, as you.