Skip to Content
Platform & ComplianceData Retention & Erasure

Data Retention & Erasure

Messages and attachments contain personal data. Each organization controls how long msend retains it and can erase individual contacts on demand.

Retention Period & Nightly Purge

  • Setting retention: Owners set Keep data for (days) in organization settings (minimum 7 days; empty keeps everything, which is the default).
  • Self-hosted default: Set DEFAULT_RETENTION_DAYS to apply a default retention window to newly created organizations.
  • Nightly Purge: Retention::PurgeJob runs at 3:00 AM via Solid Queue and deletes data in batches of up to 1,000 rows within RETENTION_BUDGET_SECONDS (default 300), in this order:
    1. Raw webhook payloads (inbound_events)
    2. Messages, delivery events, and Active Storage attachments
    3. Agent events and webhook deliveries (never sooner than 7 days, so polling agents can catch up)
    4. Conversations with no remaining messages that have been quiet longer than the retention period
    5. Orphaned identities and contacts

Logs record row counts per table—never message content or PII.

Contact Erasure on Request

Trigger erasure for a contact via API or CLI:

# API (returns 202 Accepted and runs in the background) curl -X DELETE https://app.msend.dev/api/v1/contacts/con_xxx \ -H "Authorization: Bearer msk_xxx" # Self-hosted / Rails CLI bin/rails "msend:erase_contact[con_xxx]"

Erasure deletes the contact’s identities, participant rows, messages they sent (with files), raw payloads and agent events mentioning them, and their direct conversations in full (including the agent’s replies). In group conversations, other participants’ messages and the agent’s messages remain.

  • When an identity is removed by purge or erasure, its consent record is reduced to a keyed hash of the address—preserving opt-out enforcement if that address writes again without retaining the raw PII.
  • Each erasure writes an erasure_log entry recording the contact’s public ID, per-table deletion counts, trigger source, and timestamp—with no personal data.
Last updated on