adapter/webhook_verify.py, implements them exactly, and composerID signs its own outbound webhooks the same way.
When your system receives webhook events, for example document or assessment updates, your endpoint will receive HTTP POST requests from our platform.
These requests are signed using your configured signing keys. You should verify the signature to ensure that:
- The request was sent by us, and
- The payload has not been modified in transit.
Signature headers
Webhook requests may include one or more signature headers. A separate signature header is included for each active signing key. During key rotation, this means a request may contain multiple signatures. Example:Signature headers
How to validate the request
To verify a webhook request:- Read the raw request body exactly as received.
- Compute an HMAC-SHA256 digest using each of your active signing keys.
- Base64 encode each digest.
- Compare each computed digest against all X-Signature-HMAC-SHA256-* header values.
- Treat the request as valid if any computed digest matches any header value.
- Reject the request if no signatures match.
Important implementation notes
- Use the raw request body, not a parsed or re-serialised JSON payload.
- Do not modify the request body before computing the signature.
- Signature values are Base64 encoded and may include padding (=).
- More than one signature header may be sent when multiple signing keys are active.
- Do not assume any relationship between the header suffix and a specific signing key.
- Compare the computed and supplied signatures using a secure comparison method.
- Reject requests where no valid signature is present.
Key rotation
To support key rotation, multiple signing keys can be active at the same time. When this happens:- webhook requests will include multiple signature headers,
- each signature is generated using a different active key,
- your application should validate the request against all active keys and all supplied headers.