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.
CDN URL format
Section titled “CDN URL format”Published translations are available at:
https://cdn.comvi.io/{token}/{namespace}/{locale}.jsonThe 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 namespacehttps://cdn.comvi.io/abc123xyz/en.json # default namespaceDeploy translations to CDN
Section titled “Deploy translations to CDN”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/deployPath parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | integer | Yes | Project ID |
Example request
curl -X POST \ -H "Cookie: session=..." \ -H "X-CSRF-Token: your-csrf-token" \ https://api.comvi.io/api/v1/projects/5/cdn/deployExample 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.
Errors
Section titled “Errors”| 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) |
Next Steps
Section titled “Next Steps” CDN in the Platform Configure CDN settings from the dashboard.
Fetch Loader Plugin Load CDN translations in your app with the SDK.
API Authentication Use session authentication for manager-only API actions.
CI/CD Guide Integrate Comvi into your deployment pipeline.