OverviewAuthentication

Authentication

Authenticate every 5centsCDN API request using your API key.


How it works

Add the X-API-KEY header to every request. Your key identifies your account and authorizes access to all resources on it.

GET https://api.5centscdn.com/v2/zones
X-API-KEY: YOUR_API_KEY

Get your API key

Log in to your dashboard

Go to 5centscdn.net/dashboard and sign in.

Open API Keys

Navigate to Settings → API Keys.

Copy or generate your key

Copy your existing key or click Generate New Key. Store it safely — it will not be shown again after creation.


Authenticated request examples

curl -X GET https://api.5centscdn.com/v2/zones \
  -H "X-API-KEY: YOUR_API_KEY"

Authentication errors

{
  "status": "error",
  "errors": [
    {
      "code": 401,
      "message": "API key is required. Include X-API-KEY in your request header."
    }
  ]
}
CodeMeaningFix
401Missing or invalid API keyCheck that the header name is X-API-KEY and the value is correct
403Valid key, insufficient permissionsContact support — your account may have restrictions

Security best practices

Your key grants full access to your account. Keep it out of client-side code, public repos, and browser requests.

Store your key as an environment variable and reference it in code — never hardcode it.

# .env
CDN_API_KEY=your_actual_key_here
  • Separate keys per environment — use different keys for dev, staging, and production

  • Rotate regularly — regenerate after any team member with access leaves

  • Monitor usage — check your dashboard for unexpected API activity

  • Rotate immediately if you suspect your key has been compromised