# Send a test event (/api-reference/webhooks/sendTestWebhook)

## POST /api/v1/webhook-endpoints/{endpoint_id}/test

Operation ID: `sendTestWebhook`
Send a test event
Sends a signed `webhook.test` event to the endpoint now, whatever its event filter, and returns the delivery with the endpoint's answer. A failed test is retried like any other delivery. Tests and redeliveries share a cap of 10 per endpoint per minute (429 with `Retry-After`).

### Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `endpoint_id` | path | yes | Webhook endpoint id. |

### Responses

#### 200 OK

Example (example):

```json
{
  "success": true,
  "webhookDelivery": {
    "attempts": 1,
    "createdAt": "2026-11-15T10:41:47.106000+00:00",
    "deliveredAt": "2026-11-15T10:42:07.512000+00:00",
    "endpointId": "4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07",
    "eventId": "evt_0a7e3d91c5b24f6c8e1d2b9a4f7c6e53",
    "eventType": "webhook.test",
    "id": "0d9a4e61-3c7b-4f2a-b815-6e2c9d7f0a38",
    "lastAttemptAt": "2026-11-15T10:42:07.512000+00:00",
    "lastError": "",
    "lastStatusCode": 200,
    "latencyMs": 184,
    "payload": {
      "apiVersion": "v1",
      "createdAt": "2026-11-15T10:45:00.000000Z",
      "data": {
        "endpointId": "4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07",
        "message": "This is a test event from Call Mitra."
      },
      "id": "evt_0a7e3d91c5b24f6c8e1d2b9a4f7c6e53",
      "type": "webhook.test"
    },
    "responseSnippet": "ok",
    "status": "delivered"
  }
}
```

#### 401 Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.

Example (The API key has expired.):

```json
{
  "detail": "The API key has expired.",
  "error": {
    "code": "api_key_expired",
    "docUrl": "https://docs.callmitra.ai/errors/api_key_expired",
    "message": "The API key has expired.",
    "param": null,
    "requestId": "req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69",
    "type": "authentication_error"
  }
}
```

Example (The API key is invalid or has been revoked.):

```json
{
  "detail": "The API key is invalid or has been revoked.",
  "error": {
    "code": "invalid_api_key",
    "docUrl": "https://docs.callmitra.ai/errors/invalid_api_key",
    "message": "The API key is invalid or has been revoked.",
    "param": null,
    "requestId": "req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69",
    "type": "authentication_error"
  }
}
```

Example (Authentication required.):

```json
{
  "detail": "Authentication required.",
  "error": {
    "code": "unauthenticated",
    "docUrl": "https://docs.callmitra.ai/errors/unauthenticated",
    "message": "Authentication required.",
    "param": null,
    "requestId": "req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69",
    "type": "authentication_error"
  }
}
```

#### 403 Forbidden: `api_key_scope_denied`, `permission_denied`, `webhook_workspace_required`.

Example (The API key does not have the scope required for this request.):

```json
{
  "detail": "The API key does not have the scope required for this request.",
  "error": {
    "code": "api_key_scope_denied",
    "docUrl": "https://docs.callmitra.ai/errors/api_key_scope_denied",
    "message": "The API key does not have the scope required for this request.",
    "param": null,
    "requestId": "req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69",
    "type": "permission_error"
  }
}
```

Example (You do not have permission to perform this action.):

```json
{
  "detail": "You do not have permission to perform this action.",
  "error": {
    "code": "permission_denied",
    "docUrl": "https://docs.callmitra.ai/errors/permission_denied",
    "message": "You do not have permission to perform this action.",
    "param": null,
    "requestId": "req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69",
    "type": "permission_error"
  }
}
```

Example (Webhooks are managed inside a workspace.):

```json
{
  "detail": "Webhooks are managed inside a workspace.",
  "error": {
    "code": "webhook_workspace_required",
    "docUrl": "https://docs.callmitra.ai/errors/webhook_workspace_required",
    "message": "Webhooks are managed inside a workspace.",
    "param": null,
    "requestId": "req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69",
    "type": "permission_error"
  }
}
```

#### 404 Not found: `webhook_endpoint_not_found`.

Example (Webhook endpoint not found.):

```json
{
  "detail": "Webhook endpoint not found.",
  "error": {
    "code": "webhook_endpoint_not_found",
    "docUrl": "https://docs.callmitra.ai/errors/webhook_endpoint_not_found",
    "message": "Webhook endpoint not found.",
    "param": null,
    "requestId": "req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69",
    "type": "not_found_error"
  }
}
```

#### 409 Conflict: `webhook_endpoint_disabled`.

Example (The webhook endpoint is disabled.):

```json
{
  "detail": "The webhook endpoint is disabled.",
  "error": {
    "code": "webhook_endpoint_disabled",
    "docUrl": "https://docs.callmitra.ai/errors/webhook_endpoint_disabled",
    "message": "The webhook endpoint is disabled.",
    "param": null,
    "requestId": "req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69",
    "type": "conflict_error"
  }
}
```

#### 422 Invalid parameters: `parameter_invalid`.

Example (One or more parameters are invalid.):

```json
{
  "detail": [
    {
      "loc": [
        "body",
        "phone"
      ],
      "msg": "Field required",
      "type": "missing"
    }
  ],
  "error": {
    "code": "parameter_invalid",
    "docUrl": "https://docs.callmitra.ai/errors/parameter_invalid",
    "message": "One or more parameters are invalid.",
    "param": "phone",
    "requestId": "req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69",
    "type": "invalid_request_error"
  }
}
```

#### 429 Too many requests: `rate_limit_exceeded`.

Example (Too many requests. Slow down and retry later.):

```json
{
  "detail": "Too many requests. Slow down and retry later.",
  "error": {
    "code": "rate_limit_exceeded",
    "docUrl": "https://docs.callmitra.ai/errors/rate_limit_exceeded",
    "message": "Too many requests. Slow down and retry later.",
    "param": null,
    "requestId": "req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69",
    "type": "rate_limit_error"
  }
}
```

#### 500 Server error: `internal_error`.

Example (Something went wrong on our side.):

```json
{
  "detail": "Something went wrong on our side.",
  "error": {
    "code": "internal_error",
    "docUrl": "https://docs.callmitra.ai/errors/internal_error",
    "message": "Something went wrong on our side.",
    "param": null,
    "requestId": "req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69",
    "type": "api_error"
  }
}
```

### Error codes

- [`api_key_expired`](/errors/api_key_expired)
- [`invalid_api_key`](/errors/invalid_api_key)
- [`unauthenticated`](/errors/unauthenticated)
- [`api_key_scope_denied`](/errors/api_key_scope_denied)
- [`permission_denied`](/errors/permission_denied)
- [`webhook_workspace_required`](/errors/webhook_workspace_required)
- [`webhook_endpoint_not_found`](/errors/webhook_endpoint_not_found)
- [`webhook_endpoint_disabled`](/errors/webhook_endpoint_disabled)
- [`parameter_invalid`](/errors/parameter_invalid)
- [`rate_limit_exceeded`](/errors/rate_limit_exceeded)
- [`internal_error`](/errors/internal_error)
