Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this page
Looking for more inspiration?Visit the

Segment destination


(new)

Beta

Data Destinations is currently available as a Private Beta product and the information contained in this document is subject to change. Data Destinations is not a HIPAA Eligible Service or PCI compliant and should not be enabled in workflows that are subject to HIPAA or PCI. To learn more, see Private beta legal information.

Twilio Segment(link takes you to an external page) lets you collect, unify, and route customer data to hundreds of downstream tools. Send your events to a Segment source to fold them into your existing customer data pipeline.

Destination overview

destination-overview page anchor
  • Category: CDP
  • Release status: Beta
  • Authentication: API key
  • Regional availability: US1, IE1
Join the Data Destinations private beta

Get early access to native destinations for data warehouses, observability tools, and event pipelines.

Sign up(link takes you to an external page)

Eligible events

eligible-events page anchor

The Segment Track API requires a resolvable identifier (either a userId or anonymousId) on every event. Twilio silently suppresses events without a supported identifier instead of delivering them. For more information, see Common errors.

You can send the following event types to Segment:

No other event types are currently eligible for this destination.

In the IE1 region, only Voice Insights events are eligible for delivery at this time.


Before you set up a Segment destination, make sure you have:

  • A Segment account with a source configured to receive HTTP Tracking API events.
  • Your Segment source's Write Key, found in the source's settings.

(information)

Info

See Set up a destination for the full UI and Destinations API setup flow common to every destination type.

To create a Segment destination in the Twilio Console:

  1. From your Segment account, gather the settings listed in Destination settings.
  2. In the Twilio Console, go to Data > Data Destinations > Destinations > Add destination subscription.
  3. Complete the Add destination subscription wizard.

To create a Segment destination through the Destinations API, send a POST request to the Destinations endpoint and set destinationType to segment. For authentication and the other request body fields, see Create a destination.

Create a destination

create-a-destination page anchor
POST "https://destinations.twilio.com/v1/ControlPlane/Destinations"

Set the config object in the request body as follows:

NameTypeDescription
credentials.credentialType
(Required)
stringSet to API_KEY.
credentials.writeKey
(Required)
stringYour Segment source write key.
regionenum<string>Your Segment region. The default is US. Valid values: US, EU.

The following example shows a request body. Replace the uppercase placeholder values with your own.

1
{
2
"destinationType": "segment",
3
"name": "My Segment destination",
4
"config": {
5
"credentials": {
6
"credentialType": "API_KEY",
7
"writeKey": "WRITE_KEY"
8
}
9
}
10
}

Use segment as the destinationType.

FieldDescriptionRequiredDefault or choices
Write KeySegment source write key, sent as the HTTP Basic Auth username. Marked as sensitive: entered once and stored encrypted.YesNone
RegionSegment region determining the API endpoint.NoDefault: US. Choices: US, EU

Twilio authenticates to Segment by using HTTP Basic Auth, with your Write Key as the username and an empty password. This credential is stored encrypted and never appears in event payloads.


FieldSegment field
Event friendly nameEvent name
Event timeTimestamp
Event IDMessage ID (deduplication)
Event payloadProperties
Resolved user/anonymous identityuserId / anonymousId
External IDscontext.externalIds

Verification and troubleshooting

verification-and-troubleshooting page anchor

When you save a Segment destination, Twilio validates your Write Key against Segment before marking the destination active. If validation fails, check that:

  • Your Write Key is correct and belongs to an active Segment source.
  • The Region you selected in the Console matches where your Segment source is actually hosted.

To trigger a test event, open the Console and go to the Trigger Test Event utility.

A corresponding Track call appears in your Segment source's debugger within a few seconds.

CauseWhat you'll seeFix
Invalid or revoked Write KeyValidation fails with an auth errorRe-check the write key in Segment and update the destination
Wrong Region selected in the ConsoleValidation fails even with a correct write keyConfirm your source's region in Segment and update the Region setting
Event missing both user and anonymous identityTwilio silently suppresses the event. No error appears in the Debugger, and the event doesn't arrive in SegmentEnsure the subscribed event type carries a resolvable user identifier
Segment unreachable or timing outDelivery errors reported in the DebuggerCheck the Segment status page and retry

If Twilio can't deliver events to your destination, Twilio sends an error notification to the Debugger (available in US1 region only). If Twilio continues to encounter delivery errors, Twilio notifies you every 20 minutes after the initial error.