API Reference
Every customer endpoint. The base URL is https://cdnshark.com/api. Authenticate with your API token: see API Authentication & Tokens. Send Accept: application/json. Errors and limits are covered in Rate Limits & Errors.
Tokens
| Method | Path | Permission | Description |
|---|---|---|---|
| GET | /api/tokens | any API token | List tokens |
| POST | /api/tokens | any API token | Issue a new API token, replacing the current one |
| DELETE | /api/tokens/{id} | any API token | Revoke one token |
| DELETE | /api/tokens/all | any API token | Revoke all tokens |
Domains: Domains API
| Method | Path | Permission | Description |
|---|---|---|---|
| GET | /api/domains | domains:read | List domains |
| POST | /api/domains | domains:write | Add a domain (creates its DNS zone) |
| PUT | /api/domains/{id} | domains:write | Change nameservers or name |
| DELETE | /api/domains/{domain_name} | domains:write | Delete a domain and its zone |
DNS: DNS API
| Method | Path | Permission | Description |
|---|---|---|---|
| GET | /api/dns | dns:read | List zones |
| GET | /api/dns/{zone} | dns:read | List a zone's records |
| POST | /api/dns/{zone}/records | dns:write | Add a record |
| PUT | /api/dns/{zone}/records | dns:write | Change a record |
| DELETE | /api/dns/{zone}/records | dns:write | Delete a record |
Pull zones: Pull Zones API
| Method | Path | Permission | Description |
|---|---|---|---|
| GET | /api/pullzones | pullzones:read | List pull zones |
| POST | /api/pullzones | pullzones:write | Create a pull zone |
| PUT | /api/pullzones/{id} | pullzones:write | Change a pull zone |
| POST | /api/pullzones/{id}/purge | pullzones:write | Purge the cache: Purge Cache via API |
| DELETE | /api/pullzones/{id} | pullzones:write | Delete a pull zone |
Storage: Storage Buckets API
| Method | Path | Permission | Description |
|---|---|---|---|
| GET | /api/storage/buckets | storage:read | List buckets |
| POST | /api/storage/buckets | storage:write | Create a bucket |
| GET | /api/storage/buckets/{bucket_name}/credentials | storage:read | S3 endpoint and keys |
| DELETE | /api/storage/buckets/{bucket_name} | storage:write | Delete a bucket and its objects |
Video: Video Libraries & Playback Tokens API
| Method | Path | Permission | Description |
|---|---|---|---|
| GET | /api/video/libraries | streams:read | List libraries |
| POST | /api/video/libraries | streams:write | Create a library |
| DELETE | /api/video/libraries/{id} | streams:write | Delete a library |
| GET | /api/video/playback-tokens | streams:read | List playback tokens |
| POST | /api/video/playback-token | streams:write | Create a playback token |
| GET | /api/video/playback-token/{id} | streams:read | Get a playback token |
| POST | /api/video/playback-token/{id}/refresh | streams:write | New expiry and URL |
| DELETE | /api/video/playback-token/{id} | streams:write | Revoke |
| GET | /api/video/playback-token/{id}/logs | streams:read | Access log |
Live streams: Live Streams API
| Method | Path | Permission | Description |
|---|---|---|---|
| GET | /api/live/streams | streams:read | List streams |
| POST | /api/live/streams | streams:write | Create a stream |
| GET | /api/live/streams/{id} | streams:read | Get a stream, including its key |
| POST | /api/live/streams/{id}/rotate-key | streams:write | New stream key (playback URL unchanged) |
| DELETE | /api/live/streams/{id} | streams:write | Delete a stream |
Webhooks: Webhooks API
| Method | Path | Permission | Description |
|---|---|---|---|
| GET | /api/webhooks | webhooks:read | List webhooks |
| POST | /api/webhooks | webhooks:write | Create a webhook |
| PUT | /api/webhooks/{id} | webhooks:write | Change a webhook |
| DELETE | /api/webhooks/{id} | webhooks:write | Delete a webhook |
| GET | /api/webhooks/{id}/logs | webhooks:read | Recent deliveries |
| GET | /api/webhooks/events | webhooks:read | Event names |