Skip to content

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/settings

Response

json
{
  "enabled": true,
  "lastBuildAt": "2026-01-15T12:00:00Z",
  "usage": {
    "requestCount": 1500,
    "bandwidthBytes": 52428800
  }
}

Update CDN Settings

PATCH /api/workspaces/:workspaceId/projects/:projectId/cdn/settings
FieldTypeRequiredDescription
enabledbooleanNoEnable/disable CDN delivery

Builds

Trigger Build

Build (or rebuild) CDN content from the repository.

POST /api/workspaces/:workspaceId/projects/:projectId/cdn/builds/trigger

Response

json
{
  "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/builds

Response

json
[
  {
    "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/keys

Response

json
[
  {
    "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
FieldTypeRequiredDescription
namestringYesKey display name

Response

json
{
  "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/:keyId

Plan Limits

PlanAPI KeysBandwidth/Month
Starter32 GB
Pro1020 GB
EnterpriseUnlimitedUnlimited

Content Delivery (Public)

Fetch content through the CDN. Authenticated via API key in Authorization header.

GET /api/cdn/v1/:projectId/:path

Headers

http
Authorization: Bearer crn_live_your-api-key

Object Paths

CDN objects are keyed by model ID (not domain) — the build pipeline writes them flat under content/, documents/, and models/:

PathReturns
content/{modelId}/{locale}.jsonPublished entries for an i18n collection/singleton/dictionary, by locale (object map keyed by entry ID)
content/{modelId}/data.jsonPublished entries for a non-i18n model
documents/{modelId}/{slug}/{locale}.jsonA single document entry
models/{modelId}.jsonA model definition
models/_index.jsonSummary index of all models
_manifest.jsonBuild manifest (commit SHA, locales, domains, model list)

Examples

bash
# 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.

Released under the AGPL-3.0 License.