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

# Handling Requests

> Understand how to handle webhooks sent by MeetBit

MeetBit sends a `POST` request to destinations whenever the events that the destination has subscribed to occur. This section will explain the proper way of handling these requests.

## Request Format

Webhook requests sent by MeetBit follows a specific response format.

```http theme={null}
POST /your-destination HTTP/1.1
Host: your-system.com
Content-Type: application/json
X-Webhook-Id: abx-xyz
X-Webhook-Timestamp: 2024-08-22T01:04:05Z
X-Webhook-Signature: f7c3bc1d808e047...

{
  "event": "meeting_links.scheduled",
  "data": {
    "id": 1234
  }
}
```

### Headers

<ParamField header="X-Webhook-Id" type="string" required>
  The ID of the webhook. Used for idempotency.
</ParamField>

<ParamField header="X-Webhook-Timestamp" type="string" required>
  The ISO8601 timestamp of when the webhook was sent. Used to prevent replay attacks.
</ParamField>

<ParamField header="X-Webhook-Signature" type="string" required>
  The HMAC signature of the request. Used to verify authenticity.
</ParamField>

### Body

<ParamField body="event" type="string" required>
  The type of event that occurred.
</ParamField>

<ParamField body="data" type="object" required>
  The data about the event.
</ParamField>

## Processing Requests

After receiving a webhook request, **your endpoint must immediately respond with a `2XX` response**. Any processing your system is supposed to perform must be processed asynchronously. Processing the request synchronously may lead to unnecessary timeouts and retries.

Webhook requests have a timeout of 10 seconds only. If MeetBit doesn't receive a response within this period, or receives a non-2XX response code, the request will be marked as failed.

<Danger>
  MeetBit will only try to send a webhook for a maximum of 5 times.
</Danger>

## Idempotency

MeetBit does not ensure that a webhook for a certain event will only be ever sent once. Thus, a situation can occur where your system receives multiple webhooks for the same event.

To handle this, utilize the `X-Webhook-Id` header that is sent along with every webhook request. Once you receive a webhook, **save this ID before responding to the request**. If you receive another request with the same ID, you may safely ignore such request (but still respond with a `2XX` response code).
