Testing & compliance

Compliance

Manage your PDPC compliance profile, message retention period, and download an audit export — directly over the API.

MailAfrica is compliance-aware for Tanzania's Personal Data Protection Act. Each account carries a compliance profile controlling retention and consent, and can export an audit summary.

Read your profile

bash
curl https://api.mailafrica.online/api/compliance/profile \
  -H "X-API-Key: MAIL_<your_api_key_here>"
json
{
  "success": true,
  "data": {
    "id": 7,
    "user_id": 7,
    "pdpc_registered": false,
    "pdpc_certificate_number": null,
    "pdpc_registered_at": null,
    "default_retention_days": 30,
    "data_consent_at": null,
    "privacy_policy_version": null,
    "updated_at": "2026-08-15T00:00:00Z"
  }
}

A default profile (retention 30 days) is created automatically the first time you read it.

Update your profile

bash
curl -X PATCH https://api.mailafrica.online/api/compliance/profile \
  -H "X-API-Key: MAIL_<your_api_key_here>" \
  -H "Content-Type: application/json" \
  -d '{
    "pdpc_registered": true,
    "pdpc_certificate_number": "PDPC/2026/0123",
    "pdpc_registered_at": "2026-07-01",
    "default_retention_days": 90
  }'

default_retention_days sets how long new inbound messages are kept. Higher retention may mean more storage on your side too — export what you need promptly.

Audit export

bash
curl https://api.mailafrica.online/api/compliance/audit-export \
  -H "X-API-Key: MAIL_<your_api_key_here>"

Returns a summary for audits: PDPC registration details, retention days, your address count, message count, and the generation time. Only your own numbers — no cross-tenant data.