Skip to content
Menu

Integrations

Segment, RudderStack and webhooks

BetaMarkdown version

Send users and events to Herald from Segment, RudderStack or any tool that can post a signed webhook, with the mapping and signature for each.

Note

Built and tested against each vendor's documented API; tell us if anything differs in your account.

These integrations push users and events to a webhook URL. Herald translates each body and ingests it exactly like the server API (POST /api/v1/users and POST /api/v1/events).

What you'll need

  • An admin of the account. Integrations are set up in Settings → Integrations.
  • Segment: a Webhooks or Webhooks (Actions) destination you can edit.
  • RudderStack: a Webhook destination you can edit.
  • Signed webhook: a tool or script that can compute an HMAC-SHA256 signature.
  • Your own user id on every user and event, the same id your app passes to identify.

Connect

  1. In Settings → Integrations, pick the app, choose the provider and name it.
  2. Copy the webhook URL and the secret. The secret is shown once.
  3. Paste both into the sending tool, as below.
  4. Choose Send test to run a signed sample through the checks. It writes nothing.

The URL looks like https://app.runherald.com/api/v1/integrations/<provider>/<integrationId>.

Answers

AnswerWhen
200 with accepted, duplicates, skippedThe body was translated and ingested. accepted is users upserted plus new events.
401Unknown integration, a different provider in the path, a paused integration, or a bad or missing signature
400A body that cannot be translated. Shown as the integration's last error.
413More than 1,000 users or 1,000 events, or a body over 4.5 MB
403The app is disabled

Segment

In Segment, add a Webhooks destination (or Webhooks (Actions)). Paste the URL. Set the shared secret to the secret from the console. For Actions, add the header Authorization: Bearer <secret> instead.

Accepted signatures: X-Signature: <hex HMAC-SHA1(secret, raw body)>, or Authorization: Bearer <secret>.

Segment's Spec messages, sent one per request or batched as { "batch": [ ... ] }, map like this:

SegmentIn Herald
identifyA user upsert: userId; traits become attributes (strings, numbers, booleans and string arrays; nested objects are dropped); traits.email becomes the email contact; traits.createdAt becomes the signup date
trackAn event named event, with properties
pageThe event page_viewed, with properties plus name
screenThe event screen_viewed, with properties plus name
alias, groupSkipped, counted in skipped
A message without userIdSkipped: people are keyed on your own user id, not anonymousId
Event idsegment:<messageId>. A message without messageId is skipped.
Event timetimestamp, else receivedAt, else the time the webhook arrived

A message with a value the server API would refuse (an event name over 255 characters, a userId over 200) is skipped instead of failing the batch. An invalid email is dropped and the user is still upserted.

Common errors

MessageCauseFix
Unauthorized401: the secret or signature doesn't match, the integration is paused, or the URL names another providerCopy the URL and secret from the console again, and resume the integration
batch must be an array400: batch is not a listSend one message, or { "batch": [ ... ] }
At most 1000 messages per request400: the batch holds moreLower the destination's batch size
At most 1,000 users and 1,000 events per request413: the request holds moreSend smaller batches

Send decisions to Segment (optional)

Turn on Send decisions to Segment when you connect. In Segment, add an HTTP API source and paste its write key, and pick the region (US or EU). The key is sealed with the integration's secret and never shown again.

The hourly sync sends each decision changed since the last send as Segment track calls to /v1/batch. The first run covers the last 24 hours. Every destination connected to that source receives them: your warehouse, Amplitude, an ad platform.

EventWhenProperties
herald_message_sentEvery decisionagent, agent_id, variant, variant_id, channel, decision_id, holdout (always false)
herald_message_convertedThe decision convertedThe same, plus conversion_event and conversion_value

userId is the person's External ID and messageId is herald:<decision id>:sent (or :converted), which Segment uses to drop duplicates. The cursor moves only after Segment accepts the batch.

MessageCauseFix
Set the Segment write keyShown as the last error: the key is missingAdd the write key on the integration
segment export HTTP <status>Shown as the last error: Segment refused the batchCheck the write key and region; the next run retries
segment network errorShown as the last error: Segment couldn't be reachedNone: the next run retries

RudderStack

In RudderStack, add a Webhook destination. Paste the URL, set the method to POST, and add the header Authorization: Bearer <secret>. That is the only accepted signature.

RudderStack sends the same Spec payload as Segment, so the Segment table applies. Event ids are rudderstack:<messageId>.

Common errors

MessageCauseFix
Unauthorized401: the header isn't Authorization: Bearer <secret>, the integration is paused, or the URL names another providerSet the header exactly, and resume the integration
batch must be an array400: batch is not a listSend one message, or { "batch": [ ... ] }
At most 1000 messages per request400: the batch holds moreLower the destination's batch size
At most 1,000 users and 1,000 events per request413: the request holds moreSend smaller batches

Signed webhook

For anything else: Zapier, Make, n8n, a cron job or your own code.

The body is { "users"?: [...], "events"?: [...] }, with the shapes of POST /api/v1/users and POST /api/v1/events. Either key may be absent, not both. Users are applied before events.

Sign the exact bytes you send with HMAC-SHA256 and put the result in X-Herald-Signature: sha256=<hex>:

bash
BODY='{"events":[{"id":"evt-1","userId":"u1","name":"signup","timestamp":"2026-11-20T12:00:00Z"}]}'
SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" | sed 's/^.* //')
curl -X POST "$WEBHOOK_URL" -H 'Content-Type: application/json' -H "X-Herald-Signature: sha256=$SIG" -d "$BODY"

Validation is the server API's: an invalid item fails the whole request with a 400 that names it.

Common errors

MessageCauseFix
Unauthorized401: X-Herald-Signature doesn't match the exact bytes sent, or the integration is pausedSign the raw body you send, after any serialization
Send users, events or both400: the body has neither users nor eventsAdd one of them
Invalid users payload: ... or Invalid events payload: ...400: an item breaks the server API's rules; the message names itFix that item and resend the request
Invalid JSON or Expected a JSON object400: the body isn't a JSON objectSend JSON
At most 1,000 users and 1,000 events per request413: the request holds moreSend smaller batches

Troubleshooting

  • Every request answers 401. The secret does not match, the integration is paused, or the URL names a different provider.
  • Everything is skipped. Messages without a userId are skipped. Send your own user id.
  • A retry created duplicates. It should not: event ids are deterministic, so a retried delivery counts as a duplicate. Check the duplicates count in the answer.

See Herald decide live →