CDNShark Documentation

Customer API

← Back to Documentation

Read your Valkey caches and their connection details, and change which client IP addresses may connect. Caches are set up by our team, so creating and deleting them is done through a support request, not the API.

Needs an API token with valkey:read to read (this includes the connection password, so give it only to tokens that need it), and valkey:write to change allowed IPs.

MethodPathAbilityDescription
GET/api/valkeyvalkey:readYour caches: id, name, status, host, port, cache_mb, allowed_ips, max_allowed_ips.
GET/api/valkey/{id}valkey:readOne cache, plus connection (host, port, user, password, url) while it is active.
POST/api/valkey/{id}/ipsvalkey:writeBody: ip, a single address or a range no wider than /16 (IPv4) or /48 (IPv6). Up to 20 per cache. Returns the cache.
DELETE/api/valkey/{id}/ipsvalkey:writeBody: ip, exactly as shown in allowed_ips. Returns the cache.
curl -X POST https://cdnshark.com/api/valkey/7/ips \
  -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" \
  -d '{"ip":"203.0.113.10"}'

Changes reach the cache's firewall within seconds. A suspended cache refuses changes with 422.

Machine-readable spec: OpenAPI 3.1 file for Cloud VPS and Valkey, for code generators and AI assistants.