CDN API
Public API · Enterprise Edition
The CDN delivery endpoint is part of Studio's public, versioned, key-gated API (/api/cdn/v1/) — a stable contract intended for external integrations. CDN is an Enterprise-Edition feature (Starter+ on the managed service; not available in a self-hosted Community deployment).
Studio provides a built-in CDN for delivering content as JSON via API keys. Content is built from Git and stored in Cloudflare R2 object storage.
CDN Settings
Get CDN Settings
GET /api/workspaces/:workspaceId/projects/:projectId/cdn/settingsResponse
{
"enabled": true,
"lastBuildAt": "2026-01-15T12:00:00Z",
"usage": {
"requestCount": 1500,
"bandwidthBytes": 52428800
}
}Update CDN Settings
PATCH /api/workspaces/:workspaceId/projects/:projectId/cdn/settings| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | No | Enable/disable CDN delivery |
Builds
Trigger Build
Build (or rebuild) CDN content from the repository.
POST /api/workspaces/:workspaceId/projects/:projectId/cdn/builds/triggerResponse
{
"buildId": "uuid",
"status": "building",
"triggerType": "manual"
}The build process reads content from Git, serializes it to JSON, and uploads to R2. Stale objects are cleaned up via diff-based comparison.
List Builds
GET /api/workspaces/:workspaceId/projects/:projectId/cdn/buildsResponse
[
{
"id": "uuid",
"status": "completed",
"trigger_type": "manual",
"commit_sha": "abc123",
"started_at": "2026-01-15T12:00:00Z",
"completed_at": "2026-01-15T12:00:05Z"
}
]API Keys
List CDN Keys
GET /api/workspaces/:workspaceId/projects/:projectId/cdn/keysResponse
[
{
"id": "uuid",
"name": "Production Key",
"key_prefix": "crn_live_7K2mX9p",
"last_used_at": "2026-01-15T12:00:00Z",
"created_at": "2026-01-01T00:00:00Z"
}
]Create CDN Key
POST /api/workspaces/:workspaceId/projects/:projectId/cdn/keys| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Key display name |
Response
{
"id": "uuid",
"name": "Production Key",
"key": "crn_live_7K2mX9pQ4rT6vW3nY8sB1hJ5...",
"key_prefix": "crn_live_7K2mX9p"
}WARNING
The full API key is only returned once at creation time. Studio stores only the SHA-256 hash; the key_prefix (first 16 characters) is kept for display. Store the full key securely.
Revoke CDN Key
DELETE /api/workspaces/:workspaceId/projects/:projectId/cdn/keys/:keyIdPlan Limits
| Plan | API Keys | Bandwidth/Month |
|---|---|---|
| Starter | 3 | 2 GB |
| Pro | 10 | 20 GB |
| Enterprise | Unlimited | Unlimited |
Content Delivery (Public)
Fetch content through the CDN. Authenticated via API key in Authorization header.
GET /api/cdn/v1/:projectId/:pathHeaders
Authorization: Bearer crn_live_your-api-keyObject Paths
CDN objects are keyed by model ID (not domain) — the build pipeline writes them flat under content/, documents/, and models/:
| Path | Returns |
|---|---|
content/{modelId}/{locale}.json | Published entries for an i18n collection/singleton/dictionary, by locale (object map keyed by entry ID) |
content/{modelId}/data.json | Published entries for a non-i18n model |
documents/{modelId}/{slug}/{locale}.json | A single document entry |
models/{modelId}.json | A model definition |
models/_index.json | Summary index of all models |
_manifest.json | Build manifest (commit SHA, locales, domains, model list) |
Examples
# Get a collection (English locale)
curl https://studio.example.com/api/cdn/v1/{projectId}/content/blog-post/en.json \
-H "Authorization: Bearer crn_live_..."
# Get a singleton (English locale)
curl https://studio.example.com/api/cdn/v1/{projectId}/content/hero/en.json \
-H "Authorization: Bearer crn_live_..."
# Get model definition
curl https://studio.example.com/api/cdn/v1/{projectId}/models/blog-post.json \
-H "Authorization: Bearer crn_live_..."Response
Returns the raw JSON content file from R2 storage with appropriate Content-Type and ETag headers.
Rate Limiting
CDN requests are rate-limited per API key. Usage (request count and bandwidth) is metered per project.
Related Pages
- Self-Hosting -- R2 storage configuration
- Environment Variables -- CDN-related variables
- Enterprise Edition -- CDN provider implementation