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
7days; empty keeps everything, which is the default). - Self-hosted default: Set
DEFAULT_RETENTION_DAYSto apply a default retention window to newly created organizations. - Nightly Purge:
Retention::PurgeJobruns at 3:00 AM via Solid Queue and deletes data in batches of up to 1,000 rows withinRETENTION_BUDGET_SECONDS(default300), in this order:- Raw webhook payloads (
inbound_events) - Messages, delivery events, and Active Storage attachments
- Agent events and webhook deliveries (never sooner than 7 days, so polling agents can catch up)
- Conversations with no remaining messages that have been quiet longer than the retention period
- Orphaned identities and contacts
- Raw webhook payloads (
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.
Consent Proof & Audit Log
- 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_logentry recording the contact’s public ID, per-table deletion counts, trigger source, and timestamp—with no personal data.
Last updated on