> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.unrubble.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Webhooks

Webhook is a simple and effective communication mechanism that allows you to share data with other applications in real time. The data is delivered immediately after the event is executed, without need to frequently query the application via API.

## Outgoing webhook

In Unrubble you can define webhooks for three events:

1. `New time off request`
2. `Accepted time off request modified`
3. `Accepted time off request deleted`

### Adding a webhook

Go to `Settings` (by clicking on the account icon) > `Integrations` tab and press the green `Configuration` button in the Webhook integration.

![](https://storage.crisp.chat/users/helpdesk/website/11ee26a505815800/webhookssettings_1uj99al.png)

### Configuration

1. `Type` - Select from the list the event for which you want to define the webhook,
2. Add your own `URL`,
3. Define a `Token` (optional).

|| The token used for authorization is **optional**. If it is entered, it will be included in the request in the form of a "token" header.

|| If the two-step acceptance of leave requests in Unrubble is enabled, the event will be sent only after full acceptance (2 people).

### Sending

Webhooks are sent when:
✅ The time off request is accepted
✅ The time off request is edited and saved
✅ The **approved** time off request will be deleted
❌ The time off request will be added
❌ A time off request that is not accepted will be deleted
❌ The time off request will be approved by one of the two

Webhook format for an approved vacation request and a modified one:
``{
    "applicationNumber": "2020/1",
    "applicationType": "Paid time off",
    "acronym": "123",
    "applicantFullName": "Name and Surname",
    "startDateTimeUtc": "1600034400",
    "endDateTimeUtc": "1600552800",
    "ignoreWeekends": "true",
    "ignoreHolidays": "true",
    "isWholeDay": "true",
    "note": "Note"
}``

Webhook format for deleted accepted application:
``{
    "applicationNumber": "2020/1"
}``