Skip to main content
Callers signs the requests it sends to your endpoints - webhooks after a conversation and custom actions during it. Check the signature to make sure a request really comes from Callers and wasn’t changed on the way.

How Requests Are Signed

Every signed request carries two headers:
  • X-Signature: The signature of the request body.
  • X-Signature-Type: How the request was signed - HMAC or RSA.
The Sign with RSA-SHA256 toggle, turned off, with the note that HMAC-SHA256 is used when it's disabled

The RSA option in a webhook's settings

The signature is calculated over the request body exactly as Callers sends it - for a JSON body, the compact JSON text. Verify it against the raw body of the request, before your framework parses it.
Read X-Signature-Type on every request and pick the matching check, so your endpoint works whichever way a request is signed.

Find Your HMAC Secret

Click your name at the bottom of the sidebar, choose Settings and stay on the General tab. Under Webhook Signature, click Show HMAC Secret and copy the key. See Account Settings.
  • Each account - including each subaccount - has its own secret. Use the secret of the account the agent belongs to.
  • Use the secret as is, as a text string. Don’t decode it.
  • Keep it private, like a password. If you think it has leaked, contact support.

Verify an HMAC Signature

  1. Take the raw request body and the X-Signature header.
  2. Calculate the HMAC-SHA256 of the body with your secret, as a hex string.
  3. Compare the result with X-Signature using a constant-time comparison. If they don’t match, reject the request.

JavaScript (Node.js with Express)

Python

Verify an RSA Signature

Requests with X-Signature-Type: RSA are signed with the Callers private key. Verify them with this public key:
public-key.pem

JavaScript (Node.js)

Python

This example uses the pycryptodome package (pip install pycryptodome).