> For the complete documentation index, see [llms.txt](https://yourpropfirm.gitbook.io/yourpropfirm-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yourpropfirm.gitbook.io/yourpropfirm-docs/developers/webhooks.md). Agents can also search and read this documentation through its [MCP server](https://yourpropfirm.gitbook.io/yourpropfirm-docs/~gitbook/mcp).

# Webhooks

Send events from YourPropFirm to your CRM, email marketing tool or back office the moment they happen. Set up a webhook, secure and test it, and manage it.

A webhook sends an event from YourPropFirm to another system the moment it happens, for example "a trader requested a payout" or "an account was created". Use webhooks to feed your CRM, your email marketing tool or your own back office. They work in the opposite direction to the [Client API](https://hypestacksypf.stoplight.io/docs/yourpropfirm-client-api/branches/main/bfba57d7b08f0-your-prop-firm-client-api-v1), which your systems call.

You manage webhooks in **System › Dev Space › Webhooks › Webhook Manager**. To open it, your role needs **Webhooks: Read** in Custom roles. The Admin role always has it.

{% hint style="info" %}
The **Webhooks** menu shows once YourPropFirm turns on webhooks for your firm. Until then it is hidden for everyone, the Admin role included.
{% endhint %}

| Action                               | Permission           |
| ------------------------------------ | -------------------- |
| See Webhook Manager and Webhook Logs | **Webhooks: Read**   |
| Create a webhook                     | **Webhooks: Create** |
| Edit, enable or disable a webhook    | **Webhooks: Update** |
| Delete a webhook                     | **Webhooks: Delete** |

**Webhooks: All actions** grants all of them.

## Where a webhook can send events

* **HTTP address**: any web address you control, such as your back office or CRM.
* **Brevo**, **Omnisend**, **HubSpot** and **Customer.io**: built-in receivers for these email marketing and CRM tools. You paste the API key from the tool, and the address is filled in for you.

### What HubSpot does with the events

For HubSpot, create a private app in HubSpot with the scopes `crm.objects.contacts.read` and `crm.objects.contacts.write`, and paste its access token as the **HubSpot API key**. It works on any HubSpot plan, with no other setup in HubSpot.

* **UserCreated** and **UserUpdated** create or update the trader as a HubSpot contact, matched by email: name, phone, address, city, zip code and country. An empty field does not overwrite what HubSpot already has.
* Every other event you pick adds a note on that contact's timeline, with the event name, its details and the event time.
* When HubSpot limits the number of calls or is down, we try the delivery again. A delivery with an invalid token is not retried. Every delivery shows in [Webhook logs](https://yourpropfirm.gitbook.io/yourpropfirm-docs/developers/webhook-logs.md).

To connect another email marketing platform as a built-in receiver, ask your YourPropFirm account manager. Until then, a platform that accepts webhooks on its own web address can use **HTTP address**.

## The webhook form

| Field                                                                                 | Shown for                                                      | What to enter                                                                                                                              |
| ------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **Name**                                                                              | Every webhook                                                  | Required, up to 100 characters.                                                                                                            |
| **Webhook receiver**                                                                  | Every webhook                                                  | **HTTP address**, **Brevo**, **Omnisend**, **HubSpot** or **Customer.io**.                                                                 |
| **Target**                                                                            | HTTP address                                                   | The full address that receives the events. It must be a valid URL.                                                                         |
| **Brevo API key**, **Omnisend API key**, **HubSpot API key**, **Customer.io API key** | That tool                                                      | The key from that tool. For HubSpot, a private app access token.                                                                           |
| **Customer.io Site ID**                                                               | Customer.io                                                    | Required.                                                                                                                                  |
| **Server Region**                                                                     | Customer.io                                                    | United States (US) or European Union (EU). It decides which Customer.io address is used.                                                   |
| **Select webhook types**                                                              | Every webhook                                                  | One or more events. See [Webhook types](https://yourpropfirm.gitbook.io/yourpropfirm-docs/developers/webhook-types.md).                    |
| **Exclude payout details**                                                            | When PayoutCreated, PayoutApproved or PayoutRejected is picked | When on, `payoutDetails` is sent as null in payout webhooks.                                                                               |
| **Secret key**                                                                        | HTTP address                                                   | Required. A new webhook gets a random secret. **Show secret** reveals it.                                                                  |
| **Signature algorithm**                                                               | HTTP address                                                   | SHA256, the only option.                                                                                                                   |
| **HTTP Headers**                                                                      | HTTP address                                                   | Optional. Extra headers sent with every delivery, such as an authorization header your receiver expects. Each row needs a key and a value. |

The **Webhook payload example** panel shows a sample body for each type you picked, with **Copy**. With **Exclude payout details** on, the sample shows payout details as null.

{% hint style="success" %}
Turn on **Exclude payout details** unless the receiver really needs them. A trader's bank, wallet or card details then never leave YourPropFirm.
{% endhint %}

## Create a webhook

1. Go to **System › Dev Space › Webhooks › Webhook Manager** and click **Create Webhook**.
2. Enter a **Name**.
3. Choose the **Webhook receiver**.
4. Enter the **Target** for an HTTP address, or paste the tool's API key (and, for Customer.io, the Site ID and Server Region).
5. In **Select webhook types**, pick the events to send.
6. For an HTTP address, copy the **Secret key** and give it to the developer of the receiving system, so it can check signatures.
7. Click **Test Webhook** and check the result in [Webhook logs](https://yourpropfirm.gitbook.io/yourpropfirm-docs/developers/webhook-logs.md).
8. Click **Create Webhook**, then **Create webhook** in the dialog.

The new webhook is **Enabled** and starts sending events at once.

## Test a webhook

**Test Webhook** sends one sample event for each picked type, using what is in the form now. The webhook does not need to be saved first. Samples are marked as test events, and each one shows in Webhook Logs as "Test" followed by the type.

* The button stays disabled until the receiver, the target, at least one type, and the secret or API key are filled in (plus Site ID and Server Region for Customer.io).
* After you open the form and after each test, it waits 10 seconds before the next test.

{% hint style="warning" %}
Test Webhook sends real HTTP requests to your receiver.
{% endhint %}

## How deliveries work

* HTTP address deliveries are sent as JSON.
* Each delivery carries a signature header, computed from the body with the **Secret key** (HMAC SHA256). The receiver recomputes it to check that the delivery is genuine.
* Every delivery carries an event ID and the time the event happened. The receiver can use the event ID to ignore duplicates.
* Test samples are marked as test events, so the receiver can tell them apart from real ones.
* The receiver has 5 seconds to answer. Any answer outside the success range counts as failed.
* The dashboard has no automatic retry setting and no resend button. Check failed deliveries in [Webhook logs](https://yourpropfirm.gitbook.io/yourpropfirm-docs/developers/webhook-logs.md).
* A webhook sends only the types ticked on it. Several webhooks can listen to the same event, and each one gets its own delivery.
* Webhooks are separate from in-app notifications and emails. Turning a webhook off does not stop notifications or emails, and the reverse.

## Manage your webhooks

Webhook Manager lists every webhook with its **Webhook Name**, **Target** (click to copy, with the receiver under it), **Webhook Types**, **Status** (Enabled or Disabled) and **Created** date. Search by name, or filter by **Webhook types** and **Status**.

| Action              | What happens                                                                                            |
| ------------------- | ------------------------------------------------------------------------------------------------------- |
| **Edit webhook**    | Opens the webhook's details page with the saved values. **Save changes** applies to future events only. |
| **Disable webhook** | Pauses the webhook. Events that happen while it is disabled are not sent, then or later.                |
| **Enable webhook**  | The webhook sends new events again.                                                                     |
| **Delete webhook**  | Removes the webhook for good. This cannot be undone. Its past deliveries stay in Webhook Logs.          |

### The webhook details page

The details page is titled with the webhook's name and shows an **Enabled** or **Disabled** badge. **Disable** (or **Enable**) sits next to the badge, and **Delete webhook** sits on the right. Both ask you to confirm and apply at once, without **Save changes**. You see them only with **Webhooks: Update** and **Webhooks: Delete**.

The form is split into **Details**, **Webhook types**, **Security** and **HTTP Headers** sections. Each receiver shows only its own fields. The secret key or API key is hidden: the eye icon shows or hides it, and the copy icon copies it. On a wide screen the payload example stays in view on the right; on a narrower screen it sits below the sections. The bottom bar holds **Exit**, **Test webhook** and **Save changes**.

Creating, editing, enabling, disabling and deleting a webhook are recorded in **System › Monitoring › Activities** under Webhook.

## Limits

* Changing the secret breaks the receiver's signature check until the receiver uses the new secret.
* Changing the receiver of an existing webhook replaces its secret or API key: a new secret for an HTTP address, an empty API key for a tool.
* Your firm has a webhook limit, set by YourPropFirm. When you reach it, **Create Webhook** is disabled. Delete a webhook you no longer use, or ask your YourPropFirm account manager to raise the limit. Disabled webhooks count toward the limit.

## Related

* [Webhook types](https://yourpropfirm.gitbook.io/yourpropfirm-docs/developers/webhook-types.md): Every event a webhook can send, and when it is sent.
* [Webhook logs](https://yourpropfirm.gitbook.io/yourpropfirm-docs/developers/webhook-logs.md): Check each delivery and find out why one failed.
* [Custom roles and permissions](https://yourpropfirm.gitbook.io/yourpropfirm-docs/settings-and-roles/custom-roles-and-permissions.md): Give a staff role the Webhooks permissions.
