Storage Sink Delivery
Storage sink delivery writes events to object storage instead of sending HTTP requests. Use this when you need to archive events, feed a data pipeline, or batch-process webhooks asynchronously.
Supported providers
Section titled “Supported providers”| Provider | Config key | Description |
|---|---|---|
| Amazon S3 | s3 | Native S3 support |
| S3-compatible | s3 | MinIO, LocalStack, DigitalOcean Spaces, Backblaze B2, etc. |
| Local filesystem | local | Writes NDJSON files to a local directory — useful for self-hosted runs and dev. |
Create a storage sink endpoint
Section titled “Create a storage sink endpoint”Set deliveryMode to storage when creating an endpoint:
curl -X POST https://app.mittr.io/api/v1/endpoints \ -H "X-API-Key: mtr_your_key" \ -H "Content-Type: application/json" \ -d '{ "url": "s3://my-webhook-archive/events/", "deliveryMode": "storage", "eventTypes": ["order.*"], "storageConfig": { "provider": "s3", "bucket": "my-webhook-archive", "prefix": "events/", "region": "us-east-1", "accessKeyId": "AKIA...", "secretAccessKey": "...", "batchSize": 100, "flushIntervalSeconds": 60 } }'Configuration
Section titled “Configuration”S3 / S3-compatible
Section titled “S3 / S3-compatible”| Field | Required | Description |
|---|---|---|
provider | Yes | s3 |
bucket | Yes | Bucket name |
prefix | No | Object key prefix (e.g., events/production/) |
region | Yes | AWS region (e.g., us-east-1) |
accessKeyId | Yes | AWS access key |
secretAccessKey | Yes | AWS secret key |
endpoint | No | Custom endpoint URL for S3-compatible stores |
batchSize | No | Events per file (default: 100) |
flushIntervalSeconds | No | Max seconds between writes (default: 60) |
Object format
Section titled “Object format”Events are written as newline-delimited JSON (NDJSON). Each line is a complete event:
{"id":"evt_abc","eventType":"order.created","payload":{"orderId":"ord_123"},"createdAt":"2026-04-14T10:30:00Z"}{"id":"evt_def","eventType":"order.updated","payload":{"orderId":"ord_123","status":"shipped"},"createdAt":"2026-04-14T10:31:00Z"}Object key pattern
Section titled “Object key pattern”Objects are named with the flush timestamp and a batch counter:
{prefix}{date}/{timestamp}-{batch}.ndjsonExample: events/production/2026-04-14/1713091800-001.ndjson
Batching behavior
Section titled “Batching behavior”Mittr batches events before writing to reduce API calls:
- Events accumulate in memory up to
batchSize - A flush occurs when either:
- The batch reaches
batchSizeevents flushIntervalSecondshas elapsed since the last flush
- The batch reaches
- Each flush writes one object to storage
S3-compatible example (MinIO)
Section titled “S3-compatible example (MinIO)”curl -X POST https://app.mittr.io/api/v1/endpoints \ -H "X-API-Key: mtr_your_key" \ -H "Content-Type: application/json" \ -d '{ "url": "s3://local-archive/webhooks/", "deliveryMode": "storage", "eventTypes": ["*"], "storageConfig": { "provider": "s3", "bucket": "local-archive", "prefix": "webhooks/", "region": "us-east-1", "endpoint": "http://minio:9000", "accessKeyId": "minioadmin", "secretAccessKey": "minioadmin", "batchSize": 50, "flushIntervalSeconds": 30 } }'Security
Section titled “Security”Storage credentials are encrypted at rest in the database. They are never returned in API responses; only a masked indicator shows whether credentials are configured.