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

# Segment

Frigade supports bidirectional reads and writes from Segment. This guide shows you how to get started in a few minutes.

## Sending Segment data to Frigade

You can set up Frigade as a destination for Segment identify, group, and track calls by using [Webhooks as a destination](https://segment.com/docs/connections/destinations/catalog/webhooks/).

<Steps>
  <Step title="Add webhook destination">
    Log in to your Segment account, open workspace, and select source. Click on **Add Destination** and search and select **Webhooks**.

    <img src="https://mintcdn.com/frigade-docs/vb0YqHQGpTytLgI7/images/segment-1.png?fit=max&auto=format&n=vb0YqHQGpTytLgI7&q=85&s=6c5d04e248ea13e47275a49a41d29b99" className="rounded" width="1684" height="1255" data-path="images/segment-1.png" />
  </Step>

  <Step title="Create mapping">
    Next after creating the destination, click the **Mappings** tab and add a new mapping:

    <img src="https://mintcdn.com/frigade-docs/vb0YqHQGpTytLgI7/images/segment-2.png?fit=max&auto=format&n=vb0YqHQGpTytLgI7&q=85&s=37908f8bb79f582c9e09cf06ee257573" className="rounded" width="1684" height="1255" data-path="images/segment-2.png" />
  </Step>

  <Step title="Select event types to send to Frigade">
    Select the event types you want to send to Frigade. In this example we select identify, group, and track, but you can select any event type you want to send to Frigade.

    <img src="https://mintcdn.com/frigade-docs/vb0YqHQGpTytLgI7/images/segment-3.png?fit=max&auto=format&n=vb0YqHQGpTytLgI7&q=85&s=8f7a0d6cbeec26ee36566068af74cdcd" className="rounded" width="1684" height="1255" data-path="images/segment-3.png" />
  </Step>

  <Step title="Add Frigade Webhook URL">
    Fill out the **Select mappings** as shown below using:

    * `https://api.frigade.com/v1/thirdParty/cdp/segment` as the URL
    * `POST` as **Method**
    * `100` as **Batch Size**. Note: if you send fewer than 500 events per day, it is recommended to set this to a lower value to avoid delays in sending events to Frigade.
    * Your secret Frigade API key (it will be the one prefixed with `api_private`). This key can be found in the dashboard under [API Keys](https://app.frigade.com/developer). Make sure to prefix it with `Bearer` as shown in the screenshot below.
    * `Authorization` as the key

    <img src="https://mintcdn.com/frigade-docs/vb0YqHQGpTytLgI7/images/segment-4.png?fit=max&auto=format&n=vb0YqHQGpTytLgI7&q=85&s=dc4edba3b13ba6b5c78facb695706ac5" className="rounded" width="1684" height="1255" data-path="images/segment-4.png" />

    Finally, set **Enable Batching?** to **Yes**. Optionally, you can send a test event to verify that the webhook is working. Click **Save** to save the webhook.
  </Step>

  <Step title="Turn on the webhook">
    Finally, turn on the webhook by turning on the mapping you just created. Then, open the **Settings** tab and enable the Destination.

    <img src="https://mintcdn.com/frigade-docs/vb0YqHQGpTytLgI7/images/segment-5.png?fit=max&auto=format&n=vb0YqHQGpTytLgI7&q=85&s=1f8e9228b06b13d248042ad2d3064ca1" className="rounded" width="1684" height="1255" data-path="images/segment-5.png" />

    Congratulations! You have successfully set up Frigade as a destination for Segment. You can now use Frigade's [Targeting](/platform/targeting) with your Segment data to create personalized experiences for your users.
  </Step>
</Steps>

## Sending Frigade data to Segment

Frigade also supports sending user and organization events from Frigade Flows to Segment.

<Steps>
  <Step title="Add your Segment write key">
    To send events to your Segment instance, select **Add Source** and then **HTTP API**. Then, copy your Segment write key.

    <img src="https://mintcdn.com/frigade-docs/vb0YqHQGpTytLgI7/images/segment-write.png?fit=max&auto=format&n=vb0YqHQGpTytLgI7&q=85&s=c6d0bb8874625bae5100bbbcd37596c7" className="rounded" width="3976" height="2282" data-path="images/segment-write.png" />
  </Step>

  <Step title="Add Segment in Frigade">
    Next, go to your Frigade dashboard and select **Integrations**. Click **Add Integration** and select **Segment**.

    <img src="https://mintcdn.com/frigade-docs/2ELnoUYc9O4Ydjzw/images/integrations/segment.png?fit=max&auto=format&n=2ELnoUYc9O4Ydjzw&q=85&s=15a5d94a542b9074e18bf200613df52c" width="3160" height="2036" data-path="images/integrations/segment.png" />

    You will be asked to enter your Segment write key. Click **Connect** to save the integration. Shortly after, events will start streaming from Frigade in real-time.
  </Step>
</Steps>
