Skip to main content

Twilio Segment

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).

Twilio Segment icon

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

Prerequisites

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.

Public API Token (for management endpoints)

  1. Sign in to your Segment workspace at app.segment.com.

  2. Navigate to Settings > Workspace settings > Access Management > Tokens.

  3. Click + Create Token, and make sure you select a Public API token (not a Config API token, which uses a different auth scheme).

  4. 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.

  5. 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.

Source Write Key (for the Tracking HTTP API)

  1. 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.

  2. Open the Source, click Settings, then select API Keys.

  3. 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

Credentials required

Authenticate using a Segment Workspace API Token (Bearer) for management endpoints: Sources, Destinations, Warehouses, Tracking Plans, Audiences, Regulations.

FieldRequiredSecretDescription
Public API TokenYesYesWorkspace-scoped API token. Generate at Settings > Workspace settings > Access Management > Tokens. Requires at minimum Workspace Member access.

Create a credential in Nexla

  1. After selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

  2. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

  3. 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.

    For more information about Segment authentication, see the Segment Public API documentation and the Segment HTTP Tracking API documentation.

  4. 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.

Use as a data source

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.

Endpoint templates

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.

For details on request parameters and response fields, see the Segment Public API documentation.

Get Source by ID

Retrieve full details for a single Source including its settings, write keys, and connected destinations.

  • Source ID (required) — The unique ID of the Segment Source to retrieve (e.g. rh5BDZp6QDHvXFCkibm1pR).

For details on request parameters and response fields, see the Segment Public API documentation.

List Connected Destinations from Source

List all Destinations connected to a specific Source, with their enabled state and settings metadata.

  • Source ID (required) — The unique ID of the Source whose connected Destinations to list.
  • Page Size — Number of Destinations to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Destinations

Retrieve all Destinations in the workspace with their configuration, enabled state, and metadata.

  • Page Size — Number of Destinations to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Warehouses

Retrieve all Warehouses in the workspace including connection state, settings, and connected sources.

  • Page Size — Number of Warehouses to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Tracking Plans

Retrieve all Tracking Plans in the workspace, including name, description, and rule counts for governance auditing.

  • Page Size — Number of Tracking Plans to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Engage Spaces

Retrieve all Engage Spaces (CDP workspaces) in the account. Required as a prerequisite to list Audiences.

  • Page Size — Number of Engage Spaces to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Audiences from Space

Retrieve all Audiences defined in an Engage Space including name, status, definition, and schedule metadata.

  • Space ID (required) — The unique ID of the Engage Space to list Audiences from. Retrieve Space IDs via the List Engage Spaces endpoint.
  • Page Size — Number of Audiences to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Workspace Regulations

Retrieve all GDPR/CCPA deletion and suppression regulations at the workspace level including status and regulation type.

  • Regulation Type — Filter by regulation type. Leave blank to return all types. Accepted values: (blank), DELETE_ONLY, DELETE_INTERNAL, SUPPRESS_AND_DELETE, SUPPRESS_ONLY, UNSUPPRESS.
  • Status Filter — Filter by regulation status. Leave blank to return all statuses. Accepted values: (blank), RUNNING, FINISHED, FAILED, ABORTED, NOT_SUPPORTED, PARTIAL_SUCCESS, INVALID.
  • Page Size — Number of regulations to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Reverse ETL Models

Retrieve all Reverse ETL Models (SQL queries / warehouse views) configured for syncing data back to Destinations.

  • Page Size — Number of Reverse ETL Models to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Delivery Metrics

Retrieve event delivery success/failure/retry metrics per destination for pipeline health monitoring.

  • Destination ID (required) — The unique ID of the Destination to retrieve delivery metrics for.
  • Start Time — Start of time range for metrics (ISO 8601 format). Default: 24 hours ago.
  • End Time — End of time range for metrics (ISO 8601 format). Default: now.
  • Granularity — Time granularity for metric aggregation. Accepted values: MINUTE, HOUR, DAY.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Functions

Retrieve all Functions (user-defined transformations) in the workspace for debugging data discrepancies.

  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Source Regulations

Retrieve all GDPR/CCPA deletion and suppression regulations for a specific Source for compliance auditing.

  • Source ID (required) — The unique ID of the Source to retrieve regulations for.
  • Regulation Type — Filter by regulation type. Leave blank to return all types. Accepted values: (blank), DELETE_ONLY, DELETE_INTERNAL, SUPPRESS_AND_DELETE, SUPPRESS_ONLY, UNSUPPRESS.
  • Status Filter — Filter by regulation status. Leave blank to return all statuses. Accepted values: (blank), RUNNING, FINISHED, FAILED, ABORTED, NOT_SUPPORTED, PARTIAL_SUCCESS, INVALID.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

Get Workspace

Retrieve details about the current Workspace including name, slug, and creation date.

  • No additional configuration parameters are required for this endpoint.

For details on request parameters and response fields, see the Segment Public API documentation.

List Audit Events

Retrieve workspace audit trail events filtered by time range, resource ID, and resource type.

  • Start Time — Start of the audit event time range (ISO 8601 format).
  • End Time — End of the audit event time range (ISO 8601 format).
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Destinations Catalog

Retrieve all available Destination integrations in the Segment catalog with their metadata and supported features.

  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Sources Catalog

Retrieve all available Source integrations in the Segment catalog with their metadata and supported event types.

  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

Get Events Volume

Retrieve workspace event volume metrics grouped by source, event name, or type for a given time range and granularity.

  • Granularity (required) — Time bucket granularity for event volume aggregation. Accepted values: DAY, HOUR, MINUTE.
  • Start Time (required) — Start of the reporting window in ISO 8601 format.
  • End Time (required) — End of the reporting window in ISO 8601 format.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Egress Success Metrics

Retrieve successful event delivery metrics per source and destination for delivery pipeline monitoring.

  • Source Id (required) — Required filter for list egress success metrics.
  • Destination Config Id (required) — Required filter for list egress success metrics.
  • Start Time (required) — Required filter for list egress success metrics.
  • End Time (required) — Required filter for list egress success metrics.
  • Granularity (required) — Required filter for list egress success metrics.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Egress Failed Metrics

Retrieve failed event delivery metrics per source and destination to identify delivery pipeline failures.

  • Source Id (required) — Required filter for list egress failed metrics.
  • Destination Config Id (required) — Required filter for list egress failed metrics.
  • Start Time (required) — Required filter for list egress failed metrics.
  • End Time (required) — Required filter for list egress failed metrics.
  • Granularity (required) — Required filter for list egress failed metrics.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Ingress Success Metrics

Retrieve successfully received ingest event metrics per source for Source health monitoring.

  • Source Id (required) — Required filter for list ingress success metrics.
  • Start Time (required) — Required filter for list ingress success metrics.
  • End Time (required) — Required filter for list ingress success metrics.
  • Granularity (required) — Required filter for list ingress success metrics.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Ingress Failed Metrics

Retrieve failed ingest event metrics per source to identify ingestion errors and invalid payloads.

  • Source Id (required) — Required filter for list ingress failed metrics.
  • Start Time (required) — Required filter for list ingress failed metrics.
  • End Time (required) — Required filter for list ingress failed metrics.
  • Granularity (required) — Required filter for list ingress failed metrics.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Filtered at Destination Metrics

Retrieve metrics for events filtered at the Destination layer (destination filters, integrations object).

  • Source Id (required) — Required filter for list filtered at destination metrics.
  • Destination Config Id (required) — Required filter for list filtered at destination metrics.
  • Start Time (required) — Required filter for list filtered at destination metrics.
  • End Time (required) — Required filter for list filtered at destination metrics.
  • Granularity (required) — Required filter for list filtered at destination metrics.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Filtered at Source Metrics

Retrieve metrics for events filtered at the Source layer (schema filters, source filters).

  • Source Id (required) — Required filter for list filtered at source metrics.
  • Start Time (required) — Required filter for list filtered at source metrics.
  • End Time (required) — Required filter for list filtered at source metrics.
  • Granularity (required) — Required filter for list filtered at source metrics.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Destination Filters

Retrieve all filters configured for a specific Destination to audit event routing rules.

  • Destination ID (required) — The unique ID of the Destination to list filters for.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Destination Subscriptions

Retrieve all action subscriptions configured for a Destination including trigger conditions and mappings.

  • Destination ID (required) — The unique ID of the Destination to list subscriptions for.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Transformations

Retrieve all Transformations in the workspace for auditing event modification rules.

  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Users

Retrieve all users who have access to the workspace including their email, name, and permission level.

  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Roles

Retrieve all IAM roles available in the workspace for access management auditing.

  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Tracking Plan Rules

Retrieve all validation rules for a Tracking Plan including event schemas and property requirements.

  • Tracking Plan ID (required) — The unique ID of the Tracking Plan to list rules for.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Tracking Plan Connected Sources

Retrieve all Sources connected to a Tracking Plan to audit which sources enforce the plan's rules.

  • Tracking Plan ID (required) — The unique ID of the Tracking Plan to list connected Sources for.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Computed Traits

Retrieve all Computed Traits in an Engage Space including their definition, status, and computation schedule.

  • Space ID (required) — The unique ID of the Engage Space to list Computed Traits from.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Warehouse Connected Sources

Retrieve all Sources connected to a Warehouse to audit sync configurations and schema mappings.

  • Warehouse ID (required) — The unique ID of the Warehouse to list connected Sources for.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Warehouse Syncs

Retrieve sync history and status reports for a Warehouse to monitor data loading performance.

  • Warehouse ID (required) — The unique ID of the Warehouse to retrieve sync reports for.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Source Connected Warehouses

Retrieve all Warehouses connected to a specific Source to audit data destinations.

  • Source ID (required) — The unique ID of the Source to list connected Warehouses for.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

List Suppressions

Retrieve all suppressed user identities at the workspace level for GDPR/CCPA compliance auditing.

  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

Get Daily Workspace API Calls Usage

Retrieve daily API call volume for the workspace for a given billing period.

  • Period (required) — Billing period for API call usage (e.g. 2024-01). Format: YYYY-MM.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

Get Daily Per-Source API Calls Usage

Retrieve daily API call volume broken down by Source for a given billing period.

  • Period (required) — Billing period for API call usage (e.g. 2024-01). Format: YYYY-MM.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

Get Daily Workspace MTU Usage

Retrieve daily Monthly Tracked User (MTU) counts for the workspace for a given billing period.

  • Period (required) — Billing period for MTU usage (e.g. 2024-01). Format: YYYY-MM.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

Get Daily Per-Source MTU Usage

Retrieve daily Monthly Tracked User (MTU) counts broken down by Source for a given billing period.

  • Period (required) — Billing period for MTU usage (e.g. 2024-01). Format: YYYY-MM.
  • Page Size — Number of records to return per page (1–1000). Default: 200.

For details on request parameters and response fields, see the Segment Public API documentation.

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.

Manual configuration

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.

Use as a destination

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.

Endpoint templates

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.

For details on request parameters and response fields, see the Segment HTTP Tracking API documentation.

Identify User

Send an Identify call to tie a user to their actions and record profile traits. Record must include userId. Requires Tracking Write Key auth.

  • No additional configuration parameters are required for this endpoint.

For details on request parameters and response fields, see the Segment HTTP Tracking API documentation.

Batch Events

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.

For details on request parameters and response fields, see the Segment HTTP Tracking API documentation.

Create Workspace Regulation (GDPR/CCPA)

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.

For details on request parameters and response fields, see the Segment Public API documentation.

Update Source

Update a Source's configuration including enabled state, settings, and metadata. Record must include sourceId.

  • Source ID (required) — The unique ID of the Source to update.

For details on request parameters and response fields, see the Segment Public API documentation.

Update Destination

Update a Destination's configuration including enabled state, connection settings, mappings, and filters.

  • Destination ID (required) — The unique ID of the Destination to update.

For details on request parameters and response fields, see the Segment Public API documentation.

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.

Manual configuration

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.

Save & activate

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.