POST to the endpoint you registered.
Each partner has a single webhook endpoint. You manage it through the /webhook resource and choose which event types it receives.
Managing your endpoint
Creating or updating
PATCH /webhook is a partial update: only the fields you send are changed.
urlandeventsare required the first time (when no endpoint exists yet).- Sending
eventsreplaces the entire subscription list, so always include the full set you want (at least one). - Set
isActive: falseto pause deliveries without deleting the endpoint, andtrueto resume.
url must be an https URL.
Event types
Delivery payload
Each delivery is a lightweight notification. It identifies the affected resource, not its full state. Treat the payload as a signal to fetch the current resource (for exampleGET /payments/{id}) rather than as the source of truth, so you never act on a stale snapshot.
Every delivery includes these fields:
Some events carry a small
data object; most do not, and you should fetch the resource for its current state. Account created/deleted events include:
Verifying deliveries
Every delivery is signed so you can confirm it genuinely came from Melio and was not tampered with. The raw request body is signed with HMAC-SHA256 (hex encoded) using your API key secret, and the signature is sent in theX-Melio-Signature header.
To verify, compute the HMAC over the raw request body (before any JSON parsing) and compare it to the header using a constant-time comparison:
Handling deliveries reliably
- Be idempotent. The same event may be delivered more than once. Deduplicate on
messageId(also available as theX-Melio-Delivery-Idheader) so you process each event only once. - Respond quickly with a
2xx. Acknowledge receipt fast and do heavy work asynchronously. Failed deliveries are retried. - Fetch current state. Because deliveries are notifications, always read the resource (
GET) to get its latest state before acting, rather than trusting a possibly out-of-order payload. - Pause safely. Set
isActive: falseto stop deliveries during maintenance instead of tearing down and rebuilding your subscription.
Related
- Timestamps - the
occurredAtformat. - External IDs - correlating events to your own records.
- Metadata - extra context carried on deliveries.