Overview
Authentication, base URLs, and error codes for the Localess REST API.
The Localess REST API provides predictable, resource-oriented URLs, returns JSON-encoded responses, and uses standard HTTP response codes and verbs.
Base URL
All API endpoints share the following base URL pattern, depending on your deployment:
| Deployment | Base URL |
|---|---|
| Firebase Hosting | https://<project-id>.web.app/api/v1/ |
| Firebase App | https://<project-id>.firebaseapp.com/api/v1/ |
| Custom domain | https://<custom-domain>/api/v1/ |
Authentication
Content and translation reads take an access token in the token query parameter:
GET /api/v1/spaces/{spaceId}/contents/slugs/{slug}?token=<your-token>- Assets (
/assets/...) are public and need no token. - Management endpoints — pushing schemas and translations, as the CLI does — take the token in an
X-API-KEYheader instead. - Draft content (
version=draft) requires a token with a draft permission.
You can create and manage tokens in Settings → Access Tokens inside the Localess admin UI. All requests must be made over HTTPS.
Each token has Permissions — published or draft access to content and translations, plus developer tools — and an optional Cache TTL: how long, in seconds, API responses for that token may be cached before a newly published change shows up. It defaults to 60. See Access Tokens for what each permission grants and where each kind of token is safe to use.
Raw translation values
A token with the Development Tools permission can also read the values stored for one locale, as the CLI does for translation pull --raw:
GET /api/v1/spaces/{spaceId}/translations/{locale}/values?token=<token>Unlike the published translations, nothing is filled in from the fallback locale: keys with no value for that locale, or an empty one, are left out. A locale the space doesn't have returns 400. Responses are never cached. This endpoint is not part of the public API specification.
Draft content
Append version=draft to any request to retrieve unpublished content:
GET /api/v1/spaces/{spaceId}/contents/slugs/{slug}?token=<token>&version=draftErrors
Localess uses standard HTTP status codes:
| Range | Meaning |
|---|---|
2xx | Request succeeded |
400 | Malformed ID or parameter |
401 | Missing or invalid token |
403 | The token lacks the permission the request needs |
4xx | Other client errors — check your parameters, token, or request body |
5xx | Server error — rare; check the GitHub repository for known issues |
IDs in the path — spaceId, contentId and assetId — must match ^[A-Za-z0-9_-]{1,128}$. Any other value returns 400 before the token is checked, and that response is cached for an hour.