Developers
Webhooks
A webhook address is a URL on your server that FieldSignal sends messages to when events happen in your team's projects. A team manager adds addresses in the FieldSignal web portal and chooses which events each one receives.
Events
| Type | Sent when |
|---|---|
visit.completed |
A visit was completed. |
visit.approved |
A visit was approved. |
visit.revision_requested |
A revision of a visit was requested. |
report.generated |
A report's file is ready. The message carries a download link valid for 24 hours. |
corrective_action.created |
A corrective action was raised. |
corrective_action.resolved |
A corrective action was resolved. |
corrective_action.closed |
A corrective action was closed. |
corrective_action.reopened |
A corrective action was reopened. |
corrective_action.cancelled |
A corrective action was cancelled. |
webhook.test |
A team manager sent a test message to this address. |
The reference lists the exact contents of each message.
The message
Each message is an HTTP POST with a JSON body:
{
"id": "00000000-0000-4000-8000-000000000010",
"type": "corrective_action.created",
"version": "1",
"created_at": "2026-11-25T14:03:07.120Z",
"team": { "id": "00000000-0000-4000-8000-000000000002", "name": "Example team" },
"actor": { "id": "00000000-0000-4000-8000-000000000003", "name": "Example Person" },
"data": { "...": "..." }
}
data is a snapshot taken when the event was recorded. created_at is when the event was recorded. actor is the person whose action raised the event, or null.
The request carries these headers:
| Header | Value |
|---|---|
Content-Type |
application/json |
User-Agent |
FieldSignal-Webhooks/1 |
FieldSignal-Event-Id |
The message id, the same as the body's id, the same on every attempt. |
FieldSignal-Event-Type |
The message type, the same as the body's type. |
FieldSignal-Delivery-Attempt |
The attempt number, from 1. |
FieldSignal-Signature |
The signature, below. |
Checking the signature
Check the signature before you rely on a message.
FieldSignal-Signature looks like t=1795600987,v1=5f0c.... t is the time the attempt was sent, in Unix seconds. Each v1 is the lowercase hex HMAC-SHA256 of the text <t>.<raw body>, keyed by the address's signing secret.
- Use the whole signing secret as the key, as text,
whsec_prefix included. Do not remove the prefix or decode it. - Use the raw body exactly as received, before any JSON parsing.
- For 24 hours after a manager issues a new secret, the header carries two
v1values, one for each secret. Accept the message if either matches. - We recommend rejecting a message whose
tis more than 5 minutes from your clock.tis set fresh on every attempt, so a retried message still passes.
Node.js:
import crypto from "node:crypto";
export function verifyFieldSignal(rawBody, signatureHeader, secret, toleranceSeconds = 300) {
const parts = signatureHeader.split(",");
const t = parts.find((p) => p.startsWith("t="))?.slice(2);
const signatures = parts.filter((p) => p.startsWith("v1=")).map((p) => p.slice(3));
if (!t || !/^[0-9]+$/.test(t) || signatures.length === 0) return false;
if (Math.abs(Date.now() / 1000 - Number(t)) > toleranceSeconds) return false;
const expected = crypto.createHmac("sha256", secret)
.update(`${t}.`)
.update(rawBody)
.digest("hex");
return signatures.some((s) =>
s.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(s, "utf8"), Buffer.from(expected, "utf8")));
}
rawBody is the body as a Buffer or string exactly as received.
Python:
import hashlib, hmac, time
def verify_fieldsignal(raw_body: bytes, signature_header: str, secret: str, tolerance_seconds: int = 300) -> bool:
pairs = [p.split("=", 1) for p in signature_header.split(",") if "=" in p]
t = next((v for k, v in pairs if k == "t"), None)
signatures = [v for k, v in pairs if k == "v1"]
if t is None or not t.isdigit() or not signatures:
return False
if abs(time.time() - int(t)) > tolerance_seconds:
return False
expected = hmac.new(secret.encode("utf-8"), t.encode("ascii") + b"." + raw_body, hashlib.sha256).hexdigest()
return any(hmac.compare_digest(expected, s) for s in signatures)
Answering a message
Answer with any status from 200 to 299 within 10 seconds, then do your own work afterwards. Redirects are not followed.
| Your answer | What happens |
|---|---|
| 200–299 | Delivered. The message is normally not sent again; see Duplicates, delays and order. |
| 410 | The address is turned off. Nothing more is sent to it until a manager turns it on again. |
| Anything else, a redirect, or no complete answer within 10 seconds | Retried. |
Retries
A message that is not delivered is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours: 7 attempts in all, over about 21 hours. Each wait can run up to a minute longer. After the last attempt the message is not sent again.
Duplicates, delays and order
Delivery is not guaranteed. A message can arrive late, more than once, or out of order. Record each FieldSignal-Event-Id you have handled and skip one you have already seen. Do not use webhooks for anything where a missed or late message could put a person or property at risk; fetch the current state through the API when it matters.
When an address is turned off
An address is turned off when it answers 410, when it keeps failing for three days, or when it no longer meets the address rules. The team's managers are emailed when that happens, and a manager can turn it on again in the portal. Messages are not sent while the team's plan does not include webhooks.
Testing an address
A team manager can send a webhook.test message from the portal, up to 5 an hour for each address. It is signed, sent and retried like any message. Its data is { "registration_id": "...", "test": true }.
Documentation version 1.0.1