API reference

Compliance / PIPEDA

Privacy compliance and right to erasure.

post/v1/compliance/erasure

Right to erasure: delete all personal data for a phone number

Permissioncompliance:d

Complies 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

ParameterTypeDescription
X-Step-Up-Tokenheaderstring

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

FieldTypeDescription
phone_numberrequiredstring
reasonstring

Reason for erasure request (for audit log)

  • At most 1000 characters

Responses

  • 200Erased. Opt-out records are kept.
    FieldTypeDescription
    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"
  }'