Registering Webhooks with the V5 API
Everything you can do in Setup > Automation > Webhooks can also be done with the Facilio V5 API, so an integration can register the webhooks it needs by itself.
Base URLā
Every V5 API address is built the same way:
https://{region-host}/{app}/api/v5/{path}
Region host. Your Facilio account lives in one region. Use the host of that region:
| You sign in to Facilio at an address ending in | Region | Region host |
|---|---|---|
facilio.com | United States | us.facilioapis.com |
facilio.com.au | Australia | au.facilioapis.com |
facilio.co.uk | United Kingdom | uk.facilioapis.com |
facilio.co.ae | United Arab Emirates | azr-ae.facilioapis.com |
If your organization signs in at its own address, ask your Facilio administrator which region it is in. A sandbox uses the same host as its production account; the API key decides which organization you reach.
App. The link name of the Facilio application the calls run in: maintenance for the main Facilio (CMMS) application. Use the application your integration user works in.
Path. For webhooks, platform/webhook/{moduleName}. {moduleName} is the module's API name, for example:
| Module | moduleName |
|---|---|
| Work orders | workorder |
| Service requests | serviceRequest |
| Invoices | invoice |
| Purchase orders | purchaseorder |
| Quotes | quote |
| Custom modules | their API name, starting with custom_ |
GET /api/v5/modules lists every module you can use, with its name.
So the invoice webhooks of an account in the United Kingdom are at:
https://uk.facilioapis.com/maintenance/api/v5/platform/webhook/invoice
Authenticationā
Send one of these headers with every request:
| Method | Header |
|---|---|
| API key | x-api-key: <your API key> |
| OAuth 2.0 access token | Authorization: Bearer oauth2 <access token> |
Create an API key or OAuth client in Facilio under API Clients (see Adding an API Client). The key acts as its user: create it for a dedicated integration user with read access to the modules you want webhooks on.
Request bodies are JSON, wrapped in data: {"data": { ... }}. Send Content-Type: application/json with every request that has a body.
Endpointsā
All paths below follow https://{region-host}/{app}/api/v5.
| Method | Path | What it does |
|---|---|---|
GET | /platform/webhook/{moduleName}/triggers | The module's triggers a webhook can follow, with their link names |
POST | /platform/webhook/{moduleName} | Create a webhook. The response contains the signing secret, shown only this once |
GET | /platform/webhook/{moduleName} | List the module's webhooks, newest first. page, pageSize (up to 200), count=true |
GET | /platform/webhook/{moduleName}/{id} | Get one webhook |
PATCH | /platform/webhook/{moduleName}/{id} | Change name, url, trigger, status or criteria |
DELETE | /platform/webhook/{moduleName}/{id} | Delete a webhook and its delivery history |
POST | /platform/webhook/{moduleName}/{id}/rotatesecret | Create a new signing secret (returned once) |
POST | /platform/webhook/{moduleName}/{id}/test | Send a test event now and return the receiver's answer |
GET | /platform/webhook/{moduleName}/{id}/deliveries | The delivery log, newest first. status, page, pageSize, count=true |
POST | /platform/webhook/{moduleName}/{id}/deliveries/{deliveryId}/retry | Send one failed event again |
POST | /platform/webhook/{moduleName}/{id}/retry | Send every failed event again |
Create a Webhookā
Example: send every new invoice to an ERP.
- Check the trigger's link name (see Finding a Trigger's Link Name). For new records it is
create. - Create the webhook:
curl -X POST "https://us.facilioapis.com/maintenance/api/v5/platform/webhook/invoice" \
-H "x-api-key: <your API key>" \
-H "Content-Type: application/json" \
-d '{
"data": {
"name": "ERP - new invoices",
"url": "https://erp.example.com/hooks/facilio",
"trigger": "create"
}
}'
{
"data": {
"id": 17,
"name": "ERP - new invoices",
"moduleName": "invoice",
"url": "https://erp.example.com/hooks/facilio",
"trigger": { "linkName": "create", "name": "Create", "eventType": "create", "status": "active" },
"status": "active",
"consecutiveFailures": 0,
"sysCreatedBy": { "id": 2388590 },
"sysCreatedTime": "2026-11-24T10:54:04Z",
"sysModifiedTime": "2026-11-24T10:54:04Z",
"secret": "whsec_5f0c2eā¦(64 hex characters)"
},
"success": true,
"message": "Webhook created. Store the secret now: it is not shown again."
}
- Store
secretwhere the receiver can read it. The receiver uses it to verify each event (see Verifying the Signature).
Fieldsā
| Field | Required | Notes |
|---|---|---|
name | Yes | Up to 255 characters. |
url | Yes | https only, reachable from the internet, up to 2000 characters. See URL Rules. |
trigger | Yes | The trigger's link name. |
status | No | active (default) or disabled. |
criteria | No | Only send records that match, as a filter expression, for example "priority = 'High'", "siteId = 12", "priority = 'High' AND subject LIKE '%leak%'". Facilio returns it normalized (a picklist or lookup name becomes its ID, as in priority = 1). |
Any other field is refused. A module can have up to 20 webhooks; several can follow the same trigger.
More examples:
{ "data": { "name": "High priority WOs to Teams", "url": "https://hooks.example.com/wo", "trigger": "create", "criteria": "priority = 'High'" } }
{ "data": { "name": "SR comments to helpdesk", "url": "https://helpdesk.example.com/facilio", "trigger": "addcomment" } }
(the second one posted to /platform/webhook/serviceRequest)
Change, Switch Off or Deleteā
# Switch to another trigger and add a condition
curl -X PATCH "https://us.facilioapis.com/maintenance/api/v5/platform/webhook/invoice/17" \
-H "x-api-key: <your API key>" -H "Content-Type: application/json" \
-d '{"data": {"trigger": "createoredit", "criteria": "siteId = 12"}}'
# Switch it off, and back on
curl -X PATCH ".../platform/webhook/invoice/17" -H "x-api-key: <your API key>" -H "Content-Type: application/json" \
-d '{"data": {"status": "disabled"}}'
curl -X PATCH ".../platform/webhook/invoice/17" -H "x-api-key: <your API key>" -H "Content-Type: application/json" \
-d '{"data": {"status": "active"}}'
# Delete
curl -X DELETE ".../platform/webhook/invoice/17" -H "x-api-key: <your API key>"
- Send only the fields you change.
"criteria": nullremoves the conditions. - Setting
statustoactivealso clears the failure count and the reason Facilio gave when it switched the webhook off. - Nothing is sent while a webhook is off, and events from that time are not sent later.
Rotate the Secretā
curl -X POST ".../platform/webhook/invoice/17/rotatesecret" -H "x-api-key: <your API key>"
The response holds the new secret, shown once. Events from then on are signed with it.
Send a Testā
# A ping: checks the URL answers
curl -X POST ".../platform/webhook/invoice/17/test" -H "x-api-key: <your API key>"
# The event this webhook would send for invoice 3201, marked as a test
curl -X POST ".../platform/webhook/invoice/17/test" -H "x-api-key: <your API key>" \
-H "Content-Type: application/json" -d '{"data": {"recordId": 3201}}'
The response says whether the receiver accepted the event (delivered), with its responseCode, responseBody (first part), error and durationMs. A record test is marked with "test": true and an X-Facilio-Test: true header, ignores the conditions, and has no changes. Tests are not logged or retried.
Deliveries and Retriesā
# Failed events
curl ".../platform/webhook/invoice/17/deliveries?status=failed&count=true" -H "x-api-key: <your API key>"
# Send one again
curl -X POST ".../platform/webhook/invoice/17/deliveries/55/retry" -H "x-api-key: <your API key>"
# Send every failed event since 17 November again
curl -X POST ".../platform/webhook/invoice/17/retry" -H "x-api-key: <your API key>" \
-H "Content-Type: application/json" -d '{"data": {"since": "2026-11-17T00:00:00Z"}}'
A delivery looks like this:
{
"id": 55,
"eventId": "evt_3d78b64664794d449218849ef15f8c65",
"event": "workorder.created",
"trigger": { "linkName": "create" },
"recordId": 15015522,
"status": "failed",
"attemptCount": 1,
"responseCode": 404,
"responseBody": "{\"ok\":false}",
"error": "Receiver responded with HTTP 404",
"durationMs": 62,
"occurredTime": "2026-11-24T10:54:12Z",
"lastAttemptTime": "2026-11-24T10:54:12Z"
}
status is one of pending, sending, succeeded, retrying (with nextRetryTime), failed or skipped. An update event also lists changedFields. What each status means, and the retry schedule, are in Deliveries, Retries and Logs.
Whose Data a Webhook Sendsā
A webhook remembers who created it (its owner) and the application it was created in. Each event is read with the owner's access: a record the owner cannot see is not sent (the delivery is skipped), so a webhook never sends more than its owner could read.
- Only the owner, or an administrator, can change, test, retry or read the deliveries of a webhook. Anyone with read access to the module can list webhooks; they see the URL without its query string.
- If the owner is deactivated or loses access to the application, the webhook switches itself off with a reason. To give it a new owner, delete it and create it again as that user.
- A webhook created with an OAuth app reads as that app.
URL Rulesā
https://only, with no user name or password in the URL.- The host must resolve to a public internet address: local, private and cloud metadata addresses are refused, both when you save the webhook and on every delivery.
- Redirects are not followed: give the final address.
- Put any token the receiver needs in the URL path or query string. Facilio does not send custom headers, but every event is signed, so the receiver can also rely on the signature.
Errorsā
Errors come back with an HTTP status and a reason:
| Reason | Meaning |
|---|---|
REQUIRED | name, url or trigger is missing. |
INVALID_VALUE | A value is wrong, for example a trigger link name the module does not have. |
UNKNOWN_FIELD | The body has a field other than name, url, trigger, status, criteria. |
URL_NOT_ALLOWED | The URL breaks the URL rules. |
MODULE_NOT_SUPPORTED | The module cannot have webhooks. |
LIMIT_REACHED | The module already has 20 webhooks. |
TRIGGER_NOT_SUPPORTED | The trigger is a scheduled trigger. |
TRIGGERS_NOT_ENABLED | Triggers are not enabled for the organization. |
NOT_RETRYABLE | Only failed deliveries can be retried. |
WEBHOOK_DISABLED | Switch the webhook on before retrying. |
RECORD_NOT_FOUND (404) | No webhook with that ID on that module. |
FORBIDDEN (403) | Only the webhook's owner or an administrator may do this. |