Mailly文档

Send a test event to the default inbound webhook

Send a test event to the default inbound webhook with the Mailly email API for AI agents: POST /inbox/webhook/test. Parameters, request body, responses and code samples.

POST
/inbox/webhook/test

Immediately sends one sample email to the endpoint exactly like a real delivery (template, custom headers, body length, signature; Mailly-Event-Type: webhook.test) and returns the receiver's status code and the first 4 KB of its response body, plus the request body that was sent. In raw mode the payload has the email.received shape with type webhook.test and test = true; the sample email is not stored, so content_url cannot be fetched. The optional JSON body can override url, bodyFormat, stripQuotes, headers, payloadMode, template and bodyMaxChars to try unsaved settings; nothing is saved. Works for disabled endpoints too; nothing is queued or retried.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Mailly API key(Authorization: Bearer )

Request Body

application/json
  1. body
url?string
bodyFormat?string
stripQuotes?boolean
headers?array<>

Custom request headers, at most 10. The list replaces all headers; values are stored encrypted and only returned masked.

payloadMode?string

raw sends the full email.received payload; template sends the rendered template

Value in"raw""template"
template?string

JSON template with {{variable}} placeholders: from, from_name, to, tag, subject, snippet, body_markdown, body_text, thread_id, message_id, internet_message_id, address_id, received_at, truncated, attachments_count, count, emails. Values are JSON-escaped, so put text variables inside quotes.

bodyMaxChars?integer

Truncate the body to this many characters (100-20000, default 20000)

Range-9007199254740991 <= value <= 9007199254740991
[key: string]?unknown

Response Body

Test sent (check test.ok for the endpoint result)

application/json
  1. response
success*boolean
test*
[key: string]?unknown
curl -X POST 'https://api.mailly.site/inbox/webhook/test' \  -H 'Content-Type: application/json' \  -d '{  "property1": null,  "property2": null}'
{  "success": true,  "test": {    "property1": null,    "property2": null  },  "property1": null,  "property2": null}