Skip to content

Sync Batch Translations

POST
/api/integrations/sync/batch
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}
surface
Any of:
string
x-api-key
Any of:
string
x-lr-surface
Any of:
string
Media typeapplication/json
TranslationBatchSyncRequest

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
translations
required
Translations

List of translation items to sync

Array<object>
>= 1 items <= 1000 items
TranslationBatchItem

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
key
required
Key

Composite translation key in format ‘locale:namespace:key’ (e.g., ‘en:app:user.profile.name’)

string
>= 5 characters <= 500 characters /^[a-zA-Z0-9_-]+:[a-zA-Z0-9_-]+:.+$/
value
required
Any of:
string
auto_translate
Auto Translate

Automatically translate source content to all configured target languages

boolean
default: true

Successful Response

Media typeapplication/json
BatchSyncJobResponse

Response for batch sync job creation.

object
job_id
required
Job Id

First queued job id (legacy pollers)

string
job_ids
Job Ids

ALL queued job ids — one per locale group in the batch; job_id is job_ids[0]. Poll each via GET /sync/jobs/{id}.

Array<string>
status
required
Status

Job status

string
total_keys
required
Total Keys

Total number of keys in batch

integer
message
required
Message

Human-readable status message

string
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

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}