Twilio Segment is a customer data platform (CDP) that collects, unifies, and routes first-party customer event data across a business's tools and warehouses. The Segment Public API exposes management of Sources, Destinations, Warehouses, Tracking Plans, Engage Audiences, and GDPR/CCPA regulations, while the separate Tracking HTTP API accepts real-time event ingestion (track, identify, batch calls).
Power end-to-end data operations for your Twilio Segment API with Nexla. Our bi-directional Twilio Segment connector is purpose-built for Twilio Segment, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to Twilio Segment or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your Twilio Segment workflows fast, secure, and fully governed.
Features
Type: API
SourceDestination
Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
Request optimization with intelligent batching, retry, and caching to minimize API calls and costs
Segment exposes two distinct APIs, and Nexla supports both with separate credential types: the Public API (for managing Sources, Destinations, Warehouses, Tracking Plans, Audiences, and Regulations) and the Tracking HTTP API (for sending track/identify/batch events into a Source). Which one you need depends on which endpoints you plan to use.
Click + Create Token, and make sure you select a Public API token (not a Config API token, which uses a different auth scheme).
Enter a description for the token and assign it a role — Workspace Owner or Workspace Member — that grants access to the resources you want Nexla to read or manage.
Click Create, then copy the generated token immediately. Segment shows the raw token value only once; if you lose it, you'll need to generate a new one.
Only users with the Workspace Owner role can create a Public API token. Each Segment workspace requires its own separate token, and if your workspace is hosted in the EU, requests are routed to a different base URL (eu1.api.segmentapis.com instead of api.segmentapis.com) — use Manual configuration to point at the EU endpoint if needed. For details, see the Segment Public API authentication documentation.
In your Segment workspace, navigate to Connections > Sources, and select (or create) the event-streams Source you want to send events into — for example, an HTTP API source.
Open the Source, click Settings, then select API Keys.
Copy the Write Key shown there. This value identifies which Source the events you send from Nexla will be attributed to.
The Write Key authenticates requests to api.segment.io (the Tracking HTTP API), which is a separate host and auth scheme from the Public API used for management endpoints. Cloud-app sources do not have write keys. For details, see Locate your Write Key and the HTTP Tracking API documentation.
Authenticate using a Segment Workspace API Token (Bearer) for management endpoints: Sources, Destinations, Warehouses, Tracking Plans, Audiences, Regulations.
Field
Required
Secret
Description
Public API Token
Yes
Yes
Workspace-scoped API token. Generate at Settings > Workspace settings > Access Management > Tokens. Requires at minimum Workspace Member access.
Authenticate using a Source Write Key for event ingestion via the Segment Tracking HTTP API (track, identify, page, group, alias, batch).
Field
Required
Secret
Description
Source Write Key
Yes
Yes
Write Key for a specific Segment Source. Found at Connections > Sources > [Your Source] > Settings > API Keys.
After selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.
Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.
Select the credential type that matches the endpoints you plan to use:
Segment Public API Token — enter the workspace token in the Public API Token field. This is the token you generated in Prerequisites under Settings > Workspace settings > Access Management > Tokens. Use this credential type for management endpoints such as Sources, Destinations, Warehouses, Tracking Plans, Audiences, and Regulations.
Segment Tracking Write Key (HTTP API) — enter the Source's write key in the Source Write Key field. This is the value you copied from Connections > Sources > [Your Source] > Settings > API Keys. Use this credential type for the Track Event, Identify User, and Batch Events destination endpoints.
Both credential values are sensitive and should be treated as secrets. If a Public API Token or Write Key is compromised, revoke or regenerate it from the corresponding page in your Segment workspace.
Click the Save button at the bottom of the overlay. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation.
To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the Twilio Segment connector tile, then select the credential that will be used to connect to your Segment workspace, and click Next; or, create a new Segment credential for use in this flow. Use a Segment Public API Token credential for all of the endpoint templates below.
Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Segment Public API endpoints. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.
List Sources
Retrieve all Sources in the workspace including slug, name, write keys, schema settings, and enabled status.
Page Size — Number of Sources to return per page (1–1000). Default: 200.
Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.
Segment data sources can also be manually configured to ingest data from any valid Segment Public API endpoint, including endpoints not covered by the pre-built templates, chained API calls, or custom request parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, date/time and lookup macros, path to data, metadata, and request headers.
Segment Public API endpoints use cursor-based pagination via the pagination.cursor query parameter and a pagination.next.cursor value returned in the response. Most list endpoints accept a pagination.count parameter (1–1000, default 200) to control page size.
Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new Segment data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.
Click the + icon on the Nexset that will be sent to the Segment destination, and select the Send to Destination option from the menu. Select the Twilio Segment connector from the list of available destination connectors, then select the credential that will be used to connect to Segment, and click Next; or, create a new Segment credential for use in this flow. Use a Segment Tracking Write Key credential for the Track Event, Identify User, and Batch Events endpoints, and a Segment Public API Token credential for the remaining management endpoints.
Nexla provides pre-built templates that can be used to rapidly configure destinations to send data to common Segment endpoints. Select the endpoint to which data will be sent from the Endpoint pulldown menu. Then, click on the template in the list below to expand it, and follow the instructions to configure additional endpoint settings.
Track Event
Send a Track event to a Segment Source via the HTTP Tracking API. Record must include userId or anonymousId plus event name. Requires Tracking Write Key auth.
No additional configuration parameters are required for this endpoint.
Send multiple Track, Identify, Page, Group, or Alias events in a single request. Max 500 KB per batch / 2500 events / 32 KB per event. Requires Tracking Write Key auth.
No additional configuration parameters are required for this endpoint.
Submit a workspace-level deletion or suppression regulation (GDPR right-to-erasure, CCPA opt-out). Record must include regulationType and subjectType plus identifiers.
No additional configuration parameters are required for this endpoint.
Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to send a test payload and verify that the destination is configured correctly before saving.
Segment destinations can also be manually configured to send data to any valid Segment API endpoint. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, data format, endpoint URL, request headers, attribute exclusions, record batching, and response webhooks.
Segment Public API write endpoints (create/update) accept JSON in the request body and are authenticated with a Public API Token. The Tracking HTTP API endpoints (Track Event, Identify User, Batch Events) are authenticated with a Source Write Key sent as the HTTP basic auth username, and send JSON to api.segment.io. For update operations against the Public API, include the resource ID (Source ID or Destination ID) at the end of the URL.
Once all endpoint settings have been configured, click the Done button in the upper right corner of the screen to save and create the destination. To send the data to the configured Segment endpoint, open the destination resource menu, and select Activate.
The Nexset data will not be sent to the Segment endpoint until the destination is activated. Destinations can be activated immediately or at a later time, providing full control over data movement.