CDNShark Documentation

Customer API

← Back to Documentation

Domains API

Domains are the sites you run through CDNShark. Adding a domain also creates its DNS zone. Records are managed with the DNS API. Needs an active paid service.

List domains

GET /api/domains (domains:read)

{
  "data": [
    { "id": 47, "domain_name": "example.com", "zone_name": "example.com",
      "status": "active", "plan_id": 3, "created_at": "2026-09-01T10:00:00.000000Z" }
  ]
}

Add a domain

POST /api/domains (domains:write)

FieldRequiredNotes
domain_nameyesFor example example.com. Must not already exist on CDNShark.
curl -X POST https://cdnshark.com/api/domains \
  -H "Authorization: Bearer YOUR_TOKEN" -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"domain_name": "example.com"}'

Returns 201 {"domain": {...}, "dns_zone": "created"}. If dns_zone is "failed", the domain was added but its DNS zone was not: contact support.

Change a domain

PUT /api/domains/{id} (domains:write)

FieldNotes
nameserversComma-separated nameservers recorded for the domain.
domain_nameCorrects the name. It does not move DNS records to a new zone.

status cannot be changed through the API (422). It is managed by CDNShark, for billing and suspension.

Delete a domain

DELETE /api/domains/{domain_name} (domains:write). This deletes the domain and its DNS zone with all records. Returns {"message": "Domain deleted."}.