CDNShark Documentation

Guides, tutorials, and references for every part of CDNShark — edge delivery, pull zones, DNS, cache controls, and more.

← Back to Documentation
.api-ref-table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; } .api-ref-table th, .api-ref-table td { border: 1px solid #94a3b8; padding: 8px 10px; text-align: left; vertical-align: top; } .api-ref-table th { background: #f1f5f9; }

CDNShark User API Reference

All endpoints require a Bearer token generated from the token API.

Base URL: /api

Authentication

Authorization: Bearer YOUR_TOKEN

Create API Token

curl -X POST "$BASE_URL/api/tokens" \
  -H "Authorization: Bearer $LOGIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name":"My API Token",
    "abilities":[
      "domains:read","domains:write",
      "dns:read","dns:write",
      "pullzones:read","pullzones:write",
      "storage:read","storage:write",
      "streams:read","streams:write"
    ]
  }'

Domains

MethodEndpointDescription
GET/api/domainsList domains
POST/api/domainsCreate domain
PUT/api/domains/{id}Update domain
DELETE/api/domains/{domainName}Delete domain
curl -X PUT "$BASE_URL/api/domains/12" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status":"active","nameservers":"ns1.example.com,ns2.example.com"}'

DNS

MethodEndpointDescription
GET/api/dnsList zones
GET/api/dns/{zone}List records in zone
POST/api/dns/{zone}/recordsCreate record
PUT/api/dns/{zone}/recordsUpdate record
DELETE/api/dns/{zone}/recordsDelete record

Pull Zones

MethodEndpointDescription
GET/api/pullzonesList pull zones
POST/api/pullzonesCreate pull zone
PUT/api/pullzones/{id}Update pull zone
DELETE/api/pullzones/{id}Delete pull zone
curl -X POST "$BASE_URL/api/pullzones" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "label":"Main Site",
    "name":"main-site-zone",
    "origin_url":"https://origin.example.com",
    "cache_ttl":3600,
    "is_cached":true
  }'

Storage Buckets

MethodEndpointDescription
GET/api/storage/bucketsList buckets
POST/api/storage/bucketsCreate bucket
GET/api/storage/buckets/{bucketName}/credentialsGet bucket credentials
DELETE/api/storage/buckets/{bucketName}Delete bucket
curl -X GET "$BASE_URL/api/storage/buckets/my-bucket/credentials" \
  -H "Authorization: Bearer $TOKEN"

Stream Libraries

MethodEndpointDescription
GET/api/video/librariesList stream libraries
POST/api/video/librariesCreate stream library
DELETE/api/video/libraries/{id}Delete stream library
curl -X POST "$BASE_URL/api/video/libraries" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Movies Library"}'

Access Policy

User service APIs require an active paid service and no unpaid service invoices. If access is blocked, API returns HTTP 402 with a message.