Sync Namespace Translations
const url = 'https://example.com/api/integrations/sync/example/example';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"auto_translate":false,"translations":{"settings":{"language":"English","theme":"Dark"},"user":{"profile":{"email":"Email Address","name":"Name"}},"welcome":"Welcome to our app!"}}'};
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://example.com/api/integrations/sync/example/example \ --header 'Content-Type: application/json' \ --data '{ "auto_translate": false, "translations": { "settings": { "language": "English", "theme": "Dark" }, "user": { "profile": { "email": "Email Address", "name": "Name" } }, "welcome": "Welcome to our app!" } }'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”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Request for syncing nested translations to a specific namespace.
object
Nested translation structure for the target namespace
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" } ]}