Sync Namespace Translations
const url = 'https://app.lionrapid.com/api/integrations/sync/example/example';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"auto_translate":false,"translations":{"cta":"Click <b>here</b> to continue","user":{"profile":{"email":"Email Address","name":"Name"}},"welcome":{"styles":{"1":["bold"]},"text":"Welcome to <1>our app</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/example/example \ --header 'Content-Type: application/json' \ --data '{ "auto_translate": false, "translations": { "cta": "Click <b>here</b> to continue", "user": { "profile": { "email": "Email Address", "name": "Name" } }, "welcome": { "styles": { "1": [ "bold" ] }, "text": "Welcome to <1>our app</1>!" } } }'Queue translation sync job for async processing.
This endpoint accepts nested JSON structure, validates it, and queues a sync job. The job is processed asynchronously to prevent database lock contention.
Args: locale: Target language locale (e.g., “en”, “fr”, “de”) namespace: Target namespace (e.g., “app”, “common”, “admin”) sync_request: Nested translation data 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 data structure (400)
Example: POST /sync/en/app { “translations”: { “user”: { “profile”: {“name”: “Name”, “email”: “Email”} }, “welcome”: “Welcome!” }, “auto_translate”: true }
→ Returns: {"job_id": "...", "status": "pending", "message": "..."}
→ Poll: GET /sync/jobs/{job_id}
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Request for syncing nested translations to a specific namespace.
Leaf values accept multiple input formats:
- Plain string: “Welcome” -> auto-wrapped to ContentUnit
- HTML string: “Click here” -> parsed to ContentUnit
- ContentUnit dict: {“text”: “…”, “styles”: {…}} -> used directly
object
Nested translation structure with string or ContentUnit leaf values
object
Automatically translate source content to all configured target languages
Responses
Section titled “Responses”Successful Response
Response model for sync job creation.
object
Status of a sync job.
Example
{ "job_id": "550e8400-e29b-41d4-a716-446655440000", "message": "Sync job queued successfully. Poll /sync/jobs/{job_id} for status.", "status": "pending"}Validation Error
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}