> ## Documentation Index
> Fetch the complete documentation index at: https://composio-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Segment

> Twilio Segment is a customer data platform that helps businesses collect, clean, and control their customer data.

![Segment logo](https://mintcdn.com/composio-preview/YYC5iurbUCUzEs77/images/toolkits/segment.svg?fit=max\&auto=format\&n=YYC5iurbUCUzEs77\&q=85\&s=195a59880b2e1be8124cc56e0404fa4d)

* **Category:** analytics
* **Auth:** API\_KEY
* **Composio-managed OAuth available?** N/A
* **Tools:** 17
* **Triggers:** 0
* **Slug:** `SEGMENT`
* **Version:** 20261101\_00

## Tools

> [accordion] Add Labels to Source
>
> **Slug:** `SEGMENT_ADD_LABELS_TO_SOURCE`
>
> Tool to add existing labels to a Source. Use when you have the source ID and want to tag it with metadata labels.
>
> #### Input Parameters
>
> **labels** `array` *required*
>
> List of labels to associate with the Source. Must include at least one label.
>
> **sourceId** `string` *required*
>
> ID of the Source (1-255 characters)
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Segment Alias
>
> **Slug:** `SEGMENT_ALIAS`
>
> Tool to alias a previous user ID to a new user ID. Use when merging anonymous and known identities.
>
> #### Input Parameters
>
> **userId** `string`
>
> New known unique identifier for the user.
>
> **context** `object`
>
> Additional context (e.g., ip, locale).
>
> **timestamp** `string`
>
> ISO-8601 timestamp for the event; server time used if omitted.
>
> **previousId** `string` *required*
>
> Previous unique identifier for the user.
>
> **anonymousId** `string`
>
> Anonymous identifier for the user.
>
> **integrations** `object`
>
> Per-destination enable/disable controls.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Batch Segment Analytics Events
>
> **Slug:** `SEGMENT_BATCH`
>
> Tool to send multiple analytics calls in a single batch request. Use when you want to reduce HTTP overhead by batching Identify/Track/Page/Screen/Group calls into one request.
>
> #### Input Parameters
>
> **batch** `array` *required*
>
> Array of analytics calls (identify, track, page, screen, or group). Each item must include 'type' and required fields per call type.
>
> **context** `object`
>
> Optional top-level context merged into each call's context.
>
> **writeKey** `string`
>
> Segment write key; required when using Bearer authentication.
>
> **integrations** `object`
>
> Optional top-level integrations merged into each call's integrations.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Delete Source
>
> **Slug:** `SEGMENT_DELETE_SOURCE`
>
> Tool to delete a Segment Source. Use when you need to permanently remove a Source by its ID after confirmation.
>
> #### Input Parameters
>
> **sourceId** `string` *required*
>
> The Source ID. Length 1–255 characters.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Get Daily Per Source API Calls Usage
>
> **Slug:** `SEGMENT_GET_DAILY_PER_SOURCE_API_CALLS_USAGE`
>
> Fetch daily API call counts by Segment Source for a given reporting period. Optional page size and cursor parameters let you navigate the results. An empty result does not necessarily establish that there was no usage.
>
> #### Input Parameters
>
> **period** `string` *required*
>
> Start of the usage period in ISO-8601 format (YYYY-MM-DD), e.g. '2021-02-01'.
>
> **pagination** `object`
>
> Pagination parameters for querying source daily API calls usage.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Get Destination
>
> **Slug:** `SEGMENT_GET_DESTINATION`
>
> Retrieve a Segment Destination's configuration by its unique ID using the configured region.
>
> #### Input Parameters
>
> **destinationId** `string` *required*
>
> The destination’s unique ID.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Segment Group
>
> **Slug:** `SEGMENT_GROUP`
>
> Tool to associate an identified user with a group via Segment HTTP Tracking API. Use when grouping users with traits.
>
> #### Input Parameters
>
> **traits** `object`
>
> Free-form dictionary of group traits (e.g., name, industry, employees).
>
> **userId** `string`
>
> Unique user identifier. Exactly one of 'userId' or 'anonymousId' must be provided.
>
> **context** `object`
>
> Additional contextual information (e.g., ip, locale, device).
>
> **groupId** `string` *required*
>
> Unique identifier for the group.
>
> **writeKey** `string`
>
> Write key for authentication if not using OAuth Bearer token.
>
> **timestamp** `string`
>
> ISO-8601 timestamp when the event occurred; if omitted, server time is used.
>
> **anonymousId** `string`
>
> Pseudo-unique ID for anonymous users. Exactly one of 'userId' or 'anonymousId' must be provided.
>
> **integrations** `object`
>
> Per-destination enable/disable controls (case-sensitive keys).
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Segment Identify
>
> **Slug:** `SEGMENT_IDENTIFY`
>
> Tool to identify a user and set/update traits via Segment HTTP Tracking API.
>
> #### Input Parameters
>
> **traits** `object`
>
> Free-form dictionary of user traits (e.g., email, name, plan).
>
> **userId** `string`
>
> Unique user identifier. Exactly one of 'userId' or 'anonymousId' must be provided.
>
> **context** `object`
>
> Additional contextual information (e.g., ip, locale, device).
>
> **writeKey** `string`
>
> Write key for authentication if not using Basic or OAuth headers.
>
> **messageId** `string`
>
> Unique id for deduplication; Segment auto-generates one if omitted.
>
> **timestamp** `string`
>
> ISO-8601 timestamp when the identification occurred; if omitted, server time is used.
>
> **anonymousId** `string`
>
> Pseudo-unique ID for anonymous users. Exactly one of 'userId' or 'anonymousId' must be provided.
>
> **integrations** `object`
>
> Per-destination enable/disable controls (case-sensitive keys).
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Import Historical Data
>
> **Slug:** `SEGMENT_IMPORT_HISTORICAL_DATA`
>
> Import historical events in bulk into Segment with their original timestamps, for backfilling past activity. Imports use the US tracking service even when the workspace is configured for the EU region.
>
> #### Input Parameters
>
> **batch** `array` *required*
>
> Array of event objects to import. Each event should contain: type (track/identify/page/screen/group), userId or anonymousId, timestamp (ISO 8601 format for historical data), and event-specific properties.
>
> **context** `object`
>
> Optional top-level context merged into each call's context.
>
> **integrations** `object`
>
> Optional top-level integrations merged into each call's integrations.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] List Connected Warehouses From Source
>
> **Slug:** `SEGMENT_LIST_CONNECTED_WAREHOUSES_FROM_SOURCE`
>
> List warehouses connected to a Segment Source by source ID. Specify a page size from 1 to 1,000 and an optional cursor to navigate results. An empty result does not necessarily establish that no warehouses are connected.
>
> #### Input Parameters
>
> **sourceId** `string` *required*
>
> ID of the Source to retrieve warehouses for.
>
> **pagination** `object` *required*
>
> Pagination parameters for the request.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] List Delivery Metrics Summary from Destination
>
> **Slug:** `SEGMENT_LIST_DELIVERY_METRICS_SUMMARY_FROM_DESTINATION`
>
> Get an event delivery metrics summary for a Destination and Source. An HTML response may produce an empty metrics list rather than actual delivery data.
>
> #### Input Parameters
>
> **endTime** `string`
>
> Filter events that happened before this time (ISO-8601). Defaults to now.
>
> **sourceId** `string` *required*
>
> Source id linked to the destination
>
> **startTime** `string`
>
> Filter events that happened after this time (ISO-8601). Defaults depend on granularity.
>
> **granularity** `string ("DAY" | "HOUR" | "MINUTE")`
>
> Granularity of the metrics aggregation
>
> **destinationId** `string` *required*
>
> Destination identifier
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] List Schema Settings in Source
>
> **Slug:** `SEGMENT_LIST_SCHEMA_SETTINGS_IN_SOURCE`
>
> Retrieve schema configuration settings for a Segment Source by its ID, including settings for track, identify, and group calls. Returned settings may include placeholders rather than the Source's actual configuration.
>
> #### Input Parameters
>
> **sourceId** `string` *required*
>
> ID of the Source
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Segment Page View
>
> **Slug:** `SEGMENT_PAGE`
>
> Tool to record a page view via Segment HTTP Tracking API. Use when sending page views with optional page name and properties.
>
> #### Input Parameters
>
> **name** `string`
>
> Name of the page. Optional.
>
> **userId** `string`
>
> Unique user identifier. Exactly one of 'userId' or 'anonymousId' must be provided.
>
> **context** `object`
>
> Additional contextual information (e.g., ip, locale, device).
>
> **writeKey** `string`
>
> Write key for authentication if not using Basic or Bearer auth in headers.
>
> **messageId** `string`
>
> Unique id for deduplication; Segment auto-generates one if omitted.
>
> **timestamp** `string`
>
> ISO-8601 timestamp when the event occurred; if omitted, server time is used.
>
> **properties** `object`
>
> Free-form dictionary of page properties (e.g., path, url).
>
> **anonymousId** `string`
>
> Pseudo-unique ID for anonymous users. Exactly one of 'userId' or 'anonymousId' must be provided.
>
> **integrations** `object`
>
> Per-destination enable/disable controls (case-sensitive keys).
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Remove Source Write Key
>
> **Slug:** `SEGMENT_REMOVE_SOURCE_WRITE_KEY`
>
> Remove a specified write key from a Segment Source, for example during security maintenance or key rotation. A reported success does not always independently confirm that the key was revoked.
>
> #### Input Parameters
>
> **sourceId** `string` *required*
>
> The unique identifier of the Source.
>
> **writeKey** `string` *required*
>
> The write key to remove from the Source.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Segment Screen Event
>
> **Slug:** `SEGMENT_SCREEN`
>
> Tool to record a mobile app screen view. Use when tracking screen views in a mobile app via Segment HTTP Tracking API.
>
> #### Input Parameters
>
> **name** `string`
>
> Name of the screen.
>
> **userId** `string`
>
> Unique user identifier. Exactly one of 'userId' or 'anonymousId' must be provided.
>
> **context** `object`
>
> Additional contextual information (e.g., ip, locale, device).
>
> **writeKey** `string`
>
> Write key for authentication if not using Basic or OAuth headers.
>
> **timestamp** `string`
>
> ISO-8601 timestamp when the screen event occurred; if omitted, server time is used.
>
> **properties** `object`
>
> Free-form dictionary of screen properties.
>
> **anonymousId** `string`
>
> Pseudo-unique ID for anonymous users. Exactly one of 'userId' or 'anonymousId' must be provided.
>
> **integrations** `object`
>
> Per-destination enable/disable controls (case-sensitive keys).
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Segment Track Event
>
> **Slug:** `SEGMENT_TRACK`
>
> Tool to record a custom user event via Segment HTTP Tracking API. Use when sending events to Segment with valid identity.
>
> #### Input Parameters
>
> **event** `string` *required*
>
> Name of the action performed (e.g., 'Item Purchased').
>
> **userId** `string`
>
> Unique user identifier. Exactly one of 'userId' or 'anonymousId' must be provided.
>
> **context** `object`
>
> Additional contextual information (e.g., ip, locale, device).
>
> **writeKey** `string`
>
> Write key for authentication if not using Basic or OAuth headers.
>
> **timestamp** `string`
>
> ISO-8601 timestamp when the event occurred; if omitted, server time is used.
>
> **properties** `object`
>
> Free-form dictionary of event-specific properties (e.g., revenue).
>
> **anonymousId** `string`
>
> Pseudo-unique ID for anonymous users. Exactly one of 'userId' or 'anonymousId' must be provided.
>
> **integrations** `object`
>
> Per-destination enable/disable controls (case-sensitive keys).
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Update Source
>
> **Slug:** `SEGMENT_UPDATE_SOURCE`
>
> Update an existing Segment Source by ID, changing its name, slug, enabled status, or type-specific settings. Provide at least one of these fields. The returned Source may reflect the submitted values rather than independently confirmed settings.
>
> #### Input Parameters
>
> **name** `string`
>
> Human-readable name for the Source (displayName).
>
> **slug** `string`
>
> Slug that identifies the Source (config name).
>
> **enabled** `boolean`
>
> Whether the Source can send data.
>
> **settings** `object`
>
> Key-value settings specific to the Source type; see Sources catalog for required options.
>
> **sourceId** `string` *required*
>
> The Source ID. Length 1–255 characters.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not
