How it works
When you create a webhook, you provide three things:- A URL where Leaf sends HTTP POST requests.
- A secret key Leaf uses to sign each request (HMAC SHA-256).
- A list of event types you want to receive.
Testing your endpoint
Once a webhook is registered, callPOST /webhooks/{id}/test to have Leaf fire a signed sample message at your URL on demand, so you can exercise your receiving and signature-verification code without waiting for a real event. The sample payload has "type": "test" and is meant for transport and signature checks, not event-schema validation. It is signed with the same X-Leaf-Signature scheme as real alerts, so verification code you write against the test works unchanged for live events. See Authentication for verification steps and Test a webhook for the endpoint details.
Recommended events
At a minimum, set up webhooks for:- Field events (
fieldCreated,fieldBoundaryCreated,fieldBoundaryUpdated) to track boundary changes. - Machine file events (
providerFileProcessingFinished,uploadedFileProcessingFinished) to know when new data is ready. - Operation events (
operationCreated,operationProcessingFinished) to react when field operations are available. - Credential events (
credentialsUnauthenticated,credentialsLimitedPermission) to catch broken provider connections early.
Retry policy
After 4 failed attempts, the event is logged as a failed call. You can retrieve failed calls via
GET /webhooks/failed-calls.
Security
Every request includes anX-Leaf-Signature header containing a base64-encoded HMAC SHA-256 digest of the request body, signed with your secret. Always verify this signature before processing the payload. See Authentication for implementation details.
Leaf runs on cloud infrastructure and does not have a fixed set of IP addresses for webhook delivery. If your network requires allow-listing, consider placing a reverse proxy or load balancer in a DMZ to receive webhooks and forward them internally.
Common use cases
- React to new field operations: Subscribe to
operationProcessingFinishedto trigger downstream workflows (yield analysis, report generation) as soon as data is ready. - Monitor provider credentials: Subscribe to
credentialsUnauthenticatedandcredentialsLimitedPermissionto alert your support team when a grower’s connection breaks. - Track boundary changes: Subscribe to
fieldBoundaryCreatedandfieldBoundaryUpdatedto keep your system in sync with provider-side field edits. - Automate satellite ingestion: Subscribe to
newSatelliteImageto process NDVI or NDRE imagery as soon as each satellite pass is clipped.
What to do next
- Events reference for all event types and payloads.
- Authentication for signature verification code examples.
- Alerts API Reference for endpoint details.

