Skip to main content

Setting Up Webhooks in Setup

Administrators manage webhooks in Setup > Automation > Webhooks. Everything on this page can also be done with the V5 API: see Registering Webhooks with the V5 API.

Webhooks sits in the Automation group of Setup, next to Triggers and Workflows.
Webhooks sits in the Automation group of Setup, next to Triggers and Workflows.

The Webhooks Page​

Choose the module at the top left. The list shows that module's webhooks:

Two webhooks on Work Orders: one delivering, one whose receiver answered with an error.
Two webhooks on Work Orders: one delivering, one whose receiver answered with an error.
ColumnWhat it shows
NameClick it to edit the webhook.
URLWhere events are sent.
TriggerThe trigger it follows. Trigger deleted means the trigger is gone: the webhook sends nothing until you pick another one.
StatusThe switch turns the webhook on and off. A warning icon next to it means Facilio switched it off itself; hover over it for the reason (see Automatic Switch-Off).
Last deliveryWhether the latest event was delivered, and when.
Failures in a rowEvents in a row that ended Failed. It goes back to 0 at the next success.

The icons at the end of each row open the edit form and the deliveries; the ⋮ menu has Send test, Rotate secret and Delete.

Adding a Webhook​

  1. Choose the module, then click Add Webhook.

  2. Fill in the form:

    A webhook that sends every new work order to an ERP.
    A webhook that sends every new work order to an ERP.
    FieldWhat to enter
    NameA name your team will recognize, for example ERP sync - new work orders.
    URLThe receiver's address. It must be https:// and reachable from the internet (see URL Rules).
    TriggerWhen to send. The list shows every trigger of the module that a webhook can follow; see Choosing a Trigger. Create a trigger opens Setup > Automation > Triggers if you need a new one.
    ActiveLeave it on to start sending right away.
    ConditionsOptional. Only records that match are sent (see below).
    The Trigger list shows the module's triggers, system and custom.
    The Trigger list shows the module's triggers, system and custom.
  3. Click Create.

  4. Facilio shows the webhook's signing secret. Copy it now and give it to whoever builds the receiver: it is not shown again. The receiver uses it to check that an event really came from Facilio (see Verifying the Signature).

    The signing secret is shown once, right after the webhook is created.
    The signing secret is shown once, right after the webhook is created.

Conditions​

Conditions limit the webhook to records that match, for example Priority is High, or Site is Head Office. They use the same condition builder as workflows.

Only work orders created with High priority are sent.
Only work orders created with High priority are sent.

Conditions are checked on the record as it is saved, after the trigger's own workflows and status changes have run, so a field that a workflow sets is already set when the conditions are checked. A record that does not match is simply not sent; nothing is logged for it.

Sending a Test​

Use ⋮ > Send test to check the receiver before real events arrive.

Send test, Rotate secret and Delete.
Send test, Rotate secret and Delete.
  • Ping sends a small ping event with no record. It checks that the URL is reachable and answers.
  • Record sends the event this webhook would send for a real record (the latest one is filled in; you can enter any record ID), marked as a test with "test": true and an X-Facilio-Test: true header, so a receiver can tell it apart from a real event and not act on it.

The result shows whether the receiver accepted it, its response code and the first part of its answer:

A ping the receiver accepted.
A ping the receiver accepted.
A record test the receiver refused: HTTP 502, with the receiver's answer.
A record test the receiver refused: HTTP 502, with the receiver's answer.

Tests are not retried and do not appear in the deliveries or logs.

Editing, Switching Off and Deleting​

  • Edit (click the name or the edit icon) to change the name, URL, trigger, status or conditions. Editing does not change the webhook's owner (see Whose Data a Webhook Sends).
  • Switch off with the Status switch. Nothing is sent while it is off, and events that happen meanwhile are not sent later. Switching it back on also clears the failure count.
  • Rotate secret (⋮ menu) creates a new signing secret, shown once. Events from then on are signed with it, so update the receiver right away.
  • Delete (⋮ menu) removes the webhook and its delivery history.

Deliveries​

The deliveries icon opens the events that need attention: those that failed, are waiting for a retry, or are being sent. From there you can send failed events again. See Deliveries, Retries and Logs.

Note:A module can have up to 20 webhooks. Several webhooks can follow the same trigger, for example to send the same event to two systems.