Skip to content

Send a transactional email

POST
/api/v1/sending/emails
curl --request POST \
--url https://dashboard.azimea.com/api/v1/sending/emails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: null' \
--data '{ "to": "ana@example.com", "subject": "Your order 1042 is confirmed", "html": "<p>Hi Ana,</p><p>Thank you for your order 1042. We will let you know when it ships.</p>", "idempotencyKey": null }'

Queues one email your own code asks for, about the person’s own account or order: an order confirmation, an access code, a password link. It is transactional, so it needs no marketing consent; it is only stopped for an address that bounced or complained, and then comes back with the status Suppressed and the reason (sending.gate_bounced, sending.gate_complained). Do not use it for newsletters or offers: those are campaigns and flows, which check consent. It goes out from your company’s default sender, on a verified domain; until one exists the email waits in the queue (sending.no_verified_sender). to is one address, subject at most 300 characters, html at most 500,000 characters. The answer’s id is the message id the delivery webhooks (email.delivered, email.bounced, email.complained) carry. Send an Idempotency-Key header (your own id for this send, up to 150 visible ASCII characters) to make retries safe: a second call with the same key, from any key of your account, returns the first message and sends nothing more, even if its body differs. Without the header, a retry queues a second email. Needs the emails:send permission.

Idempotency-Key
string
nullable
Example
null
Media typeapplication/json
object
to
required
string format: email
0 <= 320 characters /^[^@]+@[^@]+$/
Example
ana@example.com
subject
required
string
0 <= 300 characters
Example
Your order 1042 is confirmed
html
required
string
0 <= 500000 characters
Example
<p>Hi Ana,</p><p>Thank you for your order 1042. We will let you know when it ships.</p>
Example
{
"to": "ana@example.com",
"subject": "Your order 1042 is confirmed",
"html": "<p>Hi Ana,</p><p>Thank you for your order 1042. We will let you know when it ships.</p>",
"idempotencyKey": null
}

The message id and its status: Queued, or Suppressed with the reason

Media typeapplication/json
object
isSuccess
boolean
value
One of:
object
id
string format: guid
status
string
Allowed values: Queued Sent Failed Suppressed Delivered Bounced HandingOff Accepted Unknown
reason
string
nullable
status
integer format: int32
errors
Array<object>
object
code
string
message
string
params
object
key
additional properties
fieldErrors
object
key
additional properties
Array<object>
object
code
string
message
string
params
object
key
additional properties
Example
{
"isSuccess": true,
"value": {
"id": "01a10900-0000-7000-8000-000000000301",
"status": "Queued",
"reason": null
},
"status": 0,
"errors": [],
"fieldErrors": null
}

Validation failed: see errors[].code and fieldErrors

Media typeapplication/problem+json
object
statusCode
integer format: int32
default: 400
message
string
default: One or more errors occurred!
errors
object
key
additional properties
Array<string>
Example
{
"statusCode": 400,
"message": "One or more errors occurred!"
}

Missing or invalid API key

The key lacks the emails:send permission