Skip to main content
FIXED · organisation MUST With organisations enabled, each organisation has one signing secret. Send the human Owner to the dashboard. Never ask for it in chat or expose it to AI tools.
An authorised server can use an Owner session or the organisation API credential. Admin and Member sessions cannot retrieve it. Store it on the receiving server. Without organisations, the webhook signing secret is only the owning credential’s KEY_SECRET part. In either mode pass the webhook signing secret as keySecret to the Node verifier.
NOT OFFERED → do this instead · number call.bookings has no account field or per-number secret. After signature verification, look up number in your own tenant table. It is the business to number inbound and from number outbound. YOU CAN CHANGE · number Set delivery destinations per number. Pre-call settings can be scoped to an agent or number. Keep the delivery destination and your signature-verification secret separate. SCOPE · operation Verify X-Nixflex-Signature (t=<timestamp>,v1=<hex>) with HMAC-SHA256 over timestamp + ”.” + the original raw request body. Compare the digest in constant time and enforce a freshness policy before trusting the payload. Read the compact AI rules Use the pre-call hook to supply temporary context or an explicit rejection before an eligible inbound conversation.
Timing: Before admission ·
Failure policy: Fail-open ·
Context: This call only
The important part
  • Hook failure is fail-open; do not use it as the sole security boundary.
  • Verify signatures over the exact request bytes.
  • The outbound call purpose is supplied on the call request, not through this hook.

Prerequisites

Keep NIXFLEX_API_KEY private on the server. Raw HTTP base URL: https://api.nixflex.com/v1. Node and Python SDK base URL: https://api.nixflex.com. The SDK adds /v1. Use owned identifiers; SDK and CLI examples need the documented minimum versions. Use an HTTPS receiver and verify the signing header before using supplied caller information.

1. Read the hook configuration

2. Choose the scope

A configured number URL wins over the agent URL; otherwise the agent setting applies. If neither is configured, this hook does not run. Use the documented number or agent integration route, not an outbound call-purpose field.

3. Verify the request

The POST body contains event:call.inbound, from, to and call_id. Current code attaches a signature when a signing value is available. Verify exact raw bytes using the signature helper. Reject unverified requests in your service; do not accept them because the caller data looks plausible.

4. Return a clear decision

A successful JSON response containing {"action":"reject","reason":"account_inactive"} explicitly refuses the call. Other valid responses allow it. A permitted caller object can supply validated current-call context. Invalid context fields are ignored individually; do not assume every supplied field was accepted.

5. Design for fail-open

The whole request and reply-body read share a five-second budget. Timeout, network failure, unsuccessful HTTP or invalid/oversized JSON causes the call to proceed. Reply bodies are limited to 64 KiB. Protect sensitive downstream actions with their own authorisation, because this hook is not a fail-closed security boundary.

Example response

Illustrative receiver reply: {"action":"accept","caller":{"name":"Sam"}}. This provides call context; later learning and call records follow their own policies, so it is not a promise that no related information will ever be stored.

Errors and limits

Next steps