Data Retention
Zavu implements configurable data retention policies to help you manage storage and comply with data protection regulations like GDPR.
Default Retention Period
| Data Type | Default Retention | Maximum Retention |
|---|
| Messages | 90 days | 180 days |
| Conversations | 90 days | 180 days |
| Webhook Deliveries | 90 days | 180 days |
| Agent Executions | 90 days | 180 days |
| Activities | 90 days | 180 days |
Data retention is applied retroactively. When you reduce the retention period, existing data older than the new limit will be automatically deleted within 24 hours.
Configuring Retention
You can configure the retention period for your project through the Dashboard or via the API.
Dashboard
- Navigate to Infrastructure > Data Retention in the sidebar
- Use the slider to set your desired retention period (90-180 days)
- Review the estimated impact on your existing data
- Click Save Changes and confirm
What’s NOT Affected
The following data types are excluded from retention policies due to legal requirements:
- Billing transactions - Required for financial records (7 years)
- MAU charges - Required for billing reconciliation
- API Keys - Not subject to automatic deletion
- Contacts - Customer data managed separately
Data Exports
Before data is deleted, you can export it for your records. Exports are available in JSON format.
Creating an Export
import Zavudev from '@zavudev/sdk';
const zavu = new Zavudev();
// Create an export request
const { export: exportJob } = await zavu.exports.create({
dataTypes: ['messages', 'conversations'],
dateFrom: '2024-01-01T00:00:00Z',
dateTo: '2024-06-30T23:59:59Z',
});
console.log('Export ID:', exportJob.id);
console.log('Status:', exportJob.status); // 'pending' initially
Checking Export Status
Exports are processed asynchronously. Poll the export endpoint to check when it’s ready:
// Check export status
const { export: exportJob } = await zavu.exports.retrieve('exp_abc123');
if (exportJob.status === 'completed') {
console.log('Download URL:', exportJob.downloadUrl);
console.log('File size:', exportJob.fileSize, 'bytes');
}
Export Status Values
| Status | Description |
|---|
pending | Export request received, queued for processing |
processing | Export is being generated |
completed | Export ready, download URL available |
failed | Export failed, check errorMessage for details |
Export download links expire after 24 hours. Make sure to download your export before it expires.
Available Data Types
When creating an export, you can include any combination of these data types:
| Data Type | Description |
|---|
messages | All sent and received messages |
conversations | Conversation threads with contacts |
webhookDeliveries | Webhook delivery attempts and responses |
agentExecutions | AI agent execution logs and responses |
activities | Activity logs for your project |
Exports are provided as JSON files with the following structure:
{
"messages": [
{
"_id": "abc123",
"to": "+14155551234",
"from": "+15551234567",
"channel": "sms",
"messageType": "text",
"text": "Hello!",
"status": "delivered",
"createdAt": 1704067200000
}
],
"conversations": [
{
"_id": "conv123",
"contactPhone": "+14155551234",
"lastMessageAt": 1704067200000
}
]
}
GDPR Compliance
Zavu’s data retention features help you comply with GDPR requirements:
- Right to erasure: Data is automatically deleted after the retention period
- Data portability: Export your data at any time in a machine-readable format
- Storage limitation: Configure retention periods appropriate for your use case
- Transparency: View exactly how much data will be affected before changing settings
For complete data deletion requests from specific users, contact our support team.
Best Practices
- Export before reducing retention: Always export your data before reducing the retention period
- Regular backups: Set up periodic exports of your important data
- Monitor expiration: Track when your exports will expire and download them promptly
- Test exports: Verify your export files can be opened and read correctly