Skip to content

Send an email

POST
/api/v1/email/send
curl --request POST \
--url https://digize.com/api/v1/email/send \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "from": { "address": "orders@brightwave.example", "name": "Brightwave Coffee" }, "to": "maya@northloop.example", "subject": "Your order has shipped", "text": "It'\''s on its way: track it at https://brightwave.example/track/1042.", "reply_to": "hello@brightwave.example" }'

Sends a transactional email from any address at one of the workspace’s sending domains, to up to 50 recipients. A suppressed recipient is refused with a 400, unless the domain drops suppressed recipients. Counts toward the daily limit.

Needs the sites:write permission. It can’t be undone.

Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
from
required
object
address
required
string format: email
<= 254 characters /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/
name
string
<= 100 characters
to
required
Any of:
string format: email
<= 254 characters /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/
subject
required
string
>= 1 characters <= 998 characters
html
string
<= 4000000 characters
text
string
<= 4000000 characters
reply_to
string format: email
<= 254 characters /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/
headers
object
key
additional properties
string
<= 2048 characters

Example

{
"from": {
"address": "orders@brightwave.example",
"name": "Brightwave Coffee"
},
"to": "maya@northloop.example",
"subject": "Your order has shipped",
"text": "It's on its way: track it at https://brightwave.example/track/1042.",
"reply_to": "hello@brightwave.example"
}

Done

Media typeapplication/json
object
message_id
required
string
delivered
required
Array<string>
queued
required
Array<string>
permanent_bounces
required
Array<string>
suppressed_recipients
required
Array<string>

Example generated

{
"message_id": "example",
"delivered": [
"example"
],
"queued": [
"example"
],
"permanent_bounces": [
"example"
],
"suppressed_recipients": [
"example"
]
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}