Send a message (Mailgun dialect)
Drop-in for Mailgun's POST /v3/{domain}/messages. Authenticate as Mailgun does, with HTTP Basic auth: username api, password your Sendly key (any other username is refused). A pk_ send-only key is accepted. The key must hold emails:send.
The body is multipart/form-data (application/x-www-form-urlencoded is read too). The {domain} path segment must equal the domain of the from address. Success is 200 { id, message }. Failures are a bare { message }. There is no Idempotency-Key support on this route.
Authorization
MailgunBasicAuth Mailgun-style authentication for the /api/compat/mailgun/* operations only: HTTP Basic with the username api and a Sendly API key (sk_*, or a pk_* send-only key) as the password, exactly as mailgun.js sends it.
In: header
Path Parameters
The sending domain; must equal the from address's domain.
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
A Mailgun messages.create() form. Custom headers travel as h:<Header-Name> fields (for example h:X-Campaign: spring); h:Reply-To sets the reply address instead of becoming a custom header. Any other h: field is passed through as a header; other o: and v: options are ignored.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/compat/mailgun/v3/string/messages" \ -F from="string" \ -F to="[ \"string\" ]" \ -F subject="string"{
"id": "<3f0d7c1e-9a52-4b0e-8d57-0b8f3a0c2a11@mail.example.com>",
"message": "Queued. Thank you."
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}