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

# Webhooks

> Register and remove webhooks to get notified when a room is completed.

## Endpoints

| Method | Path                      | Description      |
| ------ | ------------------------- | ---------------- |
| `POST` | `/api/v2/webhooks`        | Create a webhook |
| `POST` | `/api/v2/webhooks/delete` | Delete a webhook |

***

## Create a webhook

`POST /api/v2/webhooks`

<ParamField body="url" type="string" required>
  The endpoint that will receive webhook events.
</ParamField>

<ParamField body="type" type="string" required>
  Event type to subscribe to. Currently supported: `FLOW_COMPLETED`.
</ParamField>

```json Example theme={null}
{
  "url": "https://your-server.com/webhook",
  "type": "FLOW_COMPLETED"
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.flowla.com/api/v2/webhooks \
    -H "x-flowla-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://your-server.com/webhook",
      "type": "FLOW_COMPLETED"
    }'
  ```

  ```python Python theme={null}
  import requests

  requests.post(
      "https://api.flowla.com/api/v2/webhooks",
      headers={"x-flowla-api-key": "YOUR_API_KEY"},
      json={
          "url": "https://your-server.com/webhook",
          "type": "FLOW_COMPLETED",
      },
  )
  ```

  ```js JavaScript theme={null}
  await fetch("https://api.flowla.com/api/v2/webhooks", {
    method: "POST",
    headers: {
      "x-flowla-api-key": "YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      url: "https://your-server.com/webhook",
      type: "FLOW_COMPLETED",
    }),
  });
  ```
</CodeGroup>

***

## Delete a webhook

`POST /api/v2/webhooks/delete`

<ParamField body="id" type="string" required>
  ID of the webhook to remove.
</ParamField>

```json Example theme={null}
{ "id": "<webhook_id>" }
```

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.flowla.com/api/v2/webhooks/delete \
    -H "x-flowla-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"id": "<webhook_id>"}'
  ```

  ```python Python theme={null}
  requests.post(
      "https://api.flowla.com/api/v2/webhooks/delete",
      headers={"x-flowla-api-key": "YOUR_API_KEY"},
      json={"id": "<webhook_id>"},
  )
  ```

  ```js JavaScript theme={null}
  await fetch("https://api.flowla.com/api/v2/webhooks/delete", {
    method: "POST",
    headers: {
      "x-flowla-api-key": "YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ id: "<webhook_id>" }),
  });
  ```
</CodeGroup>
