CDNShark Documentation

Customer API

← Back to Documentation

Rate Limits & Errors

Rate limit

The API allows 120 requests per minute per account. All of the account's tokens share the limit. Every response carries:

X-RateLimit-Limit: 120
X-RateLimit-Remaining: 117

Over the limit you get 429 Too Many Requests with a Retry-After header (seconds). Wait that long, and back off exponentially if it repeats. If you need a higher limit, contact support.

Status codes

CodeMeaningBody
200 / 201OK / createdThe result.
207Partly done (cache purge: some edges failed){"message", "failed_edges"}
401Missing or invalid token{"message": "Unauthenticated."}
402No active paid service on the account{"message": "No active paid service found for this API action."}
403The token lacks the permission, or your plan does not include the product{"message": "..."}. For a plan limit it also includes upgrade_url.
404Not found, or not yours{"message": "..."}
422Invalid input, or the change was refused{"message", "errors": {"field": ["..."]}}, or just {"message"}
429Rate limit exceededSee above.

A 422 example:

{
  "message": "The value field is required.",
  "errors": { "value": ["The value field is required."] }
}

Remember Accept: application/json on every request, or validation errors come back as a redirect.