# Webhooks

## Create a webhook

<mark style="color:green;">`POST`</mark> `https://harmonizely.com/api/webhooks`

Creates a new webhook object.

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |
| X-API-KEY    | string | Your API key     |

#### Request Body

| Name   | Type   | Description                                                                                                                                                |
| ------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| events | array  | <p>The list of events to enable for this endpoint.<br>Possible values:<br><code>\["meetingScheduled", "meetingCancelled", "meetingRescheduled"]</code></p> |
| secret | string | The endpoint's secret used to generate webhook signatures.                                                                                                 |
| url    | string | The webhook URL.                                                                                                                                           |

{% tabs %}
{% tab title="201 Webhook successfully created." %}

```javascript
{
    "events": [
        "meetingScheduled",
        "meetingCancelled",
        "meetingRescheduled"
    ],
    "url": "https://example.com/webhook",
    "secret": "something",
    "created_at": "2021-05-25T06:17:58+00:00",
    "uuid": "3e687c78-a8b8-4837-9333-57e3d807e61c"
}
```

{% endtab %}

{% tab title="422 Invalid arguments." %}

```javascript
{
    "message": "Invalid arguments",
    "errors": {
        "url": [
            "This value is not a valid URL."
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## List all webhooks

<mark style="color:blue;">`GET`</mark> `https://harmonizely.com/api/webhooks`

Lists all webhooks.

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |
| X-API-KEY    | string | Your API key     |

{% tabs %}
{% tab title="200 Returns a list of all webhooks." %}

```javascript
{
    "page": 1,
    "limit": 10,
    "pages": 1,
    "total": 1,
    "_embedded": {
        "items": [
            {
                "events": [
                    "meetingRescheduled",
                    "meetingCancelled",
                    "meetingScheduled"
                ],
                "url": "https://example.com/webhook",
                "secret": null,
                "created_at": "2021-05-24T11:04:11+00:00",
                "uuid": "2ba9ee0b-e62a-43bd-aed0-31b26056ecdc"
            }
        ]
    },
    "_links": {
        "self": {
            "href": "/api/webhooks?page=1&limit=10"
        },
        "first": {
            "href": "/api/webhooks?page=1&limit=10"
        },
        "last": {
            "href": "/api/webhooks?page=1&limit=10"
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Delete a webhook

<mark style="color:red;">`DELETE`</mark> `https://harmonizely.com/api/webhooks/:id`

Deletes a webhook.

#### Path Parameters

| Name | Type   | Description                              |
| ---- | ------ | ---------------------------------------- |
| id   | string | Unique identifier of the webhook (UUID4) |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |
| X-API-KEY    | string | Your API key.    |

{% tabs %}
{% tab title="204 Webhook successfully deleted." %}

```
```

{% endtab %}

{% tab title="404 Webhook not found." %}

```javascript
{
    "code": 404,
    "message": "Not found."
}
```

{% endtab %}
{% endtabs %}


---

# 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://developers.harmonizely.com/harmonizely-api/webhooks.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.
