> ## Documentation Index
> Fetch the complete documentation index at: https://api.smartlead.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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

Signs every delivery of a webhook (first send and retries) with the [Standard Webhooks](https://www.standardwebhooks.com/) scheme. Works for user, client and campaign webhooks. The webhook id is the one from [Create Webhook](https://api.smartlead.ai/api-reference/webhooks/create.md) or [Get Campaign Webhooks](https://api.smartlead.ai/api-reference/campaigns/get-webhooks.md).

* `POST` turns signing on. SmartLead generates the secret, or stores yours if you send `signing_secret`.
* `POST ?rotate=true` replaces an existing secret straight away (the old secret stops working at once).
* `DELETE` turns signing off.

The secret is returned in the response. Store it: it is also shown on [Get Campaign Webhooks](https://api.smartlead.ai/api-reference/campaigns/get-webhooks.md), but never in logs.

Who can manage signing: the account owner, team members with admin or full member access, and clients with full access. Others get 403.

## Path Parameters

**webhook\_id** `integer` *required*

Webhook id (positive integer)

## Query Parameters

**api\_key** `string` *required*

Your SmartLead API key

**rotate** `boolean`

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.

**signing\_secret** `string`

Your own secret instead of a generated one. Must be `whsec_` followed by standard base64 that decodes to 24 to 64 bytes.

**replace\_other\_method** `boolean`

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

```bash Turn on theme={null}
curl -X POST "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY"
```

```bash Rotate theme={null}
curl -X POST "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY&rotate=true"
```

```bash Turn off theme={null}
curl -X DELETE "https://server.smartlead.ai/api/v1/webhook/456/signing-secret?api_key=YOUR_KEY"
```

```json 200 - POST theme={null}
{
  "ok": true,
  "signing_secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw",
  "jwt_enabled": false
}
```

```json 200 - DELETE theme={null}
{
  "ok": true
}
```

```json 400 - Bad secret theme={null}
{
  "error": "Signing secret must start with whsec_"
}
```

```json 400 - Slack webhook theme={null}
{
  "error": "Signing is not available for Slack webhooks"
}
```

```json 403 theme={null}
{
  "error": "You do not have permission to manage webhook signing"
}
```

```json 404 theme={null}
{
  "error": "Webhook not found - Invalid webhook_id."
}
```

```json 409 - Already signed theme={null}
{
  "error": "Webhook signing is already enabled; rotate to replace the secret"
}
```

```json 409 - JWT is on theme={null}
{
  "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>` |

The signed text is `{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 Python theme={null}
from standardwebhooks.webhooks import Webhook

wh = Webhook("whsec_...")  # your signing secret
payload = wh.verify(raw_body, request_headers)  # raises if the signature is wrong
```

```javascript Node.js theme={null}
import { Webhook } from "standardwebhooks";

const wh = new Webhook("whsec_..."); // your signing secret
const payload = wh.verify(rawBody, headers); // throws if the signature is wrong
```

Verify against the raw body bytes you received, before any JSON parsing, and reject old timestamps to stop replays.

## Related Endpoints

* [Create Webhook](https://api.smartlead.ai/api-reference/webhooks/create.md)
* [Get Campaign Webhooks](https://api.smartlead.ai/api-reference/campaigns/get-webhooks.md)
* [Webhook Events](https://api.smartlead.ai/api-reference/webhooks/events.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.