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

# Managing Webhooks via API

> [!WARNING]
>
> You are viewing the documentation of release 26.1, which is no longer the current one. [Go to the documentation of the current release 26.2](https://developers.circularo.com/).

In this section, we'll guide you through the process of managing webhooks using Circularo's API. You'll find detailed instructions on how to **create**, **view**, and **delete** webhooks.

> [!NOTE]
>
> To manage webhooks, you need to be either a team admin or a global admin.

## Create new webhook

**Endpoint:**

```http theme={null}
POST /webhooks?token=:authenticationToken
```

### Create webhook from global admin account

Global admins can create webhooks for the entire tenant or for a specific team.

**Tenant-Wide Webhook:** To create a webhook that works for all documents tenant-wide, send a request like this:

```http theme={null}
POST /webhooks?token=:authenticationToken

{
  "type": "tenant",
  "callbackUrl": "https://www.valid.url/callback",
  "hmacSecret": "optionalHMAC"
}
```

**Team-Wide Webhook:** To create a webhook that works for team documents only, send a request like this:

```http theme={null}
POST /webhooks?token=:authenticationToken

{
  "type": "team",
  "name": "teamName",
  "callbackUrl": "https://www.valid.url/callback",
  "hmacSecret": "optionalHMAC"
}
```

### Create webhook from team admin account

Team admins can create webhooks for their specific team.

**Team-Wide Webhook:** To create webhook that works for team documents only, send a request like this:

```http theme={null}
POST /webhooks?token=:authenticationToken

{
  "type": "team",
  "callbackUrl": "https://www.valid.url/callback",
  "hmacSecret": "optionalHMAC"
}
```

### Response example

```json theme={null}
{
  "id": "aX5dsEEd2eDfaJz8R",
  "creator": "teamAdminUser",
  "createDate": "2022-06-24T13:05:10.500Z",
  "type": "team",
  "name": "myTeam",
  "callbackUrl": "https://www.valid.url/callback",
  "hmacSecret": "optionalHMAC"
}
```

## View existing webhooks

**Endpoint**

```http theme={null}
GET /webhooks?token=:authenticationToken
```

This allows you to see all existing webhooks. Global admin can see all existing webhooks, while team admins see only their team's webhooks.

**Response**

```json theme={null}
{
  "results": [
    {
      "id": "aX5dsEEd2eDfaJz8R",
      "creator": "teamAdminUser",
      "createDate": "2024-06-01T13:10:10.500Z",
      "type": "team",
      "name": "myTeam",
      "callbackUrl": "https://www.valid.url/callback",
      "hmacSecret": "optionalHMAC"
    }
  ],
  "total": 1
}
```

## Delete webhook

**Endpoint**

```http theme={null}
DELETE /webhooks/:id?token=:authenticationToken
```

This endpoint allows you to delete a webhook. Global admins can delete any webhook, while team admins can delete only their team's webhooks.


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