---
title: Set up a webhook
url: https://docs.triply.cc/how-to/set-up-a-webhook/
description: Have TriplyDB call a URL of your choosing whenever data or assets are added to a dataset,
  for example to trigger a CI pipeline.
---

# Set up a webhook

A webhook makes TriplyDB send a message to a URL whenever something changes in a dataset: to be
notified, or to set something else off, such as a pipeline.

1. Open the dataset's **Settings** from its left-hand sidebar, then the **Webhooks** section.
2. Click **Add webhook**. The dialog below appears.

    ![The "Add webhook" dialog](https://docs.triply.cc/assets/webhook.png)

3. Fill in the **Payload target**: the URL the message is sent to.
4. Choose the **Payload format**: JSON or Form-Encoded.
5. Under **Trigger events**, select the events that send a message:
    - **Graph import** — data is imported from another dataset on the same instance.
    - **Linked data upload** — someone uploads data that was not on the instance before.
    - **Asset upload** — an asset is uploaded.
6. Click **Add**.

The webhook is switched on as soon as it is added, and listed in the **Webhooks** section with a
toggle that switches it off and on, a pencil to change its settings and a bin to remove it. None
of these need the page's **Save** button.

![An active webhook in the dataset's settings](https://docs.triply.cc/assets/webhook_trigger_history.png)

## Example: trigger a GitLab pipeline

To run a GitLab pipeline every time an asset is uploaded to the dataset, use a
[pipeline trigger URL](https://docs.gitlab.com/ee/ci/triggers/) as the payload target and select
**Asset upload** as the trigger event:

```
https://gitlab.example.com/api/v4/projects/<project_id>/trigger/pipeline?token=<token>&ref=<ref_name>
```

## Related

- [Create an API token](https://docs.triply.cc/how-to/create-an-api-token/) — for the other direction: an outside system
  calling TriplyDB
- [Share and publish data](https://docs.triply.cc/how-to/share-and-publish/) — the rest of the dataset's settings page
