Edge

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:

# 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

Endpoint Description
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 & SSL

Endpoint Description
POST /api/cdn/deployments/:id/domainsAdd a domain — { domain, originType?, origin?, storageBucket?, cacheTtlSeconds?, jitImageEnabled? }
PATCH /api/cdn/deployments/:id/domains/:domainIdUpdate origin, TTL, image optimization, 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
GET .../domains/:domainId/statsPer-domain traffic stats

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

Cache Purging

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 type Required field Effect
singleurlPurge one exact URL
prefixpathPurge everything under a path prefix
regexpatternPurge URLs matching a regular expression
everythingPurge the whole deployment

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

Analytics

Endpoint Description
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