Skip to content
Docs

CDN API

Manage CDN deployments, domains, SSL, caching, and analytics under /api/cdn.

All endpoints require authentication.

Quick start

A deployment is a container for one or more domains, each with its own origin and cache settings:

Terminal
# Create a deployment
curl -X POST https://edge.network/api/cdn/deployments \
  -H "Authorization: Bearer ek_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "my-site" }'

# Add a domain with an origin
curl -X POST https://edge.network/api/cdn/deployments/DEPLOYMENT_ID/domains \
  -H "Authorization: Bearer ek_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "cdn.example.com",
    "originType": "url",
    "origin": "https://origin.example.com",
    "cacheTtlSeconds": 3600
  }'

Deployments

EndpointDescription
GET /api/cdn/deploymentsList deployments
POST /api/cdn/deploymentsCreate. Body: { "name": "..." }. Returns 201.
GET /api/cdn/deployments/:idGet one deployment with its domains
DELETE /api/cdn/deployments/:idDelete a deployment
GET | POST /api/cdn/deployments/:id/pauseGet / toggle cache pause. Body: { "paused": true }
GET /api/cdn/usageAccount-wide requests, bytes served and cache hit rate
GET /api/cdn/edge-nodesStatus of the edge node network

Domains and SSL

EndpointDescription
POST /api/cdn/deployments/:id/domainsAdd a domain. Body: { domain, originType?, origin?, storageBucket?, cacheTtlSeconds?, jitImageEnabled? }
PATCH /api/cdn/deployments/:id/domains/:domainIdUpdate origin, TTL, image optimisation, root-path behaviour and custom config
DELETE /api/cdn/deployments/:id/domains/:domainIdRemove a domain
POST .../domains/:domainId/check-dnsVerify the CNAME is pointing at Edge
POST .../domains/:domainId/retry-sslRe-attempt SSL certificate issuance
POST | DELETE .../domains/:domainId/watermarkUpload (raw PNG/WebP body) or remove a watermark image
PUT .../domains/:domainId/protectionEnable or disable password protection (HTTP Basic Auth). Body: enabled, username, password
GET .../domains/:domainId/statsPer-domain traffic stats

originType is url (default, requires origin) or storage (requires storageBucket; serves directly from Edge Storage).

Cache purging

Terminal
curl -X POST https://edge.network/api/cdn/deployments/DEPLOYMENT_ID/purge \
  -H "Authorization: Bearer ek_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "type": "prefix", "path": "/images/" }'
Purge typeRequired fieldEffect
singleurlPurge one exact URL
prefixpathPurge everything under a path prefix
regexpatternPurge URLs matching a regular expression
everythingNonePurge the whole deployment

Purge history is available at GET /api/cdn/deployments/:id/purge-history.

Analytics

EndpointDescription
GET /api/cdn/deployments/:id/statsLive stats snapshot
GET .../stats/history?range=24hHistory. range is 1h, 24h, 7d, 30d or 1y
GET .../region-stats?range=24hTraffic by region across the edge network
GET .../top-content?limit=100Most-requested paths
GET .../cache-statsCached object count and size
GET .../events?limit=50Deployment activity log

Something unclear or out of date? Tell us, or read this page as Markdown.