> For the complete documentation index, see [llms.txt](https://help.parta.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.parta.io/workspace/set-a-workspace/set-up-company-settings/set-up-webhooks.md).

# Set up Webhooks

Send company events, such as exports and comments, to external services.

### What are Webhooks?

A **Webhook** is a notification about an event in your company that Parta.io sends to an external URL.

Use webhooks to connect Parta.io to other tools, e.g. to post a message to a team channel when a course export is completed or a new comment is added.

The following events are available:

| **Event**        | **Sent when**                  |
| ---------------- | ------------------------------ |
| Comment created  | A new comment is added.        |
| Export completed | A Project export is completed. |

{% hint style="warning" %}
If webhooks are not enabled for your company, the **Webhooks** tab is not available in the **Company Settings**.
{% endhint %}

### Add a Webhook

{% stepper %}
{% step %}
Go to the **Company Settings** and select the **Webhooks** tab.
{% endstep %}

{% step %}
Click **+** next to **Webhooks**.

A pop-up window will appear.
{% endstep %}

{% step %}
Enter a webhook name in the **Name** field.
{% endstep %}

{% step %}
Enter the endpoint URL in the **Link** field.
{% endstep %}

{% step %}
Select one or more events in the **Events** field.

The event variables and a request preview will appear.
{% endstep %}

{% step %}
Set the request body in the **Body template** field.

* Keep the default template to send the standard envelope;
* Click **Insert preset** to add a ready-made template;
* Click **Reset to default** to return to the standard envelope.
  {% endstep %}

{% step %}
Click the **Save** button.

The webhook will appear in the **Webhooks** list.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
The body template must be valid JSON with `{{path}}` placeholders. Use `{{json.path}}` for numbers, objects and fields that can be empty.
{% endhint %}

The standard envelope contains the following fields:

| **Field**    | **Description**                                                                          |
| ------------ | ---------------------------------------------------------------------------------------- |
| `id`         | A unique event ID.                                                                       |
| `type`       | The event type, e.g. `export.completed`.                                                 |
| `apiVersion` | The version of the webhook format.                                                       |
| `created`    | The date and time of the event.                                                          |
| `data`       | The event details: the object, the user who triggered the event and the related Project. |

### View Webhook Deliveries

{% stepper %}
{% step %}
Go to the **Company Settings** and select the **Webhooks** tab.

The **Webhooks** list shows the **Name**, **Link**, **Events**, **Body format**, **Last delivery** and **Status** of each webhook.
{% endstep %}

{% step %}
Scroll down to the **Delivery history** table.

The table shows the requests sent to your endpoints: **Delivery ID**, **Webhook**, **Event**, **Status**, **Attempts**, **Request**, **Response**, **Date created** and **Completed**.
{% endstep %}

{% step %}
Click **Filter** or select a period (e.g. **Last 25**) to narrow the list.
{% endstep %}
{% endstepper %}
