> For the complete documentation index, see [llms.txt](https://docs.getmesa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getmesa.com/connect/segment.md).

# Segment

### Connection <a href="#connect" id="connect"></a>

When you're setting up your first workflow with Segment, you'll need to add your Write Key so that your Segment "Source" is a connected app within MESA.

<figure><img src="/files/ieEiW7cp4XhmlDUFsvII" alt="Screenshot of the MESA Segment connection setup, add your Segment Write Key to connect the Source. Spotlight the Write Key field."><figcaption></figcaption></figure>

First, you will need to set up your Source for MESA to send to. The easiest Source type to use would be the [**HTTP Tracking API Source**](https://segment.com/docs/connections/sources/catalog/libraries/server/http-api/).

After the Source is set up, you will have to locate the Write Key for posting to that Source. It can be [found on the settings tab](https://segment.com/docs/connections/find-writekey/) or when you first create your Source.

1\. From the Segment dashboard, locate the Source under Sources (left hand side bar).

2\. Click on Settings and then API Keys. Click on the Copy button next to the Write Key.

3\. Paste the Write Key into your MESA workflow's Segment Action and click on Add Connection. Then, you are all set!

### Configure <a href="#configuring" id="configuring"></a>

#### How to send data from Segment to MESA <a href="#sendfromsegment" id="sendfromsegment"></a>

In order to send Segment data to MESA, first set up a new MESA Workflow, with the trigger as [Webhook](/tools/webhook.md).

<figure><img src="/files/vHAFHR75jJPOXJpg5daB" alt="Screenshot of the MESA workflow builder setting up a new workflow with the Webhook trigger. Spotlight the Webhook trigger."><figcaption></figcaption></figure>

Copy the Host field value from the MESA Trigger and navigate to the Segment dashboard to create a new [Webhooks](https://segment.com/docs/connections/destinations/catalog/webhooks/) Destinatio&#x6E;**.**

Click into Destinations and choose the Webhook Destination you just created, then navigate to the Mappings tab.

<figure><img src="/files/zds7Lkln4eSB3j370Plh" alt="Screenshot of the Segment Webhook Destination, navigate to the Mappings tab. Spotlight the Mappings tab."><figcaption></figcaption></figure>

Once you are inside the mapping, you should see this field to enter the URL for the Webhook.

<figure><img src="/files/l0457gmDALKinL0eo34N" alt="Screenshot of the Segment Webhook Destination mapping, the field to enter the Webhook URL. Spotlight the URL field."><figcaption></figcaption></figure>
