API Reference
Powerful REST API to manage consent programmatically
Secure by Default
All API requests require authentication via API keys
Lightning Fast
Global CDN with <50ms response times worldwide
RESTful Design
Standard HTTP methods and JSON responses
Base URL
https://api.snapconsent.com/v1
Authentication
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Get your API key from the dashboard settings.
Endpoints
Consent Records
Manage visitor consent records
GET
/consents
List all consent records
GET
/consents/{id}
Get a specific consent record
POST
/consents
Create a new consent record
PUT
/consents/{id}
Update consent preferences
Sites
Manage your websites
GET
/sites
List all sites
POST
/sites
Create a new site
PUT
/sites/{id}/config
Update site configuration
Analytics
Access consent analytics data
GET
/analytics/summary
Get consent rate summary
GET
/analytics/trends
Get consent trends over time
Code Examples
cURL
curl -X GET \
https://api.snapconsent.com/v1/consents \
-H "Authorization: Bearer YOUR_API_KEY"
https://api.snapconsent.com/v1/consents \
-H "Authorization: Bearer YOUR_API_KEY"
JavaScript
const response = await fetch(
'https://api.snapconsent.com/v1/consents',
{ headers: {
'Authorization': 'Bearer YOUR_API_KEY'
} }
);
'https://api.snapconsent.com/v1/consents',
{ headers: {
'Authorization': 'Bearer YOUR_API_KEY'
} }
);
Rate Limits
Plan | Requests/Hour | Burst |
---|---|---|
Starter | 1,000 | 100/min |
Professional | 10,000 | 500/min |
Enterprise | Unlimited | Custom |