Signature Verification
Every webhook request includes headers that identify and sign the event.
How signatures are computed
FormantAI signs the raw request body using the webhook target secret.
Always verify against the raw body bytes before parsing JSON.
Node.js / Express
Python / FastAPI
Best practices
- Reject missing signatures.
- Use constant-time comparison.
- Verify before parsing JSON or doing business logic.
- Store
event_idand ignore duplicates. - Keep webhook secrets out of logs and repositories.
- Rotate secrets if they are exposed.