# Webhooks types

## 🔍 Get webhooks subscriptions

<mark style="color:green;">**`GET`**</mark>/webhooks/subscriptions

Retrieve all webhook subscriptions registered by the client.

**Headers**

<table><thead><tr><th width="345">Name</th><th>Value</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td><code>application/json</code></td></tr><tr><td><code>Authorization</code></td><td><code>Bearer &#x3C;token></code></td></tr></tbody></table>

**Query params**

<table><thead><tr><th width="345">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>next_cursor</code></td><td>string</td><td>Pagination cursor</td></tr><tr><td><code>limit</code></td><td>int</td><td>Elements limit per page</td></tr></tbody></table>

**Response**&#x20;

```json
{
    "data": [
        {
            "endpoint": "http://localhost:8183/main-page/webhook",
            "id": 9,
            "webhook_type": "RESERVATION_CREATED"
        },
        {
            "endpoint": "http://localhost:8183/main-page/webhook",
            "id": 10,
            "webhook_type": "RESERVATION_UPDATED"
        }
    ]
}
```

## 🔍 Get webhooks subscriptions by ID

<mark style="color:green;">**`GET`**</mark> /webhooks/subscription/{id}

Retrieve a specific webhook subscription by its ID.

**Response**

```json
{
    "data": [
        {
            "endpoint": "http://localhost:8183/main-page/webhook",
            "id": 10,
            "webhook_type": "RESERVATION_UPDATED"
        }
    ]
}
```

## 🆕 Create webhook subscription

<mark style="color:yellow;">**`POST`**</mark> /webhooks/subscription

Registers a new webhook subscription for a specific event type.

**Headers**

| Name            | Value                |
| --------------- | -------------------- |
| `Content-Type`  | `application/json`   |
| `Authorization` | `Bearer <token>`     |
| `Property`      | `<your_property_id>` |

**Body**

<table><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody><tr><td><code>endpoint</code></td><td><pre><code>http://localhost:8183/main-page/webhook
</code></pre></td></tr><tr><td><pre><code>webhook_type
</code></pre></td><td><pre><code>RESERVATION_CREATED
</code></pre></td></tr></tbody></table>

```json
{
    "endpoint": "http://localhost:8183/main-page/webhook",
    "webhook_type": "RESERVATION_CREATED"
}
```

**Response**

```json
{
    "data": [
        {
            "endpoint": "http://localhost:8183/main-page/webhook",
            "id": 9,
            "webhook_type": "RESERVATION_CREATED"
        }
    ]
}
```

## 🔁 Update webhook subsciption

<mark style="color:blue;">**`PUT`**</mark> /webhook/subscription/{id}

Updates the details of an existing webhook subscription.

**Headers**

| Name            | Value              |
| --------------- | ------------------ |
| `Content-Type`  | `application/json` |
| `Authorization` | `Bearer <token>`   |

**Body**

<table><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody><tr><td><code>endpoint</code></td><td><pre><code>http://localhost:8183/second-page/webhook
</code></pre></td></tr><tr><td><pre><code>webhook_type
</code></pre></td><td><pre><code>RESERVATION_CREATED
</code></pre></td></tr></tbody></table>

**Response**

```json
{
    "data": [
        {
            "endpoint": "http://localhost:8183/second-page/webhook",
            "id": 9,
            "webhook_type": "RESERVATION_CREATED"
        }
    ]
}
```

## 🗑️ Delete webhook subscription

<mark style="color:red;">**`DELETE`**</mark> /webhook/subscription/{id}

Deletes a specific webhook subscription by its ID.

**Headers**

| Name            | Value              |
| --------------- | ------------------ |
| `Content-Type`  | `application/json` |
| `Authorization` | `Bearer <token>`   |

**Response**

```
{
    "data": [
        {
            "endpoint": "http://localhost:8183/second-page/webhook",
            "id": 9,
            "webhook_type": "RESERVATION_CREATED"
        }
    ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://octotable-1.gitbook.io/octotable-api/webhooks/webhooks-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
