API Reference
Complete API documentation for programmatic access to PrivacyPact
Base URL
https://www.privacy-pact.com/api/v1Authentication
All API endpoints (except /verify) require authentication using an API key. Include your API key in the X-API-Key header.
curl -H "X-API-Key: pk_live_your_api_key_here" \
https://www.privacy-pact.com/api/v1/consentRate Limits
Rate limits are applied per API key to prevent abuse. Rate limit information is included in response headers:
X-RateLimit-Limit- Maximum requests allowedX-RateLimit-Remaining- Requests remaining in windowX-RateLimit-Reset- Unix timestamp when limit resets
Note: Rate limits vary by endpoint. Check the interactive API docs at /api/docs for specific limits.
Endpoints
/api/v1/consentRecord cookie consent from a user. Automatically detects jurisdiction and applies appropriate compliance rules.
{
"visitorId": "visitor_123",
"categories": ["essential", "analytics"],
"consented": true
}/api/v1/requestsSubmit a privacy request (access, deletion, correction, portability, opt-out). Requires email verification.
{
"type": "access",
"email": "user@example.com",
"firstName": "John",
"lastName": "Doe"
}/api/v1/verifyVerify a privacy request using the token sent via email. No API key required.
{
"email": "user@example.com",
"token": "verification_token_from_email"
}/api/v1/opt-outsRecord an opt-out request for CCPA and state privacy laws. Automatically detects applicable laws.
{
"visitorId": "visitor_123",
"email": "user@example.com"
}/api/v1/geoDetect user location and applicable privacy laws. Returns state code, country code, and jurisdiction information.
GET /api/v1/geo
Headers: X-API-Key: pk_live_your_api_key_hereResponse Format
All API responses follow a consistent structure:
Success Response
{
"success": true,
"data": {
// Response data
},
"meta": {
"requestId": "req_1234567890_abcdef",
"timestamp": "2025-01-29T12:00:00.000Z"
}
}Error Response
{
"success": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid or missing API key",
"details": {}
},
"meta": {
"requestId": "req_1234567890_abcdef",
"timestamp": "2025-01-29T12:00:00.000Z"
}
}Interactive API Documentation
Try out the API endpoints directly in your browser with our interactive Swagger documentation.
Open API Docs