Skip to main content

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 inRegionRegion host
facilio.comUnited Statesus.facilioapis.com
facilio.com.auAustraliaau.facilioapis.com
facilio.co.ukUnited Kingdomuk.facilioapis.com
facilio.co.aeUnited Arab Emiratesazr-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:

ModulemoduleName
Work ordersworkorder
Service requestsserviceRequest
Invoicesinvoice
Purchase orderspurchaseorder
Quotesquote
Custom modulestheir 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:

MethodHeader
API keyx-api-key: <your API key>
OAuth 2.0 access tokenAuthorization: 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.

MethodPathWhat it does
GET/platform/webhook/{moduleName}/triggersThe 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}/rotatesecretCreate a new signing secret (returned once)
POST/platform/webhook/{moduleName}/{id}/testSend a test event now and return the receiver's answer
GET/platform/webhook/{moduleName}/{id}/deliveriesThe delivery log, newest first. status, page, pageSize, count=true
POST/platform/webhook/{moduleName}/{id}/deliveries/{deliveryId}/retrySend one failed event again
POST/platform/webhook/{moduleName}/{id}/retrySend every failed event again

Create a Webhook​

Example: send every new invoice to an ERP.

  1. Check the trigger's link name (see Finding a Trigger's Link Name). For new records it is create.
  2. 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."
}
  1. Store secret where the receiver can read it. The receiver uses it to verify each event (see Verifying the Signature).

Fields​

FieldRequiredNotes
nameYesUp to 255 characters.
urlYeshttps only, reachable from the internet, up to 2000 characters. See URL Rules.
triggerYesThe trigger's link name.
statusNoactive (default) or disabled.
criteriaNoOnly 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": null removes the conditions.
  • Setting status to active also 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:

ReasonMeaning
REQUIREDname, url or trigger is missing.
INVALID_VALUEA value is wrong, for example a trigger link name the module does not have.
UNKNOWN_FIELDThe body has a field other than name, url, trigger, status, criteria.
URL_NOT_ALLOWEDThe URL breaks the URL rules.
MODULE_NOT_SUPPORTEDThe module cannot have webhooks.
LIMIT_REACHEDThe module already has 20 webhooks.
TRIGGER_NOT_SUPPORTEDThe trigger is a scheduled trigger.
TRIGGERS_NOT_ENABLEDTriggers are not enabled for the organization.
NOT_RETRYABLEOnly failed deliveries can be retried.
WEBHOOK_DISABLEDSwitch 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.
Tip:The webhook endpoints are part of the platform API and are not listed in the public V5 API reference. The rest of the V5 API (reading and writing records, comments and attachments) is in the REST API reference.