API Reference

Complete API documentation for programmatic access to PrivacyPact

Base URL

https://www.privacy-pact.com/api/v1

Authentication

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/consent

Rate Limits

Rate limits are applied per API key to prevent abuse. Rate limit information is included in response headers:

  • X-RateLimit-Limit - Maximum requests allowed
  • X-RateLimit-Remaining - Requests remaining in window
  • X-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

POST/api/v1/consent

Record cookie consent from a user. Automatically detects jurisdiction and applies appropriate compliance rules.

{
  "visitorId": "visitor_123",
  "categories": ["essential", "analytics"],
  "consented": true
}
View full documentation →
POST/api/v1/requests

Submit a privacy request (access, deletion, correction, portability, opt-out). Requires email verification.

{
  "type": "access",
  "email": "user@example.com",
  "firstName": "John",
  "lastName": "Doe"
}
View full documentation →
POST/api/v1/verify

Verify a privacy request using the token sent via email. No API key required.

{
  "email": "user@example.com",
  "token": "verification_token_from_email"
}
View full documentation →
POST/api/v1/opt-outs

Record an opt-out request for CCPA and state privacy laws. Automatically detects applicable laws.

{
  "visitorId": "visitor_123",
  "email": "user@example.com"
}
View full documentation →
GET/api/v1/geo

Detect 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_here
View full documentation →

Response 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

Next Steps