Request headers & body
The request includes the following headers for verifying the event comes from Meld:meld-signature- The signature to verify against.meld-signature-timestamp- The timestamp of the event, which is included in the signature.
Verifying the signature
The signature is constructed using the signature timestamp in the header, the URL where the event was sent, and the unformatted/raw request body. These three are concatenated together with a period (.) and then signed using the secret. The signed bytes are then Base64 URL encoded with padding.
Represented simply: base64url(HMACSHA256(<TIMESTAMP>.<URL>.<BODY>))
To verify, create the same SHA256 HMAC signature and then compare it to the Meld-Signature in the header. If they match, then you can be sure that the webhook was sent by Meld. If they don’t, it may be from another source.
Example
Profile Settings:Secret:42m4NMLS34WQ6BbMfo1KFKqMv4hyURL:https://example.meld.io/webhooks
Meld-Signature:O4bN5E0U9s88l2DFc0kjt-0w3LLA3Zkv8hXhafc22Hg=Meld-Signature-Timestamp:2022-05-26T20:25:17.682818Z