Skip to content
mittr

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.

ProviderConfig keyDescription
Amazon S3s3Native S3 support
S3-compatibles3MinIO, LocalStack, DigitalOcean Spaces, Backblaze B2, etc.
Local filesystemlocalWrites NDJSON files to a local directory — useful for self-hosted runs and dev.

Set deliveryMode to storage when creating an endpoint:

Terminal window
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
}
}'
FieldRequiredDescription
providerYess3
bucketYesBucket name
prefixNoObject key prefix (e.g., events/production/)
regionYesAWS region (e.g., us-east-1)
accessKeyIdYesAWS access key
secretAccessKeyYesAWS secret key
endpointNoCustom endpoint URL for S3-compatible stores
batchSizeNoEvents per file (default: 100)
flushIntervalSecondsNoMax seconds between writes (default: 60)

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"}

Objects are named with the flush timestamp and a batch counter:

{prefix}{date}/{timestamp}-{batch}.ndjson

Example: events/production/2026-04-14/1713091800-001.ndjson

Mittr batches events before writing to reduce API calls:

  1. Events accumulate in memory up to batchSize
  2. A flush occurs when either:
    • The batch reaches batchSize events
    • flushIntervalSeconds has elapsed since the last flush
  3. Each flush writes one object to storage
Terminal window
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
}
}'

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.