API reference
Base URL https://api.waitformail.com. Every request carries an API key from the console: Authorization: Bearer wfm_.... Errors are JSON: { "error": { "code", "message", "details" } }, where code is stable and meant for programs. The same description as OpenAPI 3.1: openapi.json (also served by the API at /v1/openapi.json).
Get a project and its domains
Parameters
| Name | In | Type | Description |
|---|
projectId | path | string (uuid), required | |
Responses
200 Default Response
| Field | Type | Description |
|---|
id | string (uuid) | |
name | string | |
retentionDays | integer | |
domains | array of object | |
domains[].name | string | |
domains[].kind | "system" | "custom" | |
domains[].status | "pending" | "active" | Mail is accepted for active domains only |
404 Default Response
| Field | Type | Description |
|---|
error | object | |
error.code | string | |
error.message | string | |
error.details | object | |
List messages, newest first
Parameters
| Name | In | Type | Description |
|---|
to | query | string | Recipient address, exact match |
from | query | string | Sender address (From header or envelope) |
subject | query | string | Part of the subject, any case |
received_after | query | string (date-time) | Only messages received after this moment |
limit | query | integer | min 1, max 100, default 50 |
cursor | query | string | |
projectId | path | string (uuid), required | |
Responses
200 Default Response
| Field | Type | Description |
|---|
data | array of object | |
data[].id | string (uuid) | |
data[].projectId | string (uuid) | |
data[].source | "mx" | "trap" | |
data[].to | string | Envelope recipient this copy of the message was accepted for |
data[].from | object or null | From header |
data[].from.address | string | |
data[].from.name | string | |
data[].subject | string | |
data[].receivedAt | string (date-time) | |
data[].expiresAt | string (date-time) | |
data[].size | integer | |
data[].attachmentCount | integer | |
nextCursor | string or null | |
404 Default Response
| Field | Type | Description |
|---|
error | object | |
error.code | string | |
error.message | string | |
error.details | object | |
Delete all messages of a project, or those of one recipient
Parameters
| Name | In | Type | Description |
|---|
to | query | string | Only messages of this recipient |
projectId | path | string (uuid), required | |
Responses
200 Default Response
| Field | Type | Description |
|---|
deleted | integer | |
404 Default Response
| Field | Type | Description |
|---|
error | object | |
error.code | string | |
error.message | string | |
error.details | object | |
Wait for a message
Returns the earliest message that matches the filters, at once when it is already there, otherwise as soon as it arrives. Answers 408 message_timeout when none arrives in time.
Parameters
| Name | In | Type | Description |
|---|
to | query | string | Recipient address, exact match |
from | query | string | Sender address (From header or envelope) |
subject | query | string | Part of the subject, any case |
received_after | query | string (date-time) | Only messages received after this moment |
timeout | query | integer | Seconds to wait for a matching message. min 0, max 60, default 30 |
projectId | path | string (uuid), required | |
Responses
200 Default Response
| Field | Type | Description |
|---|
id | string (uuid) | |
projectId | string (uuid) | |
source | "mx" | "trap" | |
to | string | Envelope recipient this copy of the message was accepted for |
from | object or null | From header |
from.address | string | |
from.name | string | |
subject | string | |
receivedAt | string (date-time) | |
expiresAt | string (date-time) | |
size | integer | |
envelope | object | |
envelope.from | string | |
envelope.to | string | |
recipients | object | To and Cc headers |
recipients.to | array of object | |
recipients.to[].address | string | |
recipients.to[].name | string | |
recipients.cc | array of object | |
recipients.cc[].address | string | |
recipients.cc[].name | string | |
date | string (date-time) or null | Date header |
text | string or null | |
html | string or null | |
headers | array of object | |
headers[].name | string | |
headers[].value | string | |
attachments | array of object | |
attachments[].index | integer | |
attachments[].filename | string or null | |
attachments[].contentType | string | |
attachments[].size | integer | |
attachments[].contentId | string or null | |
attachments[].inline | boolean | |
links | array of object | |
links[].url | string | |
links[].text | string | |
codes | array of string | Digit runs of 4 to 8 characters found in the text |
auth | object | |
auth.spf | object or null | |
auth.spf.result | string | |
auth.spf.domain | string or null | |
auth.dkim | array of object | |
auth.dkim[].result | string | |
auth.dkim[].domain | string or null | |
auth.dkim[].selector | string or null | |
auth.dmarc | object or null | |
auth.dmarc.result | string | |
auth.dmarc.domain | string or null | |
auth.dmarc.policy | string or null | |
404 Default Response
| Field | Type | Description |
|---|
error | object | |
error.code | string | |
error.message | string | |
error.details | object | |
408 Default Response
| Field | Type | Description |
|---|
error | object | |
error.code | string | |
error.message | string | |
error.details | object | |
429 Default Response
| Field | Type | Description |
|---|
error | object | |
error.code | string | |
error.message | string | |
error.details | object | |
Get a message
Parameters
| Name | In | Type | Description |
|---|
id | path | string (uuid), required | |
Responses
200 Default Response
| Field | Type | Description |
|---|
id | string (uuid) | |
projectId | string (uuid) | |
source | "mx" | "trap" | |
to | string | Envelope recipient this copy of the message was accepted for |
from | object or null | From header |
from.address | string | |
from.name | string | |
subject | string | |
receivedAt | string (date-time) | |
expiresAt | string (date-time) | |
size | integer | |
envelope | object | |
envelope.from | string | |
envelope.to | string | |
recipients | object | To and Cc headers |
recipients.to | array of object | |
recipients.to[].address | string | |
recipients.to[].name | string | |
recipients.cc | array of object | |
recipients.cc[].address | string | |
recipients.cc[].name | string | |
date | string (date-time) or null | Date header |
text | string or null | |
html | string or null | |
headers | array of object | |
headers[].name | string | |
headers[].value | string | |
attachments | array of object | |
attachments[].index | integer | |
attachments[].filename | string or null | |
attachments[].contentType | string | |
attachments[].size | integer | |
attachments[].contentId | string or null | |
attachments[].inline | boolean | |
links | array of object | |
links[].url | string | |
links[].text | string | |
codes | array of string | Digit runs of 4 to 8 characters found in the text |
auth | object | |
auth.spf | object or null | |
auth.spf.result | string | |
auth.spf.domain | string or null | |
auth.dkim | array of object | |
auth.dkim[].result | string | |
auth.dkim[].domain | string or null | |
auth.dkim[].selector | string or null | |
auth.dmarc | object or null | |
auth.dmarc.result | string | |
auth.dmarc.domain | string or null | |
auth.dmarc.policy | string or null | |
404 Default Response
| Field | Type | Description |
|---|
error | object | |
error.code | string | |
error.message | string | |
error.details | object | |
Delete a message
Parameters
| Name | In | Type | Description |
|---|
id | path | string (uuid), required | |
Responses
200 Default Response
| Field | Type | Description |
|---|
deleted | integer | |
404 Default Response
| Field | Type | Description |
|---|
error | object | |
error.code | string | |
error.message | string | |
error.details | object | |
Download the original message (.eml)
Parameters
| Name | In | Type | Description |
|---|
id | path | string (uuid), required | |
Responses
200 Default Response
Download an attachment
Parameters
| Name | In | Type | Description |
|---|
id | path | string (uuid), required | |
index | path | integer, required | min 0, max 1000 |
Responses
200 Default Response