Skip to content
This site documents the main branch, which may hold changes not yet released. Latest release: v0.3.0 (changelog).

Send one email (any connection kind)

POST
/v1/emails
curl --request POST \
--url http://localhost:3000/v1/emails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "from": { "email": "example", "name": "example" }, "to": { "email": "example", "name": "example" }, "cc": { "email": "example", "name": "example" }, "bcc": { "email": "example", "name": "example" }, "replyTo": { "email": "example", "name": "example" }, "subject": "example", "html": "example", "text": "example", "headers": { "additionalProperty": "example" }, "tags": [ { "name": "example", "value": "example" } ], "attachments": [ { "filename": "example", "content": "example", "contentType": "example", "contentId": "example" } ], "metadata": { "additionalProperty": "example" } }'
Idempotency-Key

At most 256 characters, kept 24 h per connection: the same key and body replay the stored response, another body answers 409 idempotency_mismatch.

string
<= 256 characters

At most 256 characters, kept 24 h per connection: the same key and body replay the stored response, another body answers 409 idempotency_mismatch.

Media typeapplication/json
object
from
required
Any of:
string
to
required
Any of:
Any of:
string
cc
Any of:
Any of:
string
bcc
Any of:
Any of:
string
replyTo
Any of:
Any of:
string
subject
required
string
<= 998 characters
html
string
text
string
headers
object
key
additional properties
string
tags
Array<object>
<= 50 items
object
name
required
string
/^[\w-]{1,256}$/
value
required
string
<= 256 characters
attachments
Array<object>
<= 100 items
object
filename
required
string
>= 1 characters <= 255 characters
content
required
string format: base64
/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/
contentType
string
contentId
string
metadata
object
key
additional properties

Example generated

{
"from": {
"email": "example",
"name": "example"
},
"to": {
"email": "example",
"name": "example"
},
"cc": {
"email": "example",
"name": "example"
},
"bcc": {
"email": "example",
"name": "example"
},
"replyTo": {
"email": "example",
"name": "example"
},
"subject": "example",
"html": "example",
"text": "example",
"headers": {
"additionalProperty": "example"
},
"tags": [
{
"name": "example",
"value": "example"
}
],
"attachments": [
{
"filename": "example",
"content": "example",
"contentType": "example",
"contentId": "example"
}
],
"metadata": {
"additionalProperty": "example"
}
}

Accepted.

Media typeapplication/json
object
id
required
string
/^msg_[A-Za-z0-9-]{1,64}$/
status
required
string
Allowed values: queued sent delivered deferred soft_bounce hard_bounce complained failed invalid suppressed

Example

{
"status": "queued"
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

X-RateLimit-Limit

Requests per window.

integer
<= 9007199254740991

Requests per window.

X-RateLimit-Remaining

Whole tokens left in the bucket.

integer
<= 9007199254740991

Whole tokens left in the bucket.

X-RateLimit-Reset

Seconds until the bucket is full again.

integer
<= 9007199254740991

Seconds until the bucket is full again.

Idempotent-Replayed

Set when the response is replayed for the same Idempotency-Key.

string
Allowed value: true

Set when the response is replayed for the same Idempotency-Key.

Error: validation_error

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

X-RateLimit-Limit

Requests per window.

integer
<= 9007199254740991

Requests per window.

X-RateLimit-Remaining

Whole tokens left in the bucket.

integer
<= 9007199254740991

Whole tokens left in the bucket.

X-RateLimit-Reset

Seconds until the bucket is full again.

integer
<= 9007199254740991

Seconds until the bucket is full again.

Error: unauthorized

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

WWW-Authenticate
required

Sent with every 401.

string
Allowed value: Bearer

Sent with every 401.

X-RateLimit-Limit

Requests per window.

integer
<= 9007199254740991

Requests per window.

X-RateLimit-Remaining

Whole tokens left in the bucket.

integer
<= 9007199254740991

Whole tokens left in the bucket.

X-RateLimit-Reset

Seconds until the bucket is full again.

integer
<= 9007199254740991

Seconds until the bucket is full again.

Error: forbidden

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

X-RateLimit-Limit

Requests per window.

integer
<= 9007199254740991

Requests per window.

X-RateLimit-Remaining

Whole tokens left in the bucket.

integer
<= 9007199254740991

Whole tokens left in the bucket.

X-RateLimit-Reset

Seconds until the bucket is full again.

integer
<= 9007199254740991

Seconds until the bucket is full again.

Error: idempotency_mismatch

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

X-RateLimit-Limit

Requests per window.

integer
<= 9007199254740991

Requests per window.

X-RateLimit-Remaining

Whole tokens left in the bucket.

integer
<= 9007199254740991

Whole tokens left in the bucket.

X-RateLimit-Reset

Seconds until the bucket is full again.

integer
<= 9007199254740991

Seconds until the bucket is full again.

Error: payload_too_large

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

X-RateLimit-Limit

Requests per window.

integer
<= 9007199254740991

Requests per window.

X-RateLimit-Remaining

Whole tokens left in the bucket.

integer
<= 9007199254740991

Whole tokens left in the bucket.

X-RateLimit-Reset

Seconds until the bucket is full again.

integer
<= 9007199254740991

Seconds until the bucket is full again.

Error: validation_error

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

X-RateLimit-Limit

Requests per window.

integer
<= 9007199254740991

Requests per window.

X-RateLimit-Remaining

Whole tokens left in the bucket.

integer
<= 9007199254740991

Whole tokens left in the bucket.

X-RateLimit-Reset

Seconds until the bucket is full again.

integer
<= 9007199254740991

Seconds until the bucket is full again.

Error: rate_limited, chaos_injected

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

Retry-After
required

Seconds until one token is back (at least 1).

integer
<= 9007199254740991

Seconds until one token is back (at least 1).

X-RateLimit-Limit

Requests per window.

integer
<= 9007199254740991

Requests per window.

X-RateLimit-Remaining

Whole tokens left in the bucket.

integer
<= 9007199254740991

Whole tokens left in the bucket.

X-RateLimit-Reset

Seconds until the bucket is full again.

integer
<= 9007199254740991

Seconds until the bucket is full again.

Error: chaos_injected, internal_error

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

X-RateLimit-Limit

Requests per window.

integer
<= 9007199254740991

Requests per window.

X-RateLimit-Remaining

Whole tokens left in the bucket.

integer
<= 9007199254740991

Whole tokens left in the bucket.

X-RateLimit-Reset

Seconds until the bucket is full again.

integer
<= 9007199254740991

Seconds until the bucket is full again.

Error: chaos_injected

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

X-RateLimit-Limit

Requests per window.

integer
<= 9007199254740991

Requests per window.

X-RateLimit-Remaining

Whole tokens left in the bucket.

integer
<= 9007199254740991

Whole tokens left in the bucket.

X-RateLimit-Reset

Seconds until the bucket is full again.

integer
<= 9007199254740991

Seconds until the bucket is full again.

Error: chaos_injected

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

X-RateLimit-Limit

Requests per window.

integer
<= 9007199254740991

Requests per window.

X-RateLimit-Remaining

Whole tokens left in the bucket.

integer
<= 9007199254740991

Whole tokens left in the bucket.

X-RateLimit-Reset

Seconds until the bucket is full again.

integer
<= 9007199254740991

Seconds until the bucket is full again.