Skip to content

Languages API

Languages (locales) define which translations your project supports. You can add system locales from Comvi’s built-in list, or create custom locales for non-standard language codes.

Retrieve all languages configured for a project, along with the project’s source locale.

GET /api/v1/projects/:id/locales/stats
Parameter Type Required Description
id integer Yes Project ID
Terminal window
curl -X GET \
-H "Authorization: Bearer comvi_your_api_key" \
https://api.comvi.io/api/v1/projects/1/locales/stats
[
{
"localeCode": "en",
"totalKeys": 250,
"translated": 250,
"notReviewed": 0,
"notTranslated": 0,
"translatedPct": 100,
"notReviewedPct": 0,
"notTranslatedPct": 0
},
{
"localeCode": "uk",
"totalKeys": 250,
"translated": 200,
"notReviewed": 30,
"notTranslated": 20,
"translatedPct": 80,
"notReviewedPct": 12,
"notTranslatedPct": 8
}
]
Status Error Description
401 UNAUTHORIZED Missing or invalid authentication
403 FORBIDDEN No permission to view this project

Add a language to a project. You can add a system locale by code, or create a custom locale with your own code, name, and native name.

POST /api/v1/projects/:id/locales
Parameter Type Required Description
id integer Yes Project ID
Field Type Required Description
isCustom boolean Yes Set to false
localeCode string Yes System locale code (e.g., uk, de, ja)
Field Type Required Description
isCustom boolean Yes Set to true
code string Yes Custom locale code (1-50 chars, alphanumeric with - and _)
name string Yes Display name (e.g., “Pirate English”)
nativeName string Yes Native name
flagEmoji string No Flag emoji (max 10 characters)
Terminal window
curl -X POST \
-H "Authorization: Bearer comvi_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"isCustom": false,
"localeCode": "uk"
}' \
https://api.comvi.io/api/v1/projects/1/locales
Terminal window
curl -X POST \
-H "Authorization: Bearer comvi_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"isCustom": true,
"code": "en-pirate",
"name": "Pirate English",
"nativeName": "Pirate English",
"flagEmoji": "\u{1f3f4}\u{200d}\u{2620}\u{fe0f}"
}' \
https://api.comvi.io/api/v1/projects/1/locales
{
"id": 42,
"code": "uk",
"name": "Ukrainian",
"nativeName": "Українська",
"isCustom": false,
"flagEmoji": "🇺🇦"
}
Status Error Description
400 LOCALE_NOT_FOUND The specified localeCode is not a valid system locale
400 VALIDATION_ERROR Missing required fields for the chosen isCustom mode
401 UNAUTHORIZED Missing or invalid authentication
403 FORBIDDEN No permission to edit this project
403 LIMIT_EXCEEDED Language limit reached for the current plan
409 LOCALE_ALREADY_EXISTS This locale is already added to the project

Remove a language from a project. This deletes all translation values for that locale.

DELETE /api/v1/projects/:id/locales/:localeCode
Parameter Type Required Description
id integer Yes Project ID
localeCode string Yes Locale code to remove (e.g., uk)
Terminal window
curl -X DELETE \
-H "Authorization: Bearer comvi_your_api_key" \
https://api.comvi.io/api/v1/projects/1/locales/uk

Returns 204 No Content with an empty body on success.

Status Error Description
400 LOCALE_NOT_FOUND The locale code is not valid or not in this project
401 UNAUTHORIZED Missing or invalid authentication
403 FORBIDDEN No permission to edit this project
404 PROJECT_NOT_FOUND Project does not exist

Retrieve the full list of system locales supported by Comvi. This is a public endpoint that does not require authentication.

GET /api/v1/locales
Terminal window
curl -X GET \
https://api.comvi.io/api/v1/locales
[
{
"id": 1,
"code": "en",
"name": "English",
"nativeName": "English",
"isCustom": false,
"flagEmoji": "🇺🇸"
},
{
"id": 2,
"code": "uk",
"name": "Ukrainian",
"nativeName": "Українська",
"isCustom": false,
"flagEmoji": "🇺🇦"
},
{
"id": 3,
"code": "de",
"name": "German",
"nativeName": "Deutsch",
"isCustom": false,
"flagEmoji": "🇩🇪"
}
]

Retrieve details for a single locale by its code. This is a public endpoint.

GET /api/v1/locales/:code
Parameter Type Required Description
code string Yes Locale code (e.g., en, uk)
Terminal window
curl -X GET \
https://api.comvi.io/api/v1/locales/uk
{
"id": 2,
"code": "uk",
"name": "Ukrainian",
"nativeName": "Українська",
"isCustom": false,
"flagEmoji": "🇺🇦"
}
Status Error Description
404 LOCALE_NOT_FOUND No locale exists with the given code