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 -HMACorRSA.

The RSA option in a webhook's settings
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
- Take the raw request body and the
X-Signatureheader. - Calculate the HMAC-SHA256 of the body with your secret, as a hex string.
- Compare the result with
X-Signatureusing a constant-time comparison. If they don’t match, reject the request.
JavaScript (Node.js with Express)
Python
Verify an RSA Signature
Requests withX-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 thepycryptodome package (pip install pycryptodome).