Skip to content

Namespaces API

Namespaces let you organize translation keys into logical groups — for example, separating common, auth, and settings keys. Every project starts with a default namespace.

Retrieve all namespaces in a project.

GET /api/v1/projects/:projectId/namespaces
ParameterTypeRequiredDescription
projectIdintegerYesProject ID
Terminal window
curl -X GET \
-H "X-API-Key: tlk_your_api_key" \
https://api.comvi.io/api/v1/projects/1/namespaces
[
{
"id": 1,
"projectId": 1,
"namespace": "default",
"description": null,
"isDefault": true,
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z"
},
{
"id": 2,
"projectId": 1,
"namespace": "auth",
"description": "Authentication and login screens",
"isDefault": false,
"createdAt": "2025-01-16T09:00:00.000Z",
"updatedAt": "2025-01-16T09:00:00.000Z"
}
]
StatusErrorDescription
401UNAUTHORIZEDMissing or invalid authentication
403FORBIDDENNo permission to view namespaces in this project

Create a new namespace in a project.

POST /api/v1/projects/:projectId/namespaces
ParameterTypeRequiredDescription
projectIdintegerYesProject ID
FieldTypeRequiredDescription
namespacestringYesNamespace name (1-255 characters)
descriptionstringNoDescription of what this namespace contains (max 1000 characters)
isDefaultbooleanYesWhether this should be the default namespace
Terminal window
curl -X POST \
-H "X-API-Key: tlk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"namespace": "auth",
"description": "Authentication and login screens",
"isDefault": false
}' \
https://api.comvi.io/api/v1/projects/1/namespaces
{
"id": 2,
"projectId": 1,
"namespace": "auth",
"description": "Authentication and login screens",
"isDefault": false,
"createdAt": "2025-01-16T09:00:00.000Z",
"updatedAt": "2025-01-16T09:00:00.000Z"
}
StatusErrorDescription
400NAMESPACE_ALREADY_EXISTSA namespace with this name already exists in the project
401UNAUTHORIZEDMissing or invalid authentication
403FORBIDDENNo permission to create namespaces in this project

Update a namespace’s name, description, or default status.

PATCH /api/v1/projects/:projectId/namespaces/:namespaceId
ParameterTypeRequiredDescription
projectIdintegerYesProject ID
namespaceIdintegerYesNamespace ID
FieldTypeRequiredDescription
namespacestringNoUpdated namespace name (1-255 characters)
descriptionstring|nullNoUpdated description (set to null to clear)
isDefaultbooleanNoSet as the default namespace
Terminal window
curl -X PATCH \
-H "X-API-Key: tlk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"description": "Login, registration, and password reset screens"
}' \
https://api.comvi.io/api/v1/projects/1/namespaces/2
{
"id": 2,
"projectId": 1,
"namespace": "auth",
"description": "Login, registration, and password reset screens",
"isDefault": false,
"createdAt": "2025-01-16T09:00:00.000Z",
"updatedAt": "2025-01-17T11:30:00.000Z"
}
StatusErrorDescription
400NAMESPACE_ALREADY_EXISTSA namespace with the new name already exists in the project
401UNAUTHORIZEDMissing or invalid authentication
403FORBIDDENNo permission to edit namespaces in this project
404NAMESPACE_NOT_FOUNDNamespace does not exist

Soft-delete a namespace. You cannot delete the default namespace or a namespace that still contains translation keys.

DELETE /api/v1/projects/:projectId/namespaces/:namespaceId
ParameterTypeRequiredDescription
projectIdintegerYesProject ID
namespaceIdintegerYesNamespace ID
Terminal window
curl -X DELETE \
-H "X-API-Key: tlk_your_api_key" \
https://api.comvi.io/api/v1/projects/1/namespaces/2

Returns 204 No Content with an empty body on success.

StatusErrorDescription
400CANNOT_DELETE_DEFAULTCannot delete the default namespace — set another namespace as default first
401UNAUTHORIZEDMissing or invalid authentication
403FORBIDDENNo permission to delete namespaces in this project
404NAMESPACE_NOT_FOUNDNamespace does not exist
409NAMESPACE_NOT_EMPTYCannot delete a namespace that still contains active translation keys