Sync Batch Translations
const url = 'https://example.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":"fr:common:welcome","value":"Bienvenue"}]}'};
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/batch \ --header 'Content-Type: application/json' \ --data '{ "auto_translate": true, "translations": [ { "key": "en:common:welcome", "value": "Welcome" }, { "key": "en:common:goodbye", "value": "Goodbye" }, { "key": "fr:common:welcome", "value": "Bienvenue" } ] }'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”: “Welcome”}, {“key”: “en:common:goodbye”, “value”: “Goodbye”}, {“key”: “fr:common:welcome”, “value”: “Bienvenue”} ], “auto_translate”: true }
→ Returns: {
"job_id": "...",
"status": "pending",
"total_keys": 3,
"message": "..."
}
→ Poll: GET /sync/jobs/{job_id}
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Request for syncing multiple translations across locales/namespaces.
object
List of translation items to sync
Single translation item in batch sync request.
object
Composite translation key in format ‘locale:namespace:key’ (e.g., ‘en:app:user.profile.name’)
Translation value for the key
Automatically translate source content to all configured target languages
Responses
Section titled “Responses”Successful Response
Response for batch sync job creation.
object
Job identifier for status polling
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" } ]}