API reference
A handful of endpoints, all under /api/translations, all authenticated with a bearer token.
OpenAPI specification
The complete, always current specification is generated from the route handlers and served by the application together with an interactive reference.
Open the interactive API referenceRaw specification: https://app.sprachrohr.net/openapi.json
Authentication
Send the API key of the application as a bearer token: Authorization: Bearer <key>. The public key can read translations and report missing or used keys. The import key can additionally create and overwrite translations and must never leave your servers.
Public endpoints
| Method | Path | Description | Key |
|---|---|---|---|
GET | /api/translations/<slug>/<lang>/<namespace> | All translations of a language and namespace as a flat JSON object. This is what i18next-http-backend loads. | public key |
POST | /api/translations/<slug> | Creates the keys of the request body if they do not exist yet (saveMissing). | public key |
POST | /api/translations/<slug>/used | Reports a list of keys as used in production and updates their last-used timestamp. | public key |
POST | /api/translations/<slug>/import | Imports translations for several languages in one request and returns a job (202). | import key |
GET | /api/translations/<slug>/import/<jobId> | Status and result of an import job. | import key |
The translation endpoints send permissive CORS headers, so browsers can load translations directly. The internal endpoints under /api/applications and /api/organizations use the session of the signed-in user and are not part of the public API.