Appearance
DSAR API
Endpoints for GDPR-style data subject access (export) and right to erasure. They require an authenticated user (Authentication); the subject is identified by subject_identifier, with optional org_id to target a specific organization when permitted.
Base path: /api/pii
Replace YOUR_TOKEN with a Bearer token (API key or session-backed token). For local development, use http://localhost:8000 as the host.
Subject export
Exports data associated with a data subject by identifier (GDPR Article 15). For the interactive DSAR package flow, the backend also exposes POST /api/pii/dsar/export.
POST /api/pii/dsar/subject-exportRequest body
| Field | Type | Required | Description |
|---|---|---|---|
subject_identifier | string | Yes | Identifier for the data subject |
org_id | string | No | Organization scope; defaults from the authenticated user when omitted |
Example
bash
curl -X POST "https://api.ghostai.com/api/pii/dsar/subject-export" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"subject_identifier": "user-subject-123",
"org_id": "org_optional"
}'Erasure
Executes right-to-erasure for a data subject (GDPR Article 17). The operation is irreversible.
POST /api/pii/dsar/erasureRequest body
| Field | Type | Required | Description |
|---|---|---|---|
subject_identifier | string | Yes | Identifier for the data subject |
org_id | string | No | Organization scope; defaults from the authenticated user when omitted |
confirm | boolean | Yes | Must be true or the API returns 400 Bad Request |
Confirm requirement
If confirm is not exactly true, the server responds with 400 and a message that erasure requires confirm=true.
Example
bash
curl -X POST "https://api.ghostai.com/api/pii/dsar/erasure" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"subject_identifier": "user-subject-123",
"org_id": "org_optional",
"confirm": true
}'