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

# Connect Segment, PostHog, Mixpanel, and Amplitude to Default by webhook

> Segment, PostHog, Mixpanel, and Amplitude connect to Default by webhook, not natively, so product events start workflows through the Incoming Webhook trigger and the Send to Webhook node sends Default data back to them.

Segment, PostHog, Mixpanel, and Amplitude connect to Default by webhook. Default has no native
integration with them: none of them has a card on the **Integrations** page. Events come into Default
through a workflow's **Incoming Webhook** trigger, and Default sends data back out with the
**Send to Webhook** node.

## How product analytics data flows to and from Default

| Direction | How it works | Default side |
| - | - | - |
| Into Default | The analytics tool sends each event as a `POST` request with a JSON body to a Default webhook URL. | [**Incoming Webhook** trigger](/workflows/triggers#incoming-webhook), authenticated with the [webhook secret](/settings/webhook-secret) |
| Out of Default | A workflow sends an HTTP request to the analytics tool's API. | [**Send to Webhook** node](/workflows/steps-actions#send-to-webhook) |

Default does not pull events, users, or cohorts from these tools. The tool, or a service you run, has
to send them.

## Send product events into Default

<Steps>
  <Step title="Add the Incoming Webhook trigger">
    In **Workflows**, create a workflow and add the **Incoming Webhook** trigger. Under
    **Connected Webhook**, select **Create new webhook**, or choose an existing webhook.
  </Step>

  <Step title="Copy the URL and the secret">
    Copy the **Ingestion URL**. Reveal and copy the **Bearer secret**. It is your workspace's
    [webhook secret](/settings/webhook-secret), shared by every webhook in the workspace.
  </Step>

  <Step title="Point the analytics tool at Default">
    In Segment, PostHog, Mixpanel, or Amplitude, set up a webhook or HTTP request that sends a `POST`
    with a JSON body to the **Ingestion URL**, with the header `Authorization: Bearer <secret>`.
  </Step>

  <Step title="Capture a sample event">
    Select **Listen for test event**, then send 1 event from the tool. For the next 5 minutes, Default
    saves the first request it receives as the **Captured payload** and does not start the workflow
    with it. You can also select **Paste a sample**, paste an example event, and select
    **Save sample**.
  </Step>

  <Step title="Map the person or company (optional)">
    Under **Identity mapping**, choose the payload field that holds the **Person email** or the
    **Company domain**, so Default knows who the event is about.
  </Step>

  <Step title="Build, test, and publish">
    Add the nodes that act on the event. Type `{{` in a field to insert values from the captured
    payload. Select **Test**, then **Run Test**, to try it. Select **Publish**, then check that the
    status next to the [deployment switch](/workflows#the-deployment-switch) reads **Live**. A new
    workflow goes live when you first publish it. If the status reads **Paused**, turn the switch
    on. Events the tool sends now start the workflow.
  </Step>
</Steps>

Product events repeat, and the same person can send many of them. Before a workflow routes or
creates records, check for an existing CRM record with **Match Record**. Route and create only on the
**No Match** branch, so existing records keep their owners. See
[CRM nodes](/workflows/steps-crm#match-record).

## Example product event payload

Default accepts any JSON body, so the field names come from the analytics tool. A request looks like
this:

```bash theme={null}
curl --request POST "$DEFAULT_INGESTION_URL" \
  --header "Authorization: Bearer $DEFAULT_WEBHOOK_SECRET" \
  --header "Content-Type: application/json" \
  --data '{
    "event": "Trial Started",
    "email": "jane@acme.com",
    "properties": { "plan": "Pro", "company": "Acme" }
  }'
```

A request that Default accepts gets status `200` and a body with `"accepted": true`:

```json theme={null}
{ "accepted": true }
```

With this payload, set **Person email** under **Identity mapping** to `email`. Later nodes can pick
`event`, and `plan` under `properties`, from the data picker.

## Webhook request rules for analytics events

* Method: `POST`.
* Body: JSON, up to 1 MB. Any shape works. Malformed JSON gets a `400` response, and a larger body
  gets a `413`. A mapped **Person email** field that holds text that is not a valid email address
  also gets a `400`. An empty or non-text value is not checked: the run starts with the
  **Company domain** instead, if one is mapped, or with no person or company.
* Authentication: `Authorization: Bearer <webhook secret>`. A missing or wrong secret gets a `401`.
* Runs: each request starts 1 run of every published, enabled workflow that uses the webhook. A
  body that holds an array of events starts 1 run with the whole array, so send 1 event per request.
  Default answers `200` even when no published, enabled workflow uses the webhook.
* Paused webhook: turning off the webhook's **Active** switch in the trigger makes Default reject
  requests with a `410`.

## Send Default data to a product analytics tool

Use **Send to Webhook** to send an event or a user update to the analytics tool's API, for example
when a meeting is booked or a lead is routed.

<Steps>
  <Step title="Choose the trigger">
    Start the workflow with the trigger that matches the moment, for example **Meeting Status** with
    **Meeting statuses** set to **Booked**. See [Triggers](/workflows/triggers#meeting-status).
  </Step>

  <Step title="Point Send to Webhook at the tool">
    Add **Send to Webhook**. Set **Request Type** to **POST** and **Request URL** to the endpoint in
    the tool's API documentation.
  </Step>

  <Step title="Set the authorization">
    Under **Authorization**, choose what the tool's API expects: **API Key**, **Token**, or **Basic**.
  </Step>

  <Step title="Build the body and publish">
    Build the **Body** under **Fields** or **JSON**. Type `{{` to insert values, such as the lead's
    email or the meeting time. Publish the workflow and check that its status reads **Live**. If it
    reads **Paused**, turn on the [deployment switch](/workflows#the-deployment-switch). Each booked
    meeting now sends an event to the tool.
  </Step>
</Steps>

Testing is not available yet for workflows that start from a **Meeting Status** trigger. The request
must reach a public `http` or `https` address. Default stops a request after 30 seconds and does not
follow redirects. See [Send to Webhook](/workflows/steps-actions#send-to-webhook).

## What Default does not support with product analytics tools

* A native Segment, PostHog, Mixpanel, or Amplitude integration, or a card for them on the
  **Integrations** page.
* Pulling events, users, or cohorts from these tools on a schedule.
* Webhooks without an `Authorization: Bearer` header. If a tool cannot set that header, put a service
  that can between the tool and Default.
* Splitting a batch of events into separate runs.

Related: [Default integrations](https://www.default.com/integrations)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.