Receive a signed text-only Mailgun delivery
const url = 'https://example.com/api/inbound-email';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({ timestamp: 'example', token: 'example', signature: 'example', from: 'example', recipient: 'example', subject: 'example', 'stripped-text': 'example', 'body-plain': 'example', 'Message-Id': 'example' })};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/inbound-email \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data timestamp=example \ --data token=example \ --data signature=example \ --data from=example \ --data recipient=example \ --data subject=example \ --data stripped-text=example \ --data body-plain=example \ --data Message-Id=exampleVerifies Mailgun’s timestamp/token HMAC, resolves the workspace alias and visible From membership, and durably claims the delivery. Attachment fields are ignored.
Request Body required
Section titled “Request Body required ”object
Unix timestamp included in Mailgun’s HMAC input.
Per-delivery Mailgun signing token and durable idempotency key.
Visible From address used for the accepted MVP membership check.
Workspace alias recipient; only the normalized local part is routed.
Preferred visible plain-text body.
Plain-text fallback when stripped-text is empty.
object
Unix timestamp included in Mailgun’s HMAC input.
Per-delivery Mailgun signing token and durable idempotency key.
Visible From address used for the accepted MVP membership check.
Workspace alias recipient; only the normalized local part is routed.
Preferred visible plain-text body.
Plain-text fallback when stripped-text is empty.
Responses
Section titled “ Responses ”Delivery claimed or already acknowledged
Signature, routing, authorization, or content rejection
Transient or unknown post-signature failure; Mailgun should retry