---
title: "Send a test event"
method: POST
path: "/v1/webhooks/{id}/test"
tags: ["Webhooks"]
---

# Send a test event

`POST /v1/webhooks/{id}/test`

## Request

- Base URL: `https://api.mails.ai`
- URL: `https://api.mails.ai/v1/webhooks/{id}/test`
- Auth: HTTP bearer

**Requires scope:** `manage`. Fires a synthetic `webhook.test` event at the endpoint and reports the delivery result.

## Path parameters

- `id` string, required

## Response `200`

The test delivery result.

- object
  - `webhook_endpoint_id` string, required: The endpoint the test event was sent to: the id in the path. A paused endpoint is sent it too.
  - `event_id` string, required: Id of the `webhook.test` event that was sent (`evt_…`). It is stored with `test_mode` true, and `GET /v1/events/{id}` returns it.
  - `delivery_id` string, required: Id of this test's delivery record (`whd_…`), listed by `GET /v1/webhooks/{id}/deliveries`. A failed test is not retried.
  - `ok` boolean, required: True when the endpoint answered with a 2xx status.
  - `http_status` integer, nullable: The status the endpoint answered with, after following up to 3 redirects. Null when no answer came: a connection error, no answer within 5 seconds, or an address that is not public.
  - `response_excerpt` string: The first 500 characters of the endpoint's response body; when no answer came, the reason instead.

## Other responses

- `401`: Missing or invalid API key.
- `403`: The API key lacks the required scope (`insufficient_scope`), or the token belongs to an app connected by sign-in and this operation is closed to connected apps (`connected_app_not_allowed`).
- `404`: Resource not found in this workspace, or the agent a send names is archived (`agent_archived`).
- `429`: Rate or quota limit exceeded. The body's `resets_at` and `retry_after_seconds` say when the request can succeed. A `Retry-After` header is sent only when that is 60 seconds or less; a longer wait (an hourly, daily or monthly cap) sends none, so retry at `resets_at` or raise the limit instead of sleeping.
- `500`: Internal server error.

---

[API](https://skmtc.dev/mails/apis/mails-ai-api.md) · [All operations](https://skmtc.dev/mails/apis/mails-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mails/apis/mails-ai-api/revisions/4d4930a8c33b?raw)
