# Send a test event

> Queues a `ping` event to this endpoint alone; it is sent within about 30 seconds.

`POST /v1/webhook-endpoints/{endpointId}/test`

Queues a `ping` event to this endpoint alone; it is sent within about 30 seconds. The response is the queued delivery — read its outcome with GET …/deliveries.

**Permissions:** any valid key · **Kind:** write · **Cost:** 1 unit

Cannot be undone.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `endpointId` | uuid | yes |  |

## Body

_None._

## Response `201`

| Field | Type | Required | Description |
|---|---|---|---|
| `object` | "webhook_delivery" | yes |  |
| `id` | uuid | yes |  |
| `endpointId` | uuid | yes |  |
| `eventId` | uuid | yes | Also the `webhook-id` header the receiver got. |
| `eventType` | string | yes |  |
| `status` | "pending" \| "sending" \| "succeeded" \| "failed" \| "skipped" | yes |  |
| `attempts` | integer | yes |  |
| `nextAttemptAt` | string \| null | yes | When it is tried again; null unless pending. |
| `lastStatusCode` | integer \| null | yes |  |
| `lastError` | string \| null | yes |  |
| `lastDurationMs` | integer \| null | yes |  |
| `createdAt` | string | yes |  |
| `updatedAt` | string | yes |  |

## Errors

Errors are [problem details](https://api.bymundi.com/docs/guides/errors.md). Besides the refusals described above, any call like this one can return:

- [`invalid_request`](https://api.bymundi.com/problems/invalid_request.md) — Invalid request
- [`unauthorized`](https://api.bymundi.com/problems/unauthorized.md) — Missing or invalid API key
- [`insufficient_scope`](https://api.bymundi.com/problems/insufficient_scope.md) — Missing permission
- [`rate_limited`](https://api.bymundi.com/problems/rate_limited.md) — Rate limit reached
- [`not_found`](https://api.bymundi.com/problems/not_found.md) — Not found
- [`idempotency_key_reused`](https://api.bymundi.com/problems/idempotency_key_reused.md) — Idempotency-Key reused
- [`request_in_progress`](https://api.bymundi.com/problems/request_in_progress.md) — Request in progress

## Examples

#### curl

```bash
curl -X POST https://api.bymundi.com/v1/webhook-endpoints/$ENDPOINT_ID/test \
  -H "Authorization: Bearer $BYMUNDI_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{}'
```

#### JavaScript

```javascript
const res = await fetch(`https://api.bymundi.com/v1/webhook-endpoints/${endpointId}/test`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BYMUNDI_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();
```

#### Python

```python
import os, uuid, requests

res = requests.post(
    f"https://api.bymundi.com/v1/webhook-endpoints/{endpointId}/test",
    headers={"Authorization": f"Bearer {os.environ['BYMUNDI_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
    json={},
)
res.raise_for_status()
data = res.json()
```
