RESTful API: Complete documentation for developers
Bearer token authentication, JSON responses, 500 req/min rate limit. Every endpoint is documented in detail with cURL, JavaScript and PHP examples.
Base URL and Authentication
All API calls are made over HTTPS via the base URL below. HTTP requests are redirected to HTTPS with a 301 redirect.
Base URL
https://cerez.io/api/v1
Authentication: Bearer Token
Send your API key in the Authorization header with the Bearer prefix. You can obtain your API key from the Admin panel > Installation page.
curl https://cerez.io/api/v1/banner/YOUR_API_KEY \ -H "Authorization: Bearer YOUR_SECRET_KEY" \ -H "Content-Type: application/json"
/api/v1/banner/{api_key}
Returns the active banner configuration for a domain. The SDK calls this endpoint on every page load; the response is cached server-side for 5 minutes.
Path Parameter
Query Parameters (optional)
Example Request
curl https://cerez.io/api/v1/banner/pk_live_abc123 \ -H "Authorization: Bearer sk_live_xyz789"
Successful Response 200 OK
{ "success": true, "data": { "domain": "example.com", "position": "bottom", "theme": "modern", "language": "tr", "texts": { "title": "Çerez Tercihleriniz", "description": "Sitemiz deneyiminizi iyileştirmek için çerez kullanır...", "accept_all": "Tümünü Kabul Et", "reject_all": "Tümünü Reddet" }, "categories": [ { "id": "necessary", "required": true }, { "id": "analytics", "required": false }, { "id": "marketing", "required": false } ], "consent_expiry_days": 180, "products": { "cookie": true, "accessibility": false } } }
/api/v1/consent/log
Records the user's consent decision on the server. The record is retained for 90 days to meet the KVKK and GDPR burden of proof.
Body Parameters (JSON)
Example Request
curl -X POST https://cerez.io/api/v1/consent/log \ -H "Authorization: Bearer sk_live_xyz789" \ -H "Content-Type: application/json" \ -d '{ "api_key": "pk_live_abc123", "session_id": "sess_a1b2c3d4", "categories": { "necessary": true, "analytics": true, "marketing": false }, "action": "custom", "page_url": "https://example.com/products/123" }'
Response 201 Created
{ "success": true, "consent_id": "<string consent ID>", "timestamp": "2026-05-31T14:23:11+03:00", "expires_at": "2026-11-27T14:23:11+03:00" }
/api/v1/heartbeat
Increments the pageview counter and marks the domain as active. The SDK calls this endpoint once per page load.
Body Parameters
Response
{ "success": true, "pageview_count_month": 42183, "plan_limit": 100000, "usage_percent": 42.18 }
Request Limits
Applied per IP address. When the limit is exceeded, the response includes a header indicating the wait time.
Retry-After header specifies the wait time in seconds. Exponential backoff (1s, 2s, 4s, 8s...) is recommended for burst protection. For a custom rate limit increase on the Enterprise plan, contact the sales team.
HTTP Status Codes
Error Response Format
{ "success": false, "error": { "code": "INVALID_API_KEY", "message": "API key bulunamadı veya devre dışı", "details": { "field": "api_key" } } }
Event Notifications Q4 2026
Webhook support is on the Q4 2026 roadmap; it is not available yet. The following events are planned. Get in touch for announcements.
consent.given
Triggered when the user gives consent
consent.rejected
Triggered when the user declines
consent.updated
Triggered when preferences are changed
scan.completed
Triggered when a cookie scan completes
scan.failed
Triggered when a scan fails
subscription.expired
Triggered when a subscription ends
pageview.limit_warning
Triggered when pageview usage crosses the 80 percent threshold
a11y.profile_used
Triggered when an accessibility profile is used
The questions on your mind
What is the difference between the SDK and the API?
Is there a batch endpoint?
How does the IP whitelist work?
When will webhooks be available?
What happens if the rate limit is exceeded?
Retry-After header indicates how many seconds you need to wait. Exponential backoff (1s, 2s, 4s, 8s...) is recommended for burst protection. The rate limit can be raised on the Enterprise plan.Want to test the API?
Get your API key with a 14-day free Pro trial, copy the code and start integrating right away.