# Webhook Payload

Every webhook notification is a HTTP POST request that contains three main parts:

1. The type of event that occurred
2. When it happened
3. The detailed event data

Here's the complete structure broken down:

### Webhook Payload

Every webhook notification sent consists of three core components:

* Event Type - What kind of action occurred (created, cancelled, etc.)
* Timestamp - When the action happened
* Event Data - The complete details of the booking

| Field        | Type   | Description                                                                                             |
| ------------ | ------ | ------------------------------------------------------------------------------------------------------- |
| `type`       | string | The type of event that triggered the webhook (e.g., `event.created,event.rescheduled, event.cancelled`) |
| `created_at` | string | ISO 8601 timestamp of when the webhook was generated                                                    |
| `data`       | Event  | Contains the detailed event information (see Event Fields below)                                        |

### **Event Fields**

The comprehensive event data structure containing all information about an event, including timing, participants, location, and any relevant team details.

| Field       | Type                   | Description                                              |
| ----------- | ---------------------- | -------------------------------------------------------- |
| `id`        | string                 | Unique identifier for the event                          |
| `startDate` | string                 | Start time of the event in ISO 8601 format               |
| `duration`  | number                 | Duration of the event in minutes                         |
| `cancelled` | boolean                | (Optional) Whether the event has been cancelled          |
| `eventName` | string                 | Name/title of the event                                  |
| `invite`    | EventInviteApiResponse | Event invite details                                     |
| `location`  | Location               | (Optional) Location information for the event            |
| `hosts`     | array\[Host]           | Array of event hosts/organizers                          |
| `attendees` | array\[Attendee]       | Array of event attendees                                 |
| `team`      | Team                   | (Optional) Team information if the event is team-related |

### Location

Specifies where and how the meeting will take place, including all necessary details for online meetings if applicable.

| Field                    | Type   | Description                                         |
| ------------------------ | ------ | --------------------------------------------------- |
| `locationType`           | string | Type of location (e.g., "online", "in-person")      |
| `locationText`           | string | (Optional) Location text if using a custom location |
| `onlineMeeting`          | object | (Optional) Online meeting details if applicable     |
| `onlineMeeting.url`      | string | Meeting URL                                         |
| `onlineMeeting.id`       | string | (Optional) Meeting ID                               |
| `onlineMeeting.passcode` | string | (Optional) Meeting passcode                         |

### Attendee

Represents a participant in the meeting, including their contact information and any custom responses they provided during booking.

<table><thead><tr><th width="263">Field</th><th width="222">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td>string</td><td>(Optional) Attendee's full name</td></tr><tr><td><code>email</code></td><td>string</td><td>Attendee's email address</td></tr><tr><td><code>timezone</code></td><td>string</td><td>(Optional) Attendee's timezone</td></tr><tr><td><code>phoneNumber</code></td><td>string</td><td>(Optional) Attendee's phone number</td></tr><tr><td><code>type</code></td><td>string</td><td>Identifies the attendee's role: either <code>invitee</code> (primary booker) or <code>guest</code> (additional attendee)</td></tr><tr><td><code>customQuestionAnswers</code></td><td><p>array[{</p><p>  question: string, </p><p>  answer: string</p><p>}]</p></td><td>(Optional) Responses to custom booking questions</td></tr></tbody></table>

### Host

Represents an organizer or host of the meeting, containing their essential contact information.

> **Note about team events:**
>
> * For collective team invites: Contains all team members included in the event
> * For round robin invites: Contains the selected team member for the event

| Field   | Type   | Description                 |
| ------- | ------ | --------------------------- |
| `name`  | string | (Optional) Host's full name |
| `email` | string | Host's email address        |

### Team

For invites related to a team, this contains information about the team associated with the event.

| Field  | Type   | Description                    |
| ------ | ------ | ------------------------------ |
| `id`   | string | Unique identifier for the team |
| `name` | string | Name of the team               |

## Sample Payload

```
{
  "type": "event.created",
  "created_at": "2025-02-09T14:46:11.469Z",
  "data": {
    "id": "sample-event-id",
    "startDate": "2025-02-12T20:30:00.000Z",
    "duration": 30,
    "cancelled": false,
    "eventName": "Jane Doe and John Smith",
    "location": {
      "locationType": "zoom",
      "onlineMeeting": {
        "url": "https://us05web.zoom.us/j/123456789?pwd=AbDeFR2Mebh0vioMYCvLsb2RA3fR.1",
        "id": "123456789",
        "passcode": "Ac0QRP"
      }
    },
    "hosts": [
      {
        "name": "John Smith",
        "email": "john.smith@gmail.com"
      }
    ],
    "attendees": [
      {
        "name": "Jane Doe",
        "email": "jane.doe@gmail.com",
        "timezone": "America/New_York",
        "type": "invitee",
        "customQuestionAnswers": [
          {
            "question": "What is your favorite color?",
            "answer": "Blue"
          },
          {
            "question": "Select all options you would like:",
            "answer": [
              "Option 1",
              "Option 3"
            ]
          }
        ]
      },
      {
        "email": "guest@example.com",
        "type": "guest"
      }
    ],
    "invite": {
      "id": "aZbYc_8",
      "name": "30 minute call",
      "inviteType": "one_on_one",
      "description": "Meet with John for 30 minutes!"
    }
  }
}
```
