> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Segment

> Manage sources and destinations in a Twilio Segment workspace

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: API key.
* **Connection**: The key comes from `SEGMENT_PUBLIC_API_TOKEN`.
* **Docs**: [https://docs.segmentapis.com/tag/Getting-Started](https://docs.segmentapis.com/tag/Getting-Started)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

| Variable                   | Required | Description                                                                                                                                 |
| -------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `SEGMENT_PUBLIC_API_TOKEN` | Yes      | Twilio Segment Public API token (Workspace Settings > Access Management > Tokens) [Docs](https://docs.segmentapis.com/tag/Getting-Started). |

## Setup

1. **Sign in to Segment**: Go to [https://app.segment.com](https://app.segment.com) and sign in. A free workspace is sufficient for testing.
2. **Create a Public API token**: Open Workspace Settings > Access Management > Tokens and click Create Token. Choose the Public API token type (not the legacy Config API) and grant Workspace Member or Owner scope as needed. Copy the token - it is shown only once.
3. **Set the environment variable**: Add the token to your .env as SEGMENT\_PUBLIC\_API\_TOKEN=...
4. **Verify access**: Run List Sources. EU-hosted workspaces must pass host=eu1.api.segmentapis.com on each call.

* The Public API authenticates with 'Authorization: Bearer \<token>'
* US workspaces use api.segmentapis.com (the default); EU workspaces use eu1.api.segmentapis.com via the host parameter
* Creating sources/destinations needs a catalog metadataId from the /catalog endpoints

Provider API reference: [https://docs.segmentapis.com/](https://docs.segmentapis.com/)

## Tools

| Tool               | Access | Description                                              |
| ------------------ | ------ | -------------------------------------------------------- |
| List Sources       | Read   | List sources in the Segment workspace                    |
| Get Source         | Read   | Get a source by ID                                       |
| Create Source      | Write  | Create a new source in the workspace                     |
| Update Source      | Write  | Update a source's name, slug, enabled state, or settings |
| List Destinations  | Read   | List destinations in the Segment workspace               |
| Get Destination    | Read   | Get a destination by ID                                  |
| Create Destination | Write  | Connect a new destination to a source                    |

## Example prompts

* List my Segment sources and destinations and show which destinations each source feeds.
* Find a Segment destination by name and disable it after confirming with me.
