# Testing a Webhook

Send a test payload to verify your webhook endpoint

Before relying on a webhook in production, you should verify that your endpoint receives payloads correctly and responds with the expected status code. Mailnaptic provides a built-in test feature that sends a sample payload to your endpoint on demand.

## Sending a test payload

1. Go to **Organization → Webhooks**.
2. Find the endpoint you want to test and click its name to open the detail view.
3. Click the **Send Test** button.
4. Mailnaptic sends a test payload to your endpoint immediately. The test uses the `test.ping` event type with sample data.
5. The result appears below the button, showing the HTTP status code returned by your endpoint and the response time.

## Test payload structure

The test payload mirrors the format of real webhook deliveries:

```
{
  "event": "test.ping",
  "timestamp": "2026-03-18T15:00:00Z",
  "data": {
    "message": "This is a test webhook delivery from Mailnaptic.",
    "endpoint_id": "wh_abc123"
  }
}
```

The `X-Mailnaptic-Signature` header is included, so you can also verify your signature validation logic during the test.

## Using external testing tools

If you don't have a server ready yet, you can use free tools to inspect webhook payloads:

- **[webhook.site](https://webhook.site)** — gives you a temporary URL that captures and displays incoming requests.
- **[RequestBin](https://pipedream.com/requestbin)** — similar service for inspecting HTTP requests in real time.
- **ngrok** — tunnels requests to your local development server so you can debug with real tools and breakpoints.

### Example workflow with webhook.site

1. Visit [webhook.site](https://webhook.site) and copy the unique URL provided.
2. In Mailnaptic, create a new webhook endpoint using that URL.
3. Click **Send Test**.
4. Switch back to webhook.site and inspect the incoming request — headers, body, and timing.
5. Once you're satisfied, replace the URL with your production endpoint.

## Interpreting test results

| Status | Meaning | Action |
| --- | --- | --- |
| `200` or `2xx` | Your endpoint accepted the payload | No action needed — webhook is working |
| `4xx` | Client error (bad URL, auth required, etc.) | Check your endpoint's authentication and URL path |
| `5xx` | Server error on your endpoint | Check your server logs for errors |
| Timeout | No response within 10 seconds | Ensure your endpoint is reachable and responds quickly |

## Common issues

- **SSL certificate errors:** Mailnaptic requires a valid SSL certificate on your endpoint URL. Self-signed certificates are not accepted.
- **Firewall blocking:** Ensure your server allows inbound HTTPS traffic from external sources.
- **Redirect loops:** If your URL redirects (301/302), the webhook delivery may fail. Use the final destination URL directly.

> **Tip:** Run a test after any changes to your endpoint code or infrastructure to confirm everything still works.
