Base URL: https://api.rescdn.io/v1
Get your API key from the dashboard, then set it as an environment variable:
export RESCDN_KEY=rk_live_xxxxxxxxxxxxxxxxxxxx
Upload your first asset zone:
curl -X POST https://api.rescdn.io/v1/zones \
-H "X-ResCDN-Key: $RESCDN_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"my-assets","origin":"https://your-origin.com"}'
All API requests require an API key in the X-ResCDN-Key header. Keys are prefixed rk_live_ for production and rk_test_ for test mode.
curl https://api.rescdn.io/v1/zones \
-H "X-ResCDN-Key: rk_live_xxxxxxxxxxxxxxxxxxxx"
Requests without a valid key return 401:
{ "error": "authentication required" }
| Code | Meaning |
|---|---|
401 | Missing or invalid API key |
403 | Key lacks permission for this resource |
404 | Zone or resource not found |
429 | Rate limit exceeded (100 req/min per key) |
500 | Internal server error |
A zone maps a subdomain on the ResCDN network to your origin server.
/v1/zones
List all zones on your account.
curl https://api.rescdn.io/v1/zones \
-H "X-ResCDN-Key: $RESCDN_KEY"
{
"zones": [
{
"id": "zone_abc123",
"name": "my-assets",
"subdomain": "my-assets.rescdn.io",
"origin": "https://your-origin.com",
"created": "2025-01-14T10:00:00Z",
"active": true
}
]
}
/v1/zones
Create a new zone.
curl -X POST https://api.rescdn.io/v1/zones \
-H "X-ResCDN-Key: $RESCDN_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"my-assets","origin":"https://your-origin.com"}'
/v1/usage
Bandwidth and request counts for the current billing period.
curl https://api.rescdn.io/v1/usage \
-H "X-ResCDN-Key: $RESCDN_KEY"
{
"period_start": "2026-03-01",
"period_end": "2026-03-31",
"requests": 4812033,
"bandwidth_bytes": 98123456789,
"cache_hit_rate": 0.97
}
/v1/purge?zone=<id>&path=<path>
Purge a specific path from cache across all PoPs.
curl "https://api.rescdn.io/v1/purge?zone=zone_abc123&path=/assets/v2/reset.css" \
-H "X-ResCDN-Key: $RESCDN_KEY"
{ "purged": true, "nodes": 12 }
Once a zone is active, assets are served at:
https://<zone-name>.rescdn.io/<path>
| Extension | Content-Type |
|---|---|
.css | text/css |
.js | application/javascript |
.woff2 | font/woff2 |
.woff | font/woff |
.png | image/png |
.svg | image/svg+xml |
| Asset type | Default TTL |
|---|---|
| CSS / JS | 24 hours |
| Fonts | 7 days |
| Images | 24 hours |