Connect Segment to Orbit end to end
Segment is a first-class Orbit integration with a bi-directional CDP loop:- Outbound (Orbit → Segment) — one of your Segment Sources receives a
write_key, so Orbit events (messages, conversions, contact changes) post into your Segment workspace as they happen. - Inbound (Segment → Orbit) — each Segment Source you mint in Orbit gets a delivery webhook URL with a one-time HMAC secret. A Webhook Destination in your Segment workspace forwards
identify/track/group/aliascalls into Orbit, where they land in your CDP event stream and resolve onto contacts.
/api-reference/integrations.
Segment’s inbound path is not the OAuth popup used by Zendesk, Calendly, DocuSign, and Jira — it is a Source/write-key flow, like HubSpot’s. Manage it from Settings → Integrations → Segment → Open CDP console, or fully over the API below.
What you’ll set up
- A Segment inbound Source object with
POST /api/v1/integrations/segment/sources(name + your Segmentwrite_key). - The delivery URL —
POST /api/v1/integrations/webhooks/segment?source=<id>— registered as a Webhook Destination in your Segment workspace. - The
x-signatureHMAC-SHA1 secret (hex digest of the raw body) Segment’s webhook destination emits, matched to the plaintext inbound secret returned once at Source creation. identify→ contact upsert,track/page→ event stream,group→ company attribution,alias→ identity merge.- Verification in the CDP event debugger, then enrollment into segments and journeys.
Step 1 — Prerequisites
- An Owner or admin role, plus an API key with the
integrations:writescope (this step touches provider credentials). - Your Segment workspace’s Source write key (from Segment → Sources → your source → Settings → API Keys).
- Decide which event types you want to forward (
identify,track,group,alias).
Step 2 — Create the Source
POST /api/v1/integrations/segment/sources stores your write key (encrypted) and returns the delivery URL plus a plaintext inbound HMAC secret — shown exactly once. Store it in your password manager; rotate later if you lose it.
Confirm the Source exists with
GET /api/v1/integrations/segment/sources — the list returns id, name, webhook_url, inbound_secret_prefix, last_event_at, and last-test fields. Keep only the inbound_secret_prefix for diagnosis; Orbit never returns the full secret after creation.Step 3 — Point Segment → Orbit (Webhook Destination)
In your Segment workspace, add a Webhook Destination on the Source you want to forward, then paste thewebhook_url from Step 2 and set the secret to the inbound_secret from the same response:
- URL:
https://api.orbit.devotel.io/api/v1/integrations/webhooks/segment?source=<segmentSource_id> - Shared secret: the one-time
inbound_secret(startswhsk_…).
x-signature: <HMAC-SHA1 hex of the raw body>; Orbit recomputes that digest with the stored secret and constant-time-compares before dispatching. The ?source=<id> query parameter picks which Source row (and therefore which secret) to verify against — keep it intact.
Never strip the
source query parameter when registering the destination. Without it Orbit returns 400 MISSING_SOURCE; an unknown id returns 401 INVALID_SOURCE.Step 4 — Which events to send, and how they land
Orbit accepts Segment’s four core call types and maps them onto its CDP contract. Send only what you mapped — see the full cross-provider matrix in Integration event field mappings.
Every event is persisted to the tenant event log with
ON CONFLICT (source_id, message_id) DO NOTHING, so Segment replays are safe. A response of duplicate: true means a re-delivery Orbit already recorded.
After the first
identify, check the CDP event debugger (Insights → CDP event debugger) — the event row and the resolved contact_id appear within seconds. Full debugger tour: CDP event debugger & DLQ.Step 5 — Identity stitching: userId + anonymousId + alias
Orbit resolves identity the same way it does for every external provider; Segment just supplies the ids. Cross-references: Identity resolution and Anonymous identity stitching.identify—userIdbecomes the contact’s external id under providersegment, so the same person re-identified across sessions/integrations lands on one contact row.email/phoneare lifted to first-class columns; everything else stays underattributes.track/page— Orbit joins the event to the existing contact resolved byuserId; it never creates a contact from a track, so anonymous visitors stay event-only until anidentifystitches them.alias— Segment’s alias semantics (previousIdfolds intouserId) map to a survivorship-policy merge: theuserIdcontact survives, thepreviousIdcontact folds in with a merge audit record and your tenant’s field-level policy (most recent / primary wins) applied. Both sides resolve, or the call is a recorded no-op.group— B2B attribution (account/company) writessegment_group_idonto the contact whenuserIdresolves.
Because
alias runs the same merge primitive as the dashboard Identity Resolution console, Segment-driven merges respect the undo window and your survivorship policy exactly the way manual merges do.Step 6 — Use Segment-fed profiles in segments and journeys
Once events land, they feed Orbit’s audiences the same way native events do:- Verify first with the event debugger (above) — a missing
sourceparam, a wrong secret, or an unmapped event name all show up there before they poison audiences. - Build audiences in Contacts → Segments — conditions over the event stream (e.g.
trackevent nameOrder Completedin last 30d) or over group-attributed company fields. - Enroll Segment-fed audiences into journeys in Campaigns → Journey builder — the full walkthrough is Segment-triggered journeys.
group promotes company_* fields onto contact attributes, B2B tenants can segment on company plan/industry without a separate enrichment step.
Step 7 — Health monitoring
- Per-Source health —
GET /api/v1/integrations/segment/sourcesreturns each Source withlast_event_at,last_test_at, andlast_test_ok. A Source whoselast_event_atstalls while Segment delivery is green on their side usually means a rotated secret mismatch. - End-to-end test —
POST /api/v1/integrations/segment/sources/:id/testfires a syntheticidentifythrough the stored write key and recordslast_test_okon the Source. Run it after creating or rotating a Source before pointing traffic at it. - Catalog status —
GET /api/v1/integrations/{id}/statusreports whether the Segment catalog entry has any Source configured (connected: falsewhen none exist).
data rows include inbound_secret_prefix for “which secret is this?” diagnosis without ever leaking the full secret.
Step 8 — Revoke or rotate
- Rotate the secret —
POST /api/v1/integrations/segment/sources/:id/rotate-secretissues a new plaintext inbound secret (shown once); update the Webhook Destination in Segment and events resume. - Delete a Source —
DELETE /api/v1/integrations/segment/sources/:idpermanently stops accepting inbound events on that URL. Decommission Sources you no longer want honored. - Disconnect the integration — from the dashboard (Segment card → drawer → Revoke) or
DELETE /api/v1/integrations/segment/disconnect, same pattern as the OAuth SaaS integrations (revoke flow).
First-event checklist
Run this after Step 3, before building audiences:POST /segment/sourcesreturned awebhook_urlyou copied verbatim,?source=included.- The plaintext
inbound_secretis stored (it is never shown again; rotate if lost). - The Segment Webhook Destination is enabled on the right Segment source.
- Send a manual
identifywith a knownuserIdfrom Segment’s debugger. - Orbit returns
200withreceived: true(not401/400). - The event row + resolved
contact_idappear in the CDP event debugger. GET /segment/sourcesshowslast_event_atupdated.- Only then enroll the event into segments/journeys.
Troubleshooting
Related reading
- Integration event field mappings — which fields each inbound event populates across providers.
- Identity resolution + Anonymous identity stitching — how Orbit merges cross-id visitors into one contact.
- CDP event debugger & DLQ — confirm the first event lands before building audiences.
- Segment-triggered journeys — enroll Segment-fed audiences into flows.
- HubSpot & Salesforce end to end — the CRM/CDP sibling guide this page mirrors.
- Integrations API reference — connect/status/sources/rotate/disconnect endpoint detail.