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
Segment Description
{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

Parameter Type Required Description
projectId integer Yes Project 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

Field Type Description
success boolean Whether the deployment was successfully enqueued
filesDeployed integer Number of files deployed (0 when initially enqueued)
message string Status 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.


Status Error Code Description
403 FORBIDDEN Missing project manage permission
404 PROJECT_NOT_FOUND The specified project does not exist
429 RATE_LIMIT_EXCEEDED Too many deploy requests (max 50 per 10 minutes per user per project)