MaillyDocs

Add a webhook endpoint to an inbox address

Add a webhook endpoint to an inbox address with the Mailly email API for AI agents: POST /inbox/webhook/endpoints. Parameters, request body, responses and code samples.

POST
/inbox/webhook/endpoints

An address can have up to 10 endpoints; every active endpoint receives its own signed delivery. While an address has an active endpoint, its mail is no longer sent to the workspace default webhook. url must be public HTTPS and unique per address. A generated signing secret is returned only once.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Mailly API key(Authorization: Bearer )

Request Body

application/json
  1. body
addressId?string

Inbox address ID

url?string
active?boolean
bodyFormat?string

text / html / markdown

stripQuotes?boolean
signingSecret?string
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
filters?

Which mail to send; omitted lists keep their values, null clears all filters

maxPerMinute?integer

At most this many requests per minute (1-600); extra mail waits, it is not dropped

Range-9007199254740991 <= value <= 9007199254740991
batchWindowSeconds?integer

Wait this many seconds (10-3600) and merge mail that arrives meanwhile into one request; 0 sends each email on its own

Range-9007199254740991 <= value <= 9007199254740991
maxAttempts?integer

Attempts before a delivery is marked failed (1-8, default 8)

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

Response Body

Created

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