curl -X POST "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY"
curl -X POST "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY&rotate=true"
curl -X DELETE "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY"
{
"ok": true,
"signing_secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw",
"jwt_enabled": false
}
{
"ok": true
}
{
"error": "Signing secret must start with whsec_"
}
{
"error": "Signing is not available for Slack webhooks"
}
{
"error": "You do not have permission to manage webhook signing"
}
{
"error": "Webhook not found - Invalid webhook_id."
}
{
"error": "Webhook signing is already enabled; rotate to replace the secret"
}
{
"error": "JWT is on for this webhook. Switch to Signing secret to replace it.",
"code": "AUTH_METHOD_CONFLICT"
}
Webhooks
Webhook Signing Secret
Turn on, rotate or turn off Standard Webhooks signing for a webhook, so your receiver can verify each delivery came from SmartLead
POST
/
api
/
v1
/
webhook
/
{webhook_id}
/
signing-secret
curl -X POST "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY"
curl -X POST "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY&rotate=true"
curl -X DELETE "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY"
{
"ok": true,
"signing_secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw",
"jwt_enabled": false
}
{
"ok": true
}
{
"error": "Signing secret must start with whsec_"
}
{
"error": "Signing is not available for Slack webhooks"
}
{
"error": "You do not have permission to manage webhook signing"
}
{
"error": "Webhook not found - Invalid webhook_id."
}
{
"error": "Webhook signing is already enabled; rotate to replace the secret"
}
{
"error": "JWT is on for this webhook. Switch to Signing secret to replace it.",
"code": "AUTH_METHOD_CONFLICT"
}
Signs every delivery of a webhook (first send and retries) with the Standard Webhooks scheme. Works for user, client and campaign webhooks. The webhook id is the one from Create Webhook or Get Campaign Webhooks.
The signed text is
Verify against the raw body bytes you received, before any JSON parsing, and reject old timestamps to stop replays.
POSTturns signing on. SmartLead generates the secret, or stores yours if you sendsigning_secret.POST ?rotate=truereplaces an existing secret straight away (the old secret stops working at once).DELETEturns signing off.
Path Parameters
Query Parameters
POST only.
true replaces a secret that is already set. Without it, a webhook that already has a secret returns 409.Request Body
All fields are optional. Any other field returns 400.Your own secret instead of a generated one. Must be
whsec_ followed by standard base64 that decodes to 24 to 64 bytes.A webhook uses either a signing secret or JWT, never both. If JWT is on,
true turns JWT off and the secret on in one step; without it you get 409 AUTH_METHOD_CONFLICT.curl -X POST "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY"
curl -X POST "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY&rotate=true"
curl -X DELETE "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY"
{
"ok": true,
"signing_secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw",
"jwt_enabled": false
}
{
"ok": true
}
{
"error": "Signing secret must start with whsec_"
}
{
"error": "Signing is not available for Slack webhooks"
}
{
"error": "You do not have permission to manage webhook signing"
}
{
"error": "Webhook not found - Invalid webhook_id."
}
{
"error": "Webhook signing is already enabled; rotate to replace the secret"
}
{
"error": "JWT is on for this webhook. Switch to Signing secret to replace it.",
"code": "AUTH_METHOD_CONFLICT"
}
Turn off signing
DELETE https://server.smartlead.ai/api/v1/webhook/{webhook_id}/signing-secret takes no body and no rotate. It returns {"ok": true}, or 404 when the webhook is not yours.
Verify a delivery
Signed deliveries carry three headers:| Header | Value |
|---|---|
webhook-id | Event id (the same on every retry of that event) |
webhook-timestamp | Unix seconds when it was signed |
webhook-signature | v1,<base64 HMAC-SHA256> |
{webhook-id}.{webhook-timestamp}.{raw request body}. The HMAC key is the secret after whsec_, base64-decoded. Any Standard Webhooks library verifies this for you:
Python
from standardwebhooks.webhooks import Webhook
wh = Webhook("whsec_...") # your signing secret
payload = wh.verify(raw_body, request_headers) # raises if the signature is wrong
Node.js
import { Webhook } from "standardwebhooks";
const wh = new Webhook("whsec_..."); // your signing secret
const payload = wh.verify(rawBody, headers); // throws if the signature is wrong
