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

# Calendly

> Each new invitee in Calendly creates their Contact and their Company.

## What it brings into Brein

Every time someone books with your Calendly, Brein creates or fills in their **Contact** and their **Company** (by the domain of their work email). If you ask at connect time, it also opens an **Opportunity**.

| From Calendly | Goes to |
| - | - |
| Invitee's name | Contact name |
| Invitee's email | Contact email |
| Number for text reminders | Contact phone |
| Questions and answers from the booking form | History only |

## Connect it

Calendly has no screen to create webhooks: they are created with its API. You need a Calendly access token that can read scheduled events.

<Steps>
  <Step title="In Brein">
    Go to **Settings → Integrations → Connect → Calendly**. Copy the **address** and the **secret**. The secret is shown only once.
  </Step>

  <Step title="Create the webhook in Calendly">
    With the Calendly API (*Create Webhook Subscription*), send a `POST` request to `https://api.calendly.com/webhook_subscriptions`:

    ```bash theme={"theme":"github-light"}
    curl -X POST "https://api.calendly.com/webhook_subscriptions" \
      -H "Authorization: Bearer $CALENDLY_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "url": "https://api.trybrein.com/api/v1/door/<Source id>",
        "events": ["invitee.created"],
        "organization": "https://api.calendly.com/organizations/<your organization>",
        "scope": "organization",
        "signing_key": "<the Brein secret>"
      }'
    ```

    `signing_key` takes the secret you copied from Brein. That way Calendly signs each notice and Brein verifies it.
  </Step>

  <Step title="Test">
    Book a test meeting. You will see the Arrival in Brein.
  </Step>
</Steps>

## Which events to choose

Only `invitee.created`, which is when someone books. Brein ignores the rest.

## Limits

* Calendly creates webhooks only through its API, and the Brein secret goes in as `signing_key` when you create it. If the webhook already exists without that key, delete it and create it again.
* A cancelled meeting changes nothing on the Contact.

More about results, how people are recognized and privacy: [Integrations](/integrations). Source: [Calendly webhook signatures](https://developer.calendly.com/api-docs/overview/webhooks/webhook-signatures).


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