Documentation

Everything you need to put Diamond CDN in front of your site.

Quick start

Point a CNAME to our edge hostname:

example.com.   IN CNAME   edge.diamondcdn.net.

Then send your first request — you should see the following response headers:

curl -I https://example.com
# HTTP/2 200
# server: diamond-edge
# x-cache: HIT
# x-pop: ams01

API reference

All API calls require a bearer token. Get one from your console.

Purge cache

curl -X POST https://api.diamondcdn.net/v1/purge \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domain":"example.com","paths":["/*"]}'

Create a zone

curl -X POST https://api.diamondcdn.net/v1/zones \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domain":"example.com","origin":"origin.example.com"}'

Enable WAF

curl -X PATCH https://api.diamondcdn.net/v1/zones/example.com/waf \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true,"rule_set":"owasp-crs-4.0"}'

Rate limits

The API allows 1000 requests per minute per account. Responses include x-ratelimit-remaining and x-ratelimit-reset headers.

Errors

Errors are returned as JSON with a stable machine-readable code field:

{
  "error": "zone_not_found",
  "message": "Zone example.com does not exist in this account",
  "request_id": "req_01H..."
}