> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.tribalhabits.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Get notified when events happen in Tribal Habits.

Webhooks triggered from certain actions in code that will call URLs assigned by you.

Tribal Habits provides customers with the ability to have webhooks. Webhooks are a way for web applications to be notified of events in real-time.

To set up webhooks follow these instructions:
[https://support.tribalhabits.com/en/articles/9180944-can-i-create-webhooks-in-tribal-habits](https://support.tribalhabits.com/en/articles/9180944-can-i-create-webhooks-in-tribal-habits)

Webhooks must be enabled for your organisation. Each webhook is sent as an HTTP `POST` to your URL with a JSON body and the header `Content-Type: application/json`. The `event` field in the payload says which event occurred.

## Events

### Enrolment events

Each enrolment event is sent for both topic enrolments and pathway enrolments. `enrolment_data.knowledge_type` is `topic` or `pathway`.

| Event | Sent when |
| - | - |
| [`enrolment_created`](/api-reference/webhooks/enrolment-created) | A user is enrolled |
| [`enrolment_completed`](/api-reference/webhooks/enrolment-completed) | An enrolment is completed. This is also sent when an enrolment is created already completed, for example by an import |
| [`enrolment_updated`](/api-reference/webhooks/enrolment-updated) | An existing enrolment's dates change |
| [`enrolment_deleted`](/api-reference/webhooks/enrolment-deleted) | An enrolment is deleted. The payload describes the enrolment as it was before deletion |

## Delivery

Each event is sent once. If your URL cannot be reached, delivery is retried up to 3 times. A response with an error status code from your URL is not retried. Your endpoint should return a `2xx` status code promptly.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.