# Send a test to a webhook endpoint

Source: https://docs.usetone.ai/reference/integrations/testWebhook

> POSTs your `body` to the endpoint once, signed with its secret exactly as a delivery is, and says what your server answered.

`POST /v1/integrations/webhooks/{id}/test`
POSTs your `body` to the endpoint once, signed with its secret exactly as a delivery is, and says what your server answered. The test carries `x-tone-test: 1` and an `x-tone-event-id` starting `test_`; your handler otherwise sees a real delivery, so use test data. Nothing is recorded: no delivery-log row, and no failure counts toward switching the endpoint off. At most 20 a minute. A live key or the dashboard only: a test key gets `403`, because an endpoint receives live events too.

Requires the `admin` scope.

## Parameters

| Name | In | | Meaning |
|---|---|---|---|
| `id` | path | required | The webhook endpoint's id. |

## Request body

| Field | Type | | Meaning |
|---|---|---|---|
| `body` | object | required | The JSON object to POST, exactly as given — at most 64 KB. Use a real delivery's shape to test your handler end to end. |
| `eventType` | string | optional | What `x-tone-event` says. Defaults to `call.completed`. Open set — handle an unrecognised value rather than throwing. Today: `call.initiated`, `call.answered`, `call.completed`, `call.failed`, `campaign.completed`, `campaign.paused`, `compliance.check.blocked`, `wallet.balance.low`, `number.suspended`, `number.reactivated`, `number.renewal_due`, `number.released`, `knowledge.build.completed`, `knowledge.build.failed`, `call.transfer_started`, `call.transferred`, `call.transfer_failed`. |

### Example request

```json
{
  "body": {
    "data": {
      "call": {
        "id": "b2e4c1d0-…",
        "outputs": {
          "order_confirmed": "confirmed"
        }
      }
    },
    "type": "call.completed"
  },
  "eventType": "call.completed"
}
```

## Response

| Field | Type | | Meaning |
|---|---|---|---|
| `delivered` | boolean | required | Your server answered 2xx — what a real delivery counts as delivered. |
| `durationMs` | integer | required | From sending to your answer, in milliseconds. |
| `error` | string | null | required | Why nothing answered: `timeout` (no answer in 10 seconds), `unreachable` (DNS, refused, reset), `blocked_url` (the URL resolves to a private address). Null when your server answered. Open set — handle an unrecognised value rather than throwing. Today: `timeout`, `unreachable`, `blocked_url`. |
| `eventId` | string | required | The `x-tone-event-id` the test carried — `test_` and a random id, so your de-duplication never mistakes it for a real event. |
| `status` | integer | null | required | The HTTP status your server answered. Null when it never answered. |

### Example response

```json
{
  "data": {
    "delivered": true,
    "durationMs": 312,
    "error": null,
    "eventId": "test_5b2c1e3d-9a4f-4e6b-8c7d-1f2e3a4b5c6d",
    "status": 200
  }
}
```
