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

# Test Webhook

> Fire a sample event at a webhook and report the delivery result

## Test Webhook

```text theme={"dark"}
POST /v1/webhooks/{id}/test
```

Sends a synthetic `webhook.test` event to the webhook's configured URL and returns the
delivery result (HTTP status and latency). Use it to confirm a webhook endpoint is
reachable and that signature verification works before relying on it.

The test delivery goes through the **same hardened path as real events**: the
resolve-and-pin SSRF egress (a test cannot reach a private/internal address) and the same
HMAC signing. The attempt is recorded in the webhook's delivery logs. Retries are disabled
for the test so you get an immediate result.

### Response

```json theme={"dark"}
{
  "data": {
    "success": true,
    "status": 200,
    "response_time_ms": 142
  },
  "meta": { "request_id": "550e8400-e29b-41d4-a716-446655440000" }
}
```

When delivery fails, `success` is `false` and `error` describes why:

```json theme={"dark"}
{
  "data": { "success": false, "response_time_ms": 5012, "error": "Request timeout" },
  "meta": { "request_id": "..." }
}
```

<CodeGroup>
  ```bash cURL theme={"dark"}
  curl -X POST https://api.knoxcall.com/v1/webhooks/a1b2c3d4-.../test \
    -H "Authorization: Bearer kc_live_abc123..."
  ```

  ```javascript Node.js theme={"dark"}
  const resp = await fetch(
    "https://api.knoxcall.com/v1/webhooks/a1b2c3d4-.../test",
    { method: "POST", headers: { Authorization: "Bearer kc_live_abc123..." } }
  );
  const { data } = await resp.json();
  console.log(data.success ? `delivered in ${data.response_time_ms}ms` : data.error);
  ```
</CodeGroup>

### Errors

| Status | Type                | Description                                                |
| ------ | ------------------- | ---------------------------------------------------------- |
| 404    | `not_found`         | No webhook with that ID in the current mode (Live/Sandbox) |
| 403    | `permission_denied` | Tenant policy denies the `test` action on `webhook`        |
