Webhook registration is a signed-in user’s own account setting on the internal
https://api.vyomflow.co.in/api/v1 surface, authenticated with a Clerk session token — not an agent-facing route, and not part of /api/public/v1 or MCP.Registering an endpoint
rotateSecret is optional and only meaningful on a repeat call (see Rotating your secret below).
200):
POST /api/v1/webhooks again updates the existing endpoint’s url in place rather than creating a second one.
Rotating your secret
PassrotateSecret: true on a repeat call to mint a fresh secret. The previous secret moves into secondarySecret and stays valid as a fallback signer for a grace window, so you can update your receiver’s verification logic without dropping in-flight deliveries. rotateSecret is a no-op on the very first registration call — there’s nothing yet to rotate.
Events
Every registered endpoint receives every event type — there is no per-event subscription filtering.
All four payloads share
runId, chatId, and occurredAt (ISO 8601). Example tool.completed body:
Verifying a delivery
Every delivery carries these headers:
Verify with Node’s
crypto module, matching the sender’s scheme exactly (${timestamp}.${rawBody}, HMAC-SHA384, hex):
Verify against the raw, unparsed request body — the signature is computed over the literal bytes sent on the wire, not a re-serialized object. Reject any request where the timestamp is more than 300 seconds from your own clock, to guard against replay of an old, legitimately-signed delivery.
secret and secondarySecret (from the registration/rotation response) during the grace window — a delivery may still be signed with either.