Skip to main content
Coming Soon

The Translations API is under active development. These endpoints are not yet available for production use.

Translations API

The Translations API manages multi-language content and locale configuration. All endpoints require JWT authentication.

List Translations

GET /api/translations

Query Parameters

ParameterTypeDefaultDescription
pagestring"1"Page number
limitstring"50"Items per page
contentTypestringFilter by content type
contentIdstringFilter by content item ID
localeCodestringFilter by locale code (e.g., es, fr)

Response

{
"data": [
{
"id": "tr_abc123",
"tenantId": "t_789",
"localeId": "loc_1",
"contentType": "flow",
"contentId": "flow_abc",
"fieldName": "title",
"value": "Bienvenido",
"version": 1,
"locale": { "code": "es", "name": "Spanish" },
"createdAt": "2025-01-10T09:00:00Z",
"updatedAt": "2025-01-10T09:00:00Z"
}
],
"meta": { "total": 24, "page": 1, "limit": 50, "totalPages": 1 }
}

Create Translation

POST /api/translations

Request Body

{
"contentType": "flow",
"contentId": "flow_abc",
"fieldName": "title",
"localeCode": "es",
"value": "Bienvenido",
"version": 1
}
FieldTypeRequiredDescription
contentTypestringYesType of content being translated
contentIdstringYesID of the content item
fieldNamestringYesField being translated (e.g., title, body)
localeCodestringYesTarget locale code
valuestringYesTranslated text
versionnumberNoVersion number for conflict detection

Bulk Create Translations

POST /api/translations/bulk

Creates multiple translations in a single request.

Request Body

{
"translations": [
{
"contentType": "flow",
"contentId": "flow_abc",
"fieldName": "title",
"localeCode": "es",
"value": "Bienvenido"
},
{
"contentType": "flow",
"contentId": "flow_abc",
"fieldName": "body",
"localeCode": "es",
"value": "Haga clic para comenzar"
}
]
}

Response

{
"data": { "created": 2 }
}

Get Translation

GET /api/translations/:id

Update Translation

PUT /api/translations/:id

Translation Coverage

GET /api/translations/status

Returns translation coverage statistics per locale.

Query Parameters

ParameterTypeRequiredDescription
contentTypestringNoFilter coverage by content type

Response

{
"data": [
{
"localeCode": "es",
"localeName": "Spanish",
"isDefault": false,
"translated": 45,
"total": 60,
"percentage": 75
}
]
}

Locales

List Locales

GET /api/translations/locales

Response

{
"data": [
{
"id": "loc_1",
"code": "en",
"name": "English",
"isDefault": true,
"isRtl": false,
"tenantId": "t_789",
"createdAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-01T00:00:00Z"
},
{
"id": "loc_2",
"code": "ar",
"name": "Arabic",
"isDefault": false,
"isRtl": true,
"tenantId": "t_789",
"createdAt": "2025-01-05T00:00:00Z",
"updatedAt": "2025-01-05T00:00:00Z"
}
]
}

Create Locale

POST /api/translations/locales

Request Body

{
"code": "fr",
"name": "French",
"isDefault": false,
"isRtl": false
}
FieldTypeRequiredDescription
codestring (2-10)YesISO locale code
namestringYesDisplay name
isDefaultbooleanYesWhether this is the default locale
isRtlbooleanYesWhether the locale uses right-to-left text

Get Locale

GET /api/translations/locales/:id

Update Locale

PUT /api/translations/locales/:id