Sync Batch Translations
const url = 'https://app.lionrapid.com/api/integrations/sync/batch';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"auto_translate":true,"translations":[{"key":"en:common:welcome","value":"Welcome"},{"key":"en:common:goodbye","value":"Goodbye"},{"key":"en:common:cta","value":"Click <b>here</b> to continue"},{"key":"en:common:link","value":{"styles":{"1":["hyperlink:/home"]},"text":"Click <1>here</1>"}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.lionrapid.com/api/integrations/sync/batch \ --header 'Content-Type: application/json' \ --data '{ "auto_translate": true, "translations": [ { "key": "en:common:welcome", "value": "Welcome" }, { "key": "en:common:goodbye", "value": "Goodbye" }, { "key": "en:common:cta", "value": "Click <b>here</b> to continue" }, { "key": "en:common:link", "value": { "styles": { "1": [ "hyperlink:/home" ] }, "text": "Click <1>here</1>" } } ] }'Queue batch translation sync job for async processing.
Accepts multiple translations with composite keys (locale:namespace:key format). Supports multi-locale and multi-namespace updates in a single request.
Args: batch_request: Batch of translations with composite keys api_key: Integration API key for authentication
Returns: 202 Accepted with job_id for status polling
Raises: authentication_error: Invalid API key (401) validation_error: Invalid composite key format or batch data (400) not_found: Job already processing for this project (404)
Example: POST /sync/batch { “translations”: [ {“key”: “en:common:welcome”, “value”: {“text”: “Welcome”, “styles”: {}}}, {“key”: “en:common:link”, “value”: {“text”: “Click <1>here</1>”, “styles”: {“1”: [“bold”]}}} ], “auto_translate”: true }
→ Returns: {
"job_id": "...",
"status": "pending",
"total_keys": 2,
"message": "..."
}
→ Poll: GET /sync/jobs/{job_id}
Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Request for syncing multiple translations across locales/namespaces.
Each translation value accepts multiple input formats:
- Plain string: “Welcome” -> auto-wrapped to ContentUnit
- HTML string: “Click here” -> parsed to ContentUnit
- ContentUnit dict: {“text”: “…”, “styles”: {…}} -> used directly
object
List of translation items to sync
Single translation item in batch sync request.
Accepts multiple input formats for value:
- Plain string: “Welcome” -> auto-wrapped to ContentUnit
- HTML string: “Click here” -> parsed to ContentUnit
- ContentUnit dict: {“text”: “…”, “styles”: {…}} -> used directly
object
Composite translation key in format ‘locale:namespace:key’ (e.g., ‘en:app:user.profile.name’)
ContentUnit format for styled translations.
Uses indexed tags format where styles are referenced by numeric indices. Example: {“text”: “Click <1>here</1>”, “styles”: {“1”: [“hyperlink:/home”]}}
object
Text with indexed tags like ‘Click <1>here</1>’
Style definitions by tag index, e.g., {‘1’: [‘bold’, ‘hyperlink:/path’]}
object
Automatically translate source content to all configured target languages
Responses
Section titled “ Responses ”Successful Response
Response for batch sync job creation.
object
First queued job id (legacy pollers)
ALL queued job ids — one per locale group in the batch; job_id is job_ids[0]. Poll each via GET /sync/jobs/{id}.
Job status
Total number of keys in batch
Human-readable status message
Example
{ "job_id": "550e8400-e29b-41d4-a716-446655440000", "message": "Batch sync job queued successfully. Poll GET /api/integrations/sync/jobs/{job_id} for status.", "status": "pending", "total_keys": 50}Validation Error
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}