Authentication
Every API request requires an API key. Get yours from the Dashboard.
Passing the API Key
Add it as a query parameter to any request:
?apikey=YOUR_API_KEY
Domain Restriction
You can restrict your API key to specific domains. Set allowed domains in your app details page. Requests from other domains will be rejected.
example.com, app.example.com
Request Signing (Optional)
For POST requests (and optionally GET requests), you can sign the request body using your signing secret and HMAC-SHA256. Include the signature in the X-Signature header as a hex string.
X-Signature: a1b2c3d4e5f6...
Error Responses
All errors return a JSON object with an error message, a machine-readable code, and links to documentation.
{
"error": "Invalid API key",
"code": "UNAUTHORIZED",
"docs": "https://docs.divct.workers.dev",
"dashboard": "https://www.divct.workers.dev"
}
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 403 | DOMAIN_NOT_ALLOWED | API key restricted to specific domains |
| 403 | INVALID_SIGNATURE | Request signature verification failed |
| 403 | FORBIDDEN | Request blocked (e.g., restricted key usage) |
| 403 | ACCOUNT_SUSPENDED | Account has been suspended |
| 429 | RATE_LIMITED | Too many requests |
| 429 | QUOTA_EXCEEDED | Points quota exhausted (includes Retry-After header) |
| 400 | INVALID_TYPE | Unknown chart type |
| 400 | INVALID_DATA | Malformed data |
| 404 | NOT_FOUND | Resource not found |
| 500 | INTERNAL_ERROR | Internal server error |
| 503 | SERVICE_UNAVAILABLE | Chart generation service down |
Rate Limiting
All API keys are subject to rate limits. Each API key can send up to 60 requests per 60 seconds. If you exceed the limit, you will receive a 429 RATE_LIMITED error.
Points
1 point = 1 data point. For example, a chart with 10 values consumes 10 points.
Beta gives 7,000 points per day, renewed at 00:00 Cairo time. Free gives 2,500 points per month, renewed on the 1st at 00:00 Cairo time. If a Beta account uses up its daily points, requests continue on the Free monthly points. When both are used up, requests are rejected with 429 QUOTA_EXCEEDED and a Retry-After header.