# Data retention settings

> Configure how long EmailConnect stores your email metadata and logs

Source: https://emailconnect.eu/help/data-retention/

EmailConnect provides flexible data retention controls to help you balance data availability with privacy requirements and storage costs. Configure these settings in [retention settings](https://app.emailconnect.eu/settings/retention).

## Understanding data retention

Data retention determines how long EmailConnect stores:
- Processed email metadata
- Webhook delivery logs
- Failed webhook attempts
- Email processing history

## Why data retention matters

### Privacy compliance
- Meet GDPR requirements for data minimization
- Automatically delete old customer data
- Reduce liability from storing unnecessary information

### Storage optimization
- Lower storage costs by removing old data
- Improve query performance on active data
- Keep your account lean and efficient

### Business requirements
- Maintain audit trails for the required period
- Balance debugging needs with privacy
- Comply with industry-specific regulations

## Configuring retention settings

### Access retention settings
1. Navigate to Settings (`/settings`)
2. Click on the "Retention" tab
3. Choose your retention period
4. Save changes

### Available retention periods

**Free and Maker plans:**
- 1 hour default

**Business plan:**
- 24 hours default
- Configurable up to 30 days

**Platform plan:**
- 24 hours default
- Configurable up to 365 days
- Automated export options before deletion

## What gets retained

### Email metadata
- Subject and recipient
- Processing timestamp
- Size and attachment count
- Delivery status

### Webhook logs
- Delivery attempts and timestamps
- HTTP response codes
- Response times
- Retry attempts

### Email content

**We do store the parsed email** — the text body, the HTML body, and any attachments small enough to be delivered inline — for the length of your retention window, and no longer. Larger attachments are stored as files, in our EU bucket or in your own if you've configured one.

We're explicit about this because it's the thing people most need to know, and because the honest answer is better than it sounds:

- **On Free and Maker the window is one hour, full stop** — it's the maximum, not just the default. An email that arrives at 09:00 is gone by 10:00, and there is nothing left to subpoena, leak, or breach. **Business and Platform default to 24 hours** and let you set your own (up to 30 days and 365 days respectively) — so the longer window is a choice you make, not one we impose.
- **On Business and Platform you can delete it the moment you're done with it.** Process the webhook, extract what you need, then call `DELETE /api/v1/emails/{messageId}` with an API key carrying the `emails:delete` scope. That shrinks the window from hours to seconds, under your control rather than ours — it is the same lever as custom retention, just applied per-email.
- **Platform plans can switch it off entirely.** In [data residency mode](https://emailconnect.eu/help/data-residency-mode/), the message **body and attachments are never written to our database** — the email passes straight through to your endpoint. We keep routing metadata: the message ID, timestamps, delivery status, the recipient, and the **subject line**. The sender address is masked. So "metadata only" is exactly right, and the subject is part of that metadata — if your subjects themselves carry sensitive data, that is the one thing to know before you rely on this.

The reason we store it at all is that it's what makes the product debuggable: it's how the logs show you what actually arrived, and how [replay](https://emailconnect.eu/help/webhook-configuration/) can re-send a delivery your endpoint missed. Once retention expires, both of those stop working for that email — which is the trade, and it's yours to make.

**Our backups do not contain message content.** They hold your account, domains, aliases and settings; stored emails and their attachments are left out. So if our server were lost, your configuration would be restored, but messages still inside their retention window could not be restored or replayed.

### What we never store
- The raw message after parsing — it's read, converted to JSON, and discarded
- Anything at all, once your retention window has passed

## Retention lifecycle

### Day 0: Email received
- Email processed and webhook triggered
- Metadata stored in database
- Delivery logged

### During retention period
- Full access to logs and history
- Debugging information available
- Retry options for failed webhooks

### After retention period
- Data automatically deleted
- No manual intervention needed
- Deletion is permanent and irreversible


## Changing retention settings

A new setting applies to every email you have stored, not only to new ones. Every few minutes we check each stored email's age against your **current** retention window, and delete it once it is older than that window.

> **Shortening retention deletes older mail within minutes.** If you change from 7 days to 24 hours, every email older than 24 hours is deleted on the next check, usually within about 5 minutes. The same happens when a plan downgrade lowers your window. Deletion is permanent, so save anything you still need before you shorten it.

- **Extending retention** keeps the emails you still have for longer, because they are measured against the new, longer window. Emails that were already deleted do not come back.
- **The shortest window is 10 minutes.** Retention can be set in fractions of an hour on plans that allow a custom window.

## Compliance considerations

### GDPR compliance
- Set shortest practical retention period
- Document your retention policy
- Ensure automatic deletion works

### Industry regulations
- Financial services: May require longer retention
- Healthcare: Check HIPAA requirements
- E-commerce: Consider payment dispute periods

### Data subject requests
- Retention settings don't override deletion requests
- Manual deletion available via API
- Contact support for bulk deletions

## Monitoring data usage

Your current retention setting is shown in **Settings → Retention**, and the emails still inside your window are visible in your logs — once an email leaves the logs, it has been deleted.

### Programmatic deletion

**Business and Platform plans** can programmatically delete emails via the API once they've been processed. This further reduces your data exposure window — process the email, extract what you need, then immediately delete the stored copy. It belongs to the same family as custom retention, which is why it starts at the same tier.

The call is `DELETE /api/v1/emails/{messageId}`, and the API key must carry the `emails:delete` scope. For `{messageId}`, pass the `webhook-id` header of the delivery (`msg_…`); the email's own Message-ID is accepted as well. See [API keys & integrations](https://emailconnect.eu/help/api-keys-integrations/) for authentication details.

## Faq

### Can I recover deleted data?
No, deletion is permanent. Plan retention accordingly.

### Does retention affect webhook delivery?
Not the first delivery: it is made immediately, whatever your retention. It does limit retries. A retry that would fall after your retention window ends is not made, so a one-hour window gets up to 4 of the 7 attempts. See [Retry policy](https://emailconnect.eu/help/email-processing/#retry-policy).

### Can I export data before deletion?
Yes, use the API to export data. Platform plans have automated export options.

### How precise is deletion timing?
The deletion job runs **every 5 minutes**, so data is removed within about 5 minutes of your retention window expiring — not at the exact second, but never long after. If you set a very short window, such as 10 minutes, allow for that margin: the data can exist for up to about 15 minutes.

Configure your retention settings thoughtfully to balance business needs, compliance requirements, and cost optimization.
