Send Segment and RudderStack events to your own bucket
Segment and RudderStack can forward every event they collect to a webhook. Point that webhook at Send2Bucket and each track, page, identify and other call lands as a JSON line in a bucket or table you own, within a minute, next to your other events. To compare this with Segment's own S3 destination, see Segment S3 destination alternatives.
We sent single events and JSON-array batches shaped like Segment and RudderStack events, with the Authorization header each destination sets, to a local Send2Bucket node writing to S3-compatible storage, and ran the check request and the DuckDB queries (DuckDB 2.0) on the objects it wrote. The Segment and RudderStack settings follow their docs, linked in each section, and were not run against those services.
How it works
Segment Webhooks (Actions) ──JSON, one event or an array──▶ /v1/events/json ─┐
RudderStack Webhook ──JSON, one event──────────────▶ /v1/events/json ─┴─▶ your stream's destination
- Each event becomes one line with
signallog, kept as sent:type,event,properties,traits,userId,anonymousId,messageId,timestamp,contextand the rest. Delivery format describes the line. - A
200means the events are stored durably and will be delivered at least once. See Delivery semantics. - Both destinations set custom headers, so the API key goes in
Authorization.
1. Create a stream and a key
Create an ingestion stream in the dashboard, add a destination, and copy the stream's API key and ID. A key for one stream needs no stream ID.
2. Add the destination
Segment
Add the Webhooks (Actions) destination to a source, then a Send mapping for the events to keep:
- URL:
https://api.send2bucket.com/v1/events/json - Method:
POST - Headers:
Authorizationset toBearer <key>, andS2b-Streamset to<stream_id>unless the key writes to one stream. - Data: the whole event, which is the default.
- Enable Batching: optional. Send2Bucket takes a JSON array of events as one request, up to 8 MiB.
RudderStack
Add a Webhook destination to a source:
- Webhook URL:
https://api.send2bucket.com/v1/events/json - URL Method:
POST - Headers:
Authorizationwith the valueBearer <key>, andS2b-Streamwith<stream_id>unless the key writes to one stream.
The Webhook destination sends each event as RudderStack received it. The HTTP Webhook destination also works: choose the JSON body format and Bearer Token authentication with the key.
3. Check the endpoint
Before events flow, check the key and stream with one track call. It stores one record, and the answer is a 200 with an empty body:
curl -i https://api.send2bucket.com/v1/events/json \
-H "Authorization: Bearer $S2B_API_KEY" \
-H "S2b-Stream: <stream_id>" \
-H "Content-Type: application/json" \
--data-binary '{"type":"track","event":"Check","messageId":"check-1","anonymousId":"a-1","timestamp":"2026-11-25T10:00:00Z","properties":{}}'
A 401 means the key is wrong or revoked; a 403 or 400 names the stream problem; a 409 means the stream has no destination. The API reference lists every error.
4. Query the events
DuckDB reads the objects in place. This view keeps the events:
INSTALL httpfs; LOAD httpfs;
CREATE SECRET s2b (TYPE s3, PROVIDER credential_chain, REGION '<region>');
CREATE VIEW cdp AS
SELECT * FROM read_json(
's3://<bucket>/<prefix>/s2b/stream=*/date=*/hour=*/*.ndjson.gz',
format = 'newline_delimited',
hive_partitioning = true,
columns = {v: 'INTEGER', delivery_batch_id: 'VARCHAR', batch_id: 'VARCHAR',
received_at: 'TIMESTAMPTZ', signal: 'VARCHAR',
resource: 'JSON', scope: 'JSON', data: 'JSON'})
WHERE signal = 'log';
Calls per type and track event name, each messageId once, since a retried event arrives again:
SELECT data->>'$.type' AS type, data->>'$.event' AS event,
count(DISTINCT data->>'$.messageId') AS calls
FROM cdp
GROUP BY ALL
ORDER BY calls DESC;
Daily users and revenue from Order Completed, in the spec's properties.revenue:
SELECT (data->>'$.timestamp')::TIMESTAMPTZ::DATE AS day,
count(DISTINCT coalesce(data->>'$.userId', data->>'$.anonymousId')) AS users,
sum((data->>'$.properties.revenue')::DOUBLE) AS revenue
FROM (SELECT DISTINCT ON (data->>'$.messageId') data FROM cdp
WHERE data->>'$.type' = 'track' AND data->>'$.event' = 'Order Completed')
GROUP BY ALL
ORDER BY day DESC;
The latest traits of each user, from identify calls:
SELECT DISTINCT ON (data->>'$.userId')
data->>'$.userId' AS user_id, data->'$.traits' AS traits, data->>'$.timestamp' AS seen_at
FROM cdp
WHERE data->>'$.type' = 'identify'
ORDER BY user_id, seen_at DESC;
In an Iceberg or DuckLake table, the same line is in the payload column with signal_type log; see Table columns.
Notes
- Duplicates: both CDPs retry failed deliveries, and Send2Bucket stores each attempt.
messageIdidentifies an event. - Billing: each event's JSON as stored is the number billed. See Plans and billing.
- Other webhooks: Stripe, GitHub and Shopify deliveries land the same way. See Webhooks to S3.
- From your own servers: to send events without a CDP, post them to
/v1/eventsdirectly.