Skip to main content

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 TypeDefault RetentionMaximum Retention
Messages90 days180 days
Conversations90 days180 days
Webhook Deliveries90 days180 days
Agent Executions90 days180 days
Activities90 days180 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

  1. Navigate to Infrastructure > Data Retention in the sidebar
  2. Use the slider to set your desired retention period (90-180 days)
  3. Review the estimated impact on your existing data
  4. 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

StatusDescription
pendingExport request received, queued for processing
processingExport is being generated
completedExport ready, download URL available
failedExport 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 TypeDescription
messagesAll sent and received messages
conversationsConversation threads with contacts
webhookDeliveriesWebhook delivery attempts and responses
agentExecutionsAI agent execution logs and responses
activitiesActivity logs for your project

Export Format

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

  1. Export before reducing retention: Always export your data before reducing the retention period
  2. Regular backups: Set up periodic exports of your important data
  3. Monitor expiration: Track when your exports will expire and download them promptly
  4. Test exports: Verify your export files can be opened and read correctly