Skip to content

Translation Memory API

Translation memories (TMs) store previously translated segments so you can reuse them across projects. When a translator encounters a similar or identical source string, the TM suggests matching translations, improving consistency and reducing effort.


Returns all translation memories in an organization, with pagination.

GET /api/v1/organizations/:orgId/tms

Path parameters

ParameterTypeRequiredDescription
orgIdintegerYesOrganization ID

Query parameters

ParameterTypeRequiredDescription
cursorstringNoPagination cursor from a previous response
limitintegerNoItems per page (1-100, default: 50)

Example request

Terminal window
curl -X GET \
-H "X-API-Key: tlk_your_api_key" \
https://api.comvi.io/api/v1/organizations/1/tms

Example response

{
"tms": [
{
"id": 1,
"organizationId": 1,
"name": "Main TM",
"description": "Primary translation memory for all projects",
"sourceLocaleId": 10,
"sourceLocaleCode": "en",
"isDefault": true,
"isShared": true,
"autoPopulate": true,
"onlyApproved": false,
"entriesCount": 12450,
"languageCount": 8,
"linkedProjectsCount": 3,
"createdAt": "2025-01-10T08:00:00Z",
"updatedAt": "2025-03-20T14:00:00Z"
}
],
"nextCursor": null,
"hasMore": false
}

Response fields

FieldTypeDescription
idintegerTM ID
organizationIdintegerOrganization this TM belongs to
namestringTM name
descriptionstring | nullOptional description
sourceLocaleIdintegerSource language locale ID
sourceLocaleCodestringSource language code (e.g., en)
isDefaultbooleanWhether this is the organization’s default TM
isSharedbooleanWhether this TM is shared across projects
autoPopulatebooleanAutomatically add new translations to this TM
onlyApprovedbooleanOnly store reviewed/approved translations
entriesCountintegerTotal number of entries
languageCountintegerNumber of unique target languages
linkedProjectsCountintegerNumber of projects using this TM
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp

Create a new translation memory in an organization.

POST /api/v1/organizations/:orgId/tms

Path parameters

ParameterTypeRequiredDescription
orgIdintegerYesOrganization ID

Request body

FieldTypeRequiredDescription
namestringYesTM name (1-255 characters)
descriptionstringNoOptional description (up to 2000 characters)
sourceLocaleIdintegerYesSource language locale ID
isSharedbooleanNoShare across projects (default: false)
onlyApprovedbooleanNoOnly store approved translations (default: false)

Example request

Terminal window
curl -X POST \
-H "X-API-Key: tlk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing TM",
"description": "Translation memory for marketing content",
"sourceLocaleId": 10,
"isShared": true
}' \
https://api.comvi.io/api/v1/organizations/1/tms

Example response

{
"id": 2,
"organizationId": 1,
"name": "Marketing TM",
"description": "Translation memory for marketing content",
"sourceLocaleId": 10,
"sourceLocaleCode": "en",
"isDefault": false,
"isShared": true,
"autoPopulate": false,
"onlyApproved": false,
"entriesCount": 0,
"languageCount": 0,
"linkedProjectsCount": 0,
"createdAt": "2025-03-25T12:00:00Z",
"updatedAt": "2025-03-25T12:00:00Z"
}

Retrieve details of a specific translation memory.

GET /api/v1/tms/:tmId

Path parameters

ParameterTypeRequiredDescription
tmIdintegerYesTranslation memory ID

Example request

Terminal window
curl -X GET \
-H "X-API-Key: tlk_your_api_key" \
https://api.comvi.io/api/v1/tms/1

Example response

Returns the same TM object format as the Create translation memory response.


Update a translation memory’s settings.

PATCH /api/v1/tms/:tmId

Path parameters

ParameterTypeRequiredDescription
tmIdintegerYesTranslation memory ID

Request body

FieldTypeRequiredDescription
namestringNoUpdated name
descriptionstring | nullNoUpdated description (set to null to clear)
isSharedbooleanNoUpdate sharing setting
autoPopulatebooleanNoEnable/disable automatic population
onlyApprovedbooleanNoOnly store approved translations

Example request

Terminal window
curl -X PATCH \
-H "X-API-Key: tlk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"autoPopulate": true,
"onlyApproved": true
}' \
https://api.comvi.io/api/v1/tms/2

Example response

Returns the updated TM object.


Permanently delete a translation memory and all of its entries.

DELETE /api/v1/tms/:tmId

Path parameters

ParameterTypeRequiredDescription
tmIdintegerYesTranslation memory ID

Example request

Terminal window
curl -X DELETE \
-H "X-API-Key: tlk_your_api_key" \
https://api.comvi.io/api/v1/tms/2

Response

Returns 204 No Content on success.


Search a translation memory for matches against a source text. Returns results ranked by similarity.

POST /api/v1/tms/:tmId/search

Path parameters

ParameterTypeRequiredDescription
tmIdintegerYesTranslation memory ID

Request body

FieldTypeRequiredDescription
sourceTextstringYesText to search for (1-10000 characters)
targetLocaleIdintegerYesTarget language locale ID
contextKeystringNoTranslation key for context-aware matching (up to 512 characters)
minSimilarityintegerNoMinimum similarity percentage (50-100, default: 75)
maxResultsintegerNoMaximum number of results (1-20, default: 5)

Example request

Terminal window
curl -X POST \
-H "X-API-Key: tlk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"sourceText": "Welcome to the dashboard",
"targetLocaleId": 11,
"minSimilarity": 70,
"maxResults": 5
}' \
https://api.comvi.io/api/v1/tms/1/search

Example response

{
"matches": [
{
"id": 5001,
"sourceText": "Welcome to the dashboard",
"targetText": "Bienvenue sur le tableau de bord",
"targetLocaleId": 11,
"similarity": 100,
"matchType": "exact",
"contextKey": "dashboard.welcome",
"sourceProjectName": "Web App",
"authorName": "Jane Smith",
"tmName": "Main TM",
"usageCount": 12
},
{
"id": 5002,
"sourceText": "Welcome to your dashboard",
"targetText": "Bienvenue sur votre tableau de bord",
"targetLocaleId": 11,
"similarity": 92,
"matchType": "fuzzy",
"contextKey": null,
"sourceProjectName": "Mobile App",
"authorName": "Bob Johnson",
"tmName": "Main TM",
"usageCount": 3
}
],
"total": 2
}

Match types

TypeSimilarityDescription
perfect101Exact match with identical context key
exact100Exact text match (different or no context)
fuzzy50-99Partial match based on text similarity

Import translation segments from a TMX (Translation Memory eXchange) file.

POST /api/v1/tms/:tmId/import

Path parameters

ParameterTypeRequiredDescription
tmIdintegerYesTranslation memory ID

Request body

FieldTypeRequiredDescription
contentstringYesTMX file content (XML string, up to 10 MB)
conflictResolutionstringNoHow to handle duplicates: skip (default), overwrite, or keep_highest
localeMappingobjectNoMap locale codes in the file to your locale codes (e.g., {"en-US": "en"})

Example request

Terminal window
curl -X POST \
-H "X-API-Key: tlk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE tmx SYSTEM \"tmx14.dtd\"><tmx version=\"1.4\">...</tmx>",
"conflictResolution": "overwrite",
"localeMapping": {"en-US": "en", "fr-FR": "fr"}
}' \
https://api.comvi.io/api/v1/tms/1/import

Example response

{
"imported": 1250,
"skipped": 30,
"errors": [
"Row 45: target locale 'xx' not found"
]
}

Response fields

FieldTypeDescription
importedintegerNumber of segments successfully imported
skippedintegerNumber of segments skipped (duplicates or invalid)
errorsstring[]List of error messages for failed entries

Export the entire translation memory as a TMX file. The response is streamed as XML.

GET /api/v1/tms/:tmId/export

Path parameters

ParameterTypeRequiredDescription
tmIdintegerYesTranslation memory ID

Query parameters

ParameterTypeRequiredDescription
targetLocaleIdintegerNoFilter export to a specific target language

Example request

Terminal window
curl -X GET \
-H "X-API-Key: tlk_your_api_key" \
-o translations.tmx \
https://api.comvi.io/api/v1/tms/1/export

The response has Content-Type: application/xml and Content-Disposition: attachment; filename="TM Name.tmx".


StatusError CodeDescription
400INVALID_INPUTInvalid source locale, target locale, or request body
400VALIDATION_ERRORTMX file is invalid or exceeds 50,000 translation units
403FORBIDDENMissing translation memory permission
404NOT_FOUNDTranslation memory not found