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

# Send a Test Webhook

> Send one test event to a webhook's saved URL and see what the URL answered

Sends one test delivery to the webhook's saved URL, so an agent can check a receiver end to end before it relies on it. The body is the same sample payload the app's **Test** button sends for that event, with the webhook's own `webhook_id`, `webhook_name`, `event_type`, `campaign_id` (when the webhook is on a campaign), `webhookUrl` and `webhook_url` filled in and `is_test: true` added.

When signing is on for the webhook (see [Webhook Signing Secret](https://api.smartlead.ai/api-reference/webhooks/signing-secret.md)), the test is signed like real deliveries only if your key may manage signing: a main account key, or a client key whose client has full access. Other keys get an unsigned test (`signed: false`) even though real deliveries are signed; the test is also sent unsigned if the signing lookup fails. Check `signed` before you test your signature verification.

Only public addresses are called: a webhook URL that points to a private or local address is refused with a 400, and redirects are not followed. The URL must answer within 10 seconds, with at most 64 KB.

With a client API key, only webhooks of that client can be tested.

## Path Parameters

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

The webhook ID (a positive integer, at most 2147483647)

## Query Parameters

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

Your SmartLead API key (a main or client key)

## Request Body

**event\_type** `string`

The event to send a sample of. One of `EMAIL_SENT`, `FIRST_EMAIL_SENT`, `EMAIL_OPEN`, `EMAIL_LINK_CLICK`, `EMAIL_REPLY`, `LEAD_UNSUBSCRIBED`, `LEAD_CATEGORY_UPDATED`, `EMAIL_BOUNCE`, `CAMPAIGN_STATUS_CHANGED`, `UNTRACKED_REPLIES`, `MANUAL_STEP_REACHED`, `MANUAL_REPLY_SENT`. Default: the first event type the webhook is subscribed to that has a sample (`EMAIL_ACCOUNT_DISCONNECTED` and `LINKEDIN_DISCONNECTED` have none). A webhook subscribed to no event gets an `EMAIL_SENT` sample; one subscribed only to the two `DISCONNECTED` events gets a 400 unless you pass `event_type`.

```bash cURL theme={null}
curl -X POST "https://server.smartlead.ai/api/v1/webhook/2152/test?api_key=YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"event_type": "EMAIL_REPLY"}'
```

```python Python theme={null}
import requests

response = requests.post(
    "https://server.smartlead.ai/api/v1/webhook/2152/test",
    params={"api_key": "YOUR_API_KEY"},
    json={"event_type": "EMAIL_REPLY"},
)
print(response.status_code, response.json())
```

## Response Fields

**ok** `boolean`

`true` when your URL accepted the test (a 2xx answer)

**delivered** `boolean`

Same as `ok` for a delivery attempt

**signed** `boolean`

Whether the test carried signature headers or a bearer token (only on success). See the signing note above.

**webhook\_id** `integer`

The webhook tested

**event\_type** `string`

The event type whose sample was sent

**receiver\_status\_code** `integer`

On a 502: the HTTP status your URL answered, or `null` when it could not be reached, timed out or answered with more than 64 KB

**error** `string`

On any failure: what went wrong

## Response Codes

**200** `Success`

Your URL answered with a 2xx

**400** `Bad Request`

`event_type` is not one of the values above; the chosen event type has no test sample; the saved URL is not a valid URL or points to a private or local address; `webhook_id` is not a positive integer up to 2147483647; or an unknown query parameter or body key

**401** `Unauthorized`

Invalid or missing API key

**404** `Not Found`

No webhook with this ID in your account (or your client, for a client key)

**502** `Bad Gateway`

Your URL answered with a non-2xx status, could not be reached, did not answer within 10 seconds, or answered with more than 64 KB

**500** `Internal Server Error`

Server error; retry the request

```json 200 - Delivered theme={null}
{
  "ok": true,
  "delivered": true,
  "signed": true,
  "webhook_id": 2152,
  "event_type": "EMAIL_REPLY"
}
```

```json 502 - Your URL failed theme={null}
{
  "ok": false,
  "delivered": false,
  "webhook_id": 2152,
  "event_type": "EMAIL_REPLY",
  "receiver_status_code": 500,
  "error": "Your webhook URL answered HTTP 500"
}
```

```json 400 - Private address theme={null}
{
  "ok": false,
  "delivered": false,
  "webhook_id": 2152,
  "event_type": "EMAIL_REPLY",
  "error": "Test deliveries only go to public addresses; this webhook URL points to a private or local address."
}
```

```json 404 - Not Found theme={null}
{
  "ok": false,
  "error": "Webhook not found - Invalid webhook_id."
}
```

```json 500 - Internal Server Error theme={null}
{
  "ok": false,
  "error": "Failed to send the test webhook"
}
```


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