Skip to content

CDN API

The CDN API lets project managers trigger a deployment to Comvi’s global CDN. Once published, your application can load translations directly from the CDN using the SDK’s fetch-loader plugin.

Published translations are available at:

https://cdn.comvi.io/{token}/{namespace}/{locale}.json

The default namespace is served at the project root (no namespace folder):

https://cdn.comvi.io/{token}/{locale}.json
SegmentDescription
{token}Your project’s CDN token (found in project settings)
{namespace}Namespace name (e.g., common, dashboard). Omit the folder for default.
{locale}Locale code (e.g., en, fr, de)

Examples

https://cdn.comvi.io/abc123xyz/common/en.json # common namespace
https://cdn.comvi.io/abc123xyz/en.json # default namespace

Trigger a CDN deployment for a project. This enqueues a background job that builds and uploads translation files to the CDN.

POST /api/v1/projects/:projectId/cdn/deploy

Path parameters

ParameterTypeRequiredDescription
projectIdintegerYesProject ID

Example request

Terminal window
curl -X POST \
-H "Cookie: session=..." \
-H "X-CSRF-Token: your-csrf-token" \
https://api.comvi.io/api/v1/projects/5/cdn/deploy

Example response

{
"success": true,
"filesDeployed": 0,
"message": "enqueued"
}

Response fields

FieldTypeDescription
successbooleanWhether the deployment was successfully enqueued
filesDeployedintegerNumber of files deployed (0 when initially enqueued)
messagestringStatus message

The endpoint returns 202 Accepted immediately. The actual deployment runs asynchronously.

CDN deployments are rate-limited to 50 per user per project per 10-minute window to prevent abuse.


StatusError CodeDescription
403FORBIDDENMissing project manage permission
404PROJECT_NOT_FOUNDThe specified project does not exist
429RATE_LIMIT_EXCEEDEDToo many deploy requests (max 50 per 10 minutes per user per project)