Webhooks
Authentication
When Schedo sends a webhook, it includes a signature in the x-schedo-signature
header. This signature allows you to verify that the request really came from Schedo and not from a malicious third party.
Why Verify the Signature?
Anyone can send a POST request to your webhook URL. By verifying the signature, you ensure that only requests genuinely sent by Schedo (using your secret) are accepted and processed.
How the Signature is Generated
- Schedo takes the raw request body (the JSON payload).
- Schedo computes an HMAC-SHA256 hash of this payload, using your unique signing secret as the key.
- Schedo sends the resulting hash (as a hex string) in the
x-schedo-signature
header.
How to Verify the Signature
To verify the request:
- Read the raw request body (exactly as received).
- Compute your own HMAC-SHA256 hash of the body, using your signing secret.
- Compare your computed hash to the value in the
x-schedo-signature
header. - If they match, the request is authentic.
Example: Manual Signature Verification in TypeScript/Node.js
Key Points
- Always use the raw body (not a parsed object) for signature calculation.
- Use
timingSafeEqual
for comparison to prevent timing attacks. - Never share your signing secret.
By following these steps, you can ensure that only trusted requests from Schedo are processed by your webhook endpoint.