API reference
Compliance / PIPEDA
Privacy compliance and right to erasure.
post
/v1/compliance/erasureRight to erasure: delete all personal data for a phone number
Permission
compliance:dComplies with PIPEDA and Quebec Law 25 right to erasure. Scrubs message bodies and event payloads for the number, and deletes its consent records, verifications, contacts, and webhook dead letters. Deletes its contact-list entries too, except on a DENY list: that entry is kept so the number stays blocked. Opt-out records are kept: CASL requires proof an opt-out was honoured, so this call never deletes one.
Requires compliance:d.
Parameters
| Parameter | Type | Description |
|---|---|---|
X-Step-Up-Tokenheader | string | A token from POST /v1/auth/step-up with the compliance:d scope. Needed when the calling key holds compliance:m but not compliance:d (e.g. the dashboard session key). |
Request body
| Field | Type | Description |
|---|---|---|
phone_numberrequired | string | |
reason | string | Reason for erasure request (for audit log)
|
Responses
200Erased. Opt-out records are kept.
Field Type Description statusrequiredstring - One of: erased
phone_numberrequiredstring erased_atrequiredstring - Format: date-time
opt_outs_preservedrequiredboolean - One of: true
- 401Missing, invalid, revoked or expired API key.The standard error body.
- 402The account has no balance, or a LIVE key was used before the first top-up.The standard error body.
- 403FORBIDDEN (the key lacks compliance:d and sent no compliance:d step-up token) or LIVE_KEY_REQUIRED (test keys cannot erase).The standard error body.
- 422INVALID_PHONE_NUMBER, CANNOT_ERASE_OWN_NUMBER or VALIDATION_ERROR.The standard error body.
- 429Rate limit reached: 100 requests per second per account, or a route-specific limit (Retry-After set where one applies).The standard error body.
- 500Unexpected server error.The standard error body.
Example
cURL
curl -X POST https://api.honkio.ca/v1/compliance/erasure \
-H "Authorization: Bearer mk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+1613XXXXXXX"
}'
HonkIO