API Overview
RESTful API
Standard HTTP methods (GET, POST, PUT, DELETE) with JSON request and response bodies
API Key Authentication
Secure API key authentication with role-based permissions and rate limiting
Real-time Webhooks
Real-time notifications for compliance events, DSR status changes, and risk updates
Base URLs
https://api.privabase.com/v1https://sandbox-api.privabase.com/v1Quick Start Guide
Get API Key
Generate an API key in your dashboard settings
Choose Environment
Use sandbox for testing or production for live data
Make First Request
Test authentication with a simple GET request
Handle Responses
Process JSON responses and handle errors properly
Authentication Example
curl -X GET "https://api.privabase.com/v1/account" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json"
Expected Response:
{
"id": "acc_123456789",
"name": "Your Company",
"plan": "professional",
"status": "active"
}API Categories
Data Mapping
Discover and map personal data across your systems
GET /api/v1/data-sourcesPOST /api/v1/data-discoveryGET /api/v1/data-mapConsent Management
Manage consent records and preferences
POST /api/v1/consentGET /api/v1/consent/recordsDELETE /api/v1/consentData Subject Requests
Process access, deletion, and portability requests
POST /api/v1/dsrGET /api/v1/dsr/statusPUT /api/v1/dsr/responseRisk Assessment
Create and manage privacy risk assessments
POST /api/v1/risk-assessmentsGET /api/v1/risksPUT /api/v1/risks/{id}Compliance Monitoring
Monitor compliance status and generate reports
GET /api/v1/compliance/statusGET /api/v1/reportsPOST /api/v1/auditsWebhooks
Real-time notifications for compliance events
POST /api/v1/webhooksGET /api/v1/webhooksPUT /api/v1/webhooks/{id}Common API Examples
Submit a Data Subject Request
Create a new DSR for access, deletion, or portability requests.
POST /api/v1/dsr
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
{
"type": "access",
"subject_email": "user@example.com",
"subject_name": "John Doe",
"description": "Request for data access",
"due_date": "2026-03-18T00:00:00Z"
}{
"id": "dsr_123456789",
"status": "pending",
"type": "access",
"subject_email": "user@example.com",
"created_at": "2026-02-16T12:00:00Z",
"due_date": "2026-03-18T00:00:00Z",
"estimated_completion": "2026-02-25T12:00:00Z"
}Record User Consent
Store consent records for GDPR and CCPA compliance.
POST /api/v1/consent
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
{
"user_id": "user_123456789",
"consent_types": [
"marketing",
"analytics",
"essential"
],
"granted": true,
"timestamp": "2026-02-16T12:00:00Z",
"ip_address": "192.168.1.100",
"user_agent": "Mozilla/5.0..."
}{
"id": "consent_123456789",
"user_id": "user_123456789",
"status": "recorded",
"consent_types": [
"marketing",
"analytics",
"essential"
],
"granted": true,
"recorded_at": "2026-02-16T12:00:00Z"
}Check Compliance Status
Get real-time compliance scores and framework status.
GET /api/v1/compliance/status Authorization: Bearer YOUR_API_KEY
{
"overall_score": 92,
"frameworks": {
"gdpr": {
"score": 94,
"status": "compliant",
"last_assessment": "2026-02-15T10:00:00Z"
},
"ccpa": {
"score": 89,
"status": "mostly_compliant",
"last_assessment": "2026-02-15T10:00:00Z"
}
},
"active_dsrs": 3,
"risk_level": "low"
}Rate Limits
Rate limit information is included in response headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
Error Responses
SDKs and Libraries
JavaScript/Node.js
Official SDK for JavaScript and Node.js applications
npm install @privabase/js-sdkDocumentation
Need Help with Integration?
Our developer support team is here to help you integrate PrivaBase APIs into your applications. Get technical support, code examples, and integration guidance.