Test an endpoint
Fire a signed sample event at an endpoint through the real delivery pipeline.
Test a webhook endpoint
Fires a sample payload at the endpoint through the real delivery pipeline: the same Wemail-Signature-Ed25519 platform signature as organic deliveries, the endpoint’s receiver-side auth (hmac/bearer/basic/custom headers/OAuth 2.0/mTLS), the worker’s 30-second timeout and full SSRF protections. The payload is the native delivery shape with an explicit "test": true marker so your receiver can discriminate test traffic — verify your signature code against it before going live. Note that on organic events data.test: true alone means the message was simulated either by one of your test keys or because wemail support routed the account or API key to the Sandbox — the latter additionally carry data.routed: true, which is how you tell them apart.
POST /v3/webhooks/{id}/test
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
event | string | Optional | Event type to simulate: queued, sent, delivered, opened, clicked, bounced, complained, unsubscribed, delayed, rejected, failed or resubscribed. Default delivered. You can omit the body entirely. |
What your endpoint receives
{
"event": "delivered",
"message_id": "msg_test_a1b2c3d4e5f6",
"recipient": "test@example.com",
"timestamp": "2026-08-30T09:15:00.000Z",
"data": {
"from": "sender@yourdomain.com",
"subject": "Test email subject",
"tags": [
"transactional",
"test"
]
},
"test": true
}The attempt is recorded in the endpoint’s delivery history (Console → Webhooks → Activity) as a test row — it never enters the retry schedule and is not resendable. The response reports the outcome per fired event: your endpoint’s HTTP status (null when the request never completed — timeout or network failure), the round-trip latency_ms, and success (a 2xx answer within the timeout).
Responses
| Status | Description |
|---|---|
200 | OK. { deliveries: [{ event, status, latency_ms, success }] } — one entry per fired event. |
400 | Validation error — an unknown event type, an endpoint URL that fails SSRF checks, or receiver auth that could not be resolved (e.g. an OAuth token fetch failure). |
401 | Missing or invalid API key. |
404 | No webhook with this id on your account. |
429 | Rate limit exceeded (10 calls/minute). |
Code examples
# Fire a signed sample "delivered" event at the endpoint
curl -X POST https://api.wemail.io/v3/webhooks/9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c/test \
-H "Authorization: Bearer afn_live_…" \
-H "Content-Type: application/json" \
-d '{ "event": "delivered" }'import { WemailClient } from "@wemailio/sdk";
const wemail = new WemailClient(process.env.WEMAIL_API_KEY);
// Sends a signed sample payload ("test": true) through the real
// pipeline — Ed25519 signature, receiver auth, 30 s timeout.
const { deliveries } = await wemail.webhooks.testWebhookEndpoint({
id: "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c",
testWebhookEndpointRequest: { event: "bounced" },
});
console.log(deliveries[0].status, deliveries[0].latencyMs, deliveries[0].success);import os
from wemail import WemailClient, TestWebhookEndpointRequest
wemail = WemailClient(api_key=os.environ["WEMAIL_API_KEY"])
result = wemail.webhooks.test_webhook_endpoint(
"9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c",
TestWebhookEndpointRequest(event="bounced"),
)
d = result.deliveries[0]
print(d.status, d.latency_ms, d.success)<?php
$wemail = new \Wemail\WemailClient(getenv('WEMAIL_API_KEY'));
$result = $wemail->webhooks()->testWebhookEndpoint(
'9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c',
new \Wemail\Sdk\Model\TestWebhookEndpointRequest(['event' => 'bounced'])
);
$d = $result->getDeliveries()[0];wemail = Wemail::Client.new(api_key: ENV["WEMAIL_API_KEY"])
result = wemail.webhooks.test_webhook_endpoint(
"9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c",
test_webhook_endpoint_request: Wemail::TestWebhookEndpointRequest.new(event: "bounced")
)
d = result.deliveries.first
puts d.status, d.latency_ms, d.successclient, _ := wemail.NewClient(os.Getenv("WEMAIL_API_KEY"))
// Generated layer (client.API.*): pass the key in the context.
ctx := context.WithValue(context.Background(), wemail.ContextAccessToken, os.Getenv("WEMAIL_API_KEY"))
res, _, err := client.API.WebhooksAPI.
TestWebhookEndpoint(ctx, "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c").
TestWebhookEndpointRequest(wemail.TestWebhookEndpointRequest{Event: wemail.PtrString("bounced")}).
Execute()
d := res.Deliveries[0]
fmt.Println(d.Success, d.LatencyMs)WemailClient wemail = new WemailClient(System.getenv("WEMAIL_API_KEY"));
WebhookTestResult res = wemail.webhooks().testWebhookEndpoint(
UUID.fromString("9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c"),
new TestWebhookEndpointRequest().event(TestWebhookEndpointRequest.EventEnum.BOUNCED));
WebhookTestDelivery d = res.getDeliveries().get(0);
System.out.println(d.getStatus() + " " + d.getLatencyMs() + " " + d.getSuccess());var wemail = new WemailClient(Environment.GetEnvironmentVariable("WEMAIL_API_KEY"));
var res = await wemail.Webhooks.TestWebhookEndpointAsync(
Guid.Parse("9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c"),
new TestWebhookEndpointRequest(TestWebhookEndpointRequest.EventEnum.Bounced));
var d = res.Deliveries[0];
Console.WriteLine(quot;{d.Status} {d.LatencyMs} {d.Success}");{
"deliveries": [
{
"event": "delivered",
"status": 200,
"latency_ms": 184,
"success": true
}
]
}