---
updatedAt: 2026-09-04T16:20:51.000Z
agentTools:
  projectIndex: https://apidoc.factorialhr.com/llms.txt
---

# What are webhooks?

Receive real-time notifications from Factorial the moment an event happens, instead of polling the API.

Webhooks let your application receive real-time notifications when events occur in Factorial. Instead of repeatedly polling the API to check for changes, Factorial sends an HTTP `POST` request to a URL you control whenever a relevant event takes place.

<Callout icon="📘" theme="info">
  ### In one sentence

  "Knock on a door outside Factorial the moment something happens inside Factorial."
</Callout>

This is the recommended approach for keeping external systems in sync with Factorial data — for example, triggering an onboarding workflow when a new employee is created, or updating a payroll system when contract details change.

## Watch the walkthrough

A six-minute tour of everything in this section — the delivery loop, managing subscriptions, payloads, retries and troubleshooting.

<Callout icon="📘" theme="info">
  For the exact structure of each payload, follow [Payloads & Event Types](https://apidoc.factorialhr.com/docs/payloads-event-types) and the callback payload documented on each webhook in the [API Reference](https://apidoc.factorialhr.com/reference/webhooks) — those are the source of truth.
</Callout>

<Embed title="" typeOfEmbed="youtube" url="https://www.youtube.com/watch?v=xSWbny1XjN8" html="%3Ciframe%20class%3D%22embedly-embed%22%20src%3D%22%2F%2Fcdn.embedly.com%2Fwidgets%2Fmedia.html%3Fsrc%3Dhttps%253A%252F%252Fwww.youtube.com%252Fembed%252FxSWbny1XjN8%253Ffeature%253Doembed%26display_name%3DYouTube%26url%3Dhttps%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253DxSWbny1XjN8%26image%3Dhttps%253A%252F%252Fi.ytimg.com%252Fvi%252FxSWbny1XjN8%252Fhqdefault.jpg%26type%3Dtext%252Fhtml%26schema%3Dyoutube%22%20width%3D%22854%22%20height%3D%22480%22%20scrolling%3D%22no%22%20title%3D%22YouTube%20embed%22%20frameborder%3D%220%22%20allow%3D%22autoplay%3B%20fullscreen%3B%20encrypted-media%3B%20picture-in-picture%22%20allowfullscreen%3D%22true%22%3E%3C%2Fiframe%3E" />

## Why webhooks instead of polling

|                    | Polling                                                       | Webhooks                                            |
| ------------------ | ------------------------------------------------------------- | --------------------------------------------------- |
| **How it works**   | Your system calls the API on a schedule and looks for changes | Factorial calls your system when the change happens |
| **Latency**        | As long as your polling interval                              | Near real time                                      |
| **Request volume** | High — most calls return nothing new                          | One request per actual event                        |
| **Missed changes** | Possible between intervals                                    | Delivered as they occur, with retries               |

Webhooks let you build integrations that sync data between platforms, trigger downstream processes, update an external directory, or drive any workflow that should start the instant something changes in Factorial.

<Callout icon="🚧" theme="warn">
  ### Technical prerequisites

  Webhooks can be consumed directly by your own service, or through an intermediary automation platform (for example an iPaaS or workflow tool). Consuming them directly requires a publicly reachable HTTPS endpoint and the ability to handle incoming HTTP requests.
</Callout>

## How the delivery loop works

1. You register a **webhook subscription** with Factorial, providing a `target_url` that your server exposes publicly.
2. When a subscribed event occurs in Factorial, a `POST` request is sent to your endpoint with a JSON payload describing the event.
3. Your server processes the payload and responds with an HTTP `2xx` status code to acknowledge receipt.

```
  ┌────────────┐                                   ┌─────────────┐
  │            │  1. POST /your-endpoint           │             │
  │ Factorial  │ ────────────────────────────────▶ │ Your server │
  │            │     JSON body: the resource       │             │
  │            │                                   │             │
  │            │  2. HTTP 200 OK                   │             │
  │            │ ◀──────────────────────────────── │             │
  └────────────┘                                   └─────────────┘
        │
        │ 3. No 2xx or timeout → retry (see Webhooks Policies)
        ▼
```

<Callout icon="❗️" theme="error">
  ### Your endpoint must be publicly accessible over HTTPS

  Factorial cannot deliver to `localhost`, private network addresses, or endpoints behind authentication that rejects our request. Plain HTTP is not supported.
</Callout>

## Choosing your endpoint URLs

You can use the same `target_url` for every subscription, or a dedicated URL per event type.

Using a single URL for all events keeps your infrastructure simple, but your handler must inspect the payload to tell events apart. Using one URL per subscription type makes routing explicit and is usually easier to maintain.

## Request headers

Every delivery includes standard HTTP headers plus the following Factorial-specific headers.

| Header                     | Always sent                                       | Description                                                                                                                                                                                  |
| -------------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `x-factorial-wh-challenge` | Only if a `challenge` was set on the subscription | Echoes the `challenge` value you defined when creating the subscription, so you can verify the request originates from your subscription. See [Webhooks Subscriptions](https://apidoc.factorialhr.com/docs/manage-webhooks). |
| `x-factorial-author-id`    | No                                                | ID of the employee or company that triggered the event.                                                                                                                                      |
| `x-factorial-author-type`  | No                                                | Either `employee` or `company`.                                                                                                                                                              |

The author headers are sent only when the author can be safely exposed to the subscriber. If the author is not visible to the subscriber, the headers are omitted. They are metadata only and do not change the payload body.

## What's in this section

| Page                                                                   | What it covers                                                    |
| ---------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [Webhooks Subscriptions](https://apidoc.factorialhr.com/docs/manage-webhooks)                          | Creating, listing, enabling, disabling and deleting subscriptions |
| [Payloads & Event Types](https://apidoc.factorialhr.com/docs/payloads-event-types)                     | Payload structure and the events you can subscribe to             |
| [Webhooks Policies](https://apidoc.factorialhr.com/docs/webhooks-policies)                             | Retries, failure notifications and permissions                    |
| [Best Practices & Troubleshooting](https://apidoc.factorialhr.com/docs/best-practices-troubleshooting) | Building a reliable handler and diagnosing problems               |
| [Practical Example: Clock In a Shift](https://apidoc.factorialhr.com/docs/webhook-attendance-clock-in) | An end-to-end worked example                                      |

<Callout icon="📘" theme="info">
  ### Full list of available webhooks

  Every subscription type Factorial supports is listed in the **Webhooks** section of the [API Reference](https://apidoc.factorialhr.com/reference/webhooks), together with the callback payload for each one.
</Callout>