# Test Webhook

> POST /webhooks/:id/test — send a test event to a webhook endpoint.

`POST /webhooks/:id/test`

Sends a synchronous test delivery to the webhook's `endpoint`. SendPing fires a `test` event regardless of the webhook's subscribed event types and returns the live result — including the HTTP status your endpoint responded with. No retry is queued on failure, and a test never affects the endpoint's health (its `failure_count`, last-delivery status, or the 50-failure auto-disable) — it is recorded in the delivery history only.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The webhook id as returned by [Create Webhook](https://www.sendping.co/docs/api/webhooks-create) or [List Webhooks](https://www.sendping.co/docs/api/webhooks-list) — a numeric string (e.g. `17`), not a UUID. A non-numeric id returns `not_found` (404). |

**Node.js**

```js
import { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

const { data, error } = await mb.webhooks.test('17');
console.log({ data, error });
```

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Webhooks.test("17")
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

$sendping->webhooks->test('17');
```

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.Webhooks.test("17")
```

**Go**

```go
import "github.com/shekhu10/sendping-sdks/sendping-go"

client := sendping.NewClient("mb_xxxxxxxxx")

result, err := client.Webhooks.Test("17")
```

**Rust**

```rust
use sendping::SendPing;

let mb = SendPing::new("mb_xxxxxxxxx");

let _result = mb.webhooks.test("17").await?;
```

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.webhooks().test("17");
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

var resp = await sendping.WebhookTestAsync("17");
```

**cURL**

```bash
curl -X POST 'https://www.sendping.co/api/webhooks/17/test' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
sendping webhooks test 17
```

### Response

Returns a `webhook_test` object. `ok` is `true` when your endpoint responded with a 2xx status. `status` is the HTTP status code your endpoint returned. `error` is present only when delivery failed (network error or non-2xx response).

```json
{
  "object": "webhook_test",
  "id": "17",
  "ok": true,
  "status": 200
}
```

> **Note:** A failed test — e.g. `"ok": false, "status": 404, "error": "HTTP 404"` — means your endpoint is reachable but returned a non-2xx response. Check your server logs and ensure the endpoint accepts `POST` requests with a `Content-Type: application/json` body.
