Base URL
All API endpoints are served under:
https://cspwarden.com/api/v1/Authentication
API Key Authentication
All API requests must include a valid API key in the Authorization header. API access is available exclusively on Business and Enterprise plans.
Include your API key in every request:
curl -H "Authorization: Api-Key YOUR_API_KEY" \
https://cspwarden.com/api/v1/domains/Or in your application code:
import requests
headers = {
"Authorization": "Api-Key cspw_live_a1b2c3d4e5f6..."
}
response = requests.get(
"https://cspwarden.com/api/v1/domains/",
headers=headers
)
print(response.json())const response = await fetch("https://cspwarden.com/api/v1/domains/", {
headers: {
"Authorization": "Api-Key cspw_live_a1b2c3d4e5f6..."
}
});
const data = await response.json();API Keys
CSP Warden supports two types of API keys, both disabled by default and available only on Business and Enterprise plans.
Global API Key
Grants access to all domains and resources in your account. Suitable for backend integrations and automation across your entire account.
Domain API Key
Scoped to a single domain. Can only access violations, policies, and settings for that specific domain. Ideal for per-site integrations.
Disabled by default
API key generation is disabled globally and per-domain by default. You must explicitly enable API access in your account settings before generating keys. Domain API keys must also be individually enabled per domain.
Generating API Keys
- Navigate to Settings → API Access in your dashboard.
- Enable global API access for your account.
- Click Generate API Key to create a global key.
- For domain-scoped keys, go to the specific domain's settings and enable API access there, then generate a domain key.
Keep your API keys secret
API keys carry the same privileges as the scope they are assigned to. Do not expose them in client-side code, public repositories, or logs. Rotate keys immediately if compromised.
Rate Limits
API requests are rate-limited per key. Current limits by plan:
| Plan | Requests / minute | Requests / day |
|---|---|---|
| Business | 60 | 10,000 |
| Enterprise | 120 | 50,000 |
Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.
Error Responses
The API returns standard HTTP status codes and JSON error bodies:
{
"detail": "Authentication credentials were not provided."
}| Code | Meaning |
|---|---|
| 400 | Bad Request - invalid parameters |
| 401 | Unauthorised - missing or invalid API key |
| 403 | Forbidden - insufficient permissions |
| 404 | Not Found - resource does not exist |
| 429 | Too Many Requests - rate limit exceeded |
| 500 | Internal Server Error |
Pagination
List endpoints return paginated results. Pass page as a query parameter. Each page returns up to 50 items by default.
{
"count": 142,
"next": "https://cspwarden.com/api/v1/violations/?page=2",
"previous": null,
"results": [ ... ]
}Endpoint Reference
Domains
Manage the domains you monitor with CSP Warden. Add, update, delete domains and verify custom report domains.
Violations
Query and manage CSP violations. View violation details, update their status, and manage resolution workflow.