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 /v1/projects/{projectId}

Get a project and its domains

Parameters

NameInTypeDescription
projectIdpathstring (uuid), required

Responses

200 Default Response

FieldTypeDescription
idstring (uuid)
namestring
retentionDaysinteger
domainsarray of object
domains[].namestring
domains[].kind"system" | "custom"
domains[].status"pending" | "active"Mail is accepted for active domains only

404 Default Response

FieldTypeDescription
errorobject
error.codestring
error.messagestring
error.detailsobject

GET /v1/projects/{projectId}/messages

List messages, newest first

Parameters

NameInTypeDescription
toquerystringRecipient address, exact match
fromquerystringSender address (From header or envelope)
subjectquerystringPart of the subject, any case
received_afterquerystring (date-time)Only messages received after this moment
limitqueryintegermin 1, max 100, default 50
cursorquerystring
projectIdpathstring (uuid), required

Responses

200 Default Response

FieldTypeDescription
dataarray of object
data[].idstring (uuid)
data[].projectIdstring (uuid)
data[].source"mx" | "trap"
data[].tostringEnvelope recipient this copy of the message was accepted for
data[].fromobject or nullFrom header
data[].from.addressstring
data[].from.namestring
data[].subjectstring
data[].receivedAtstring (date-time)
data[].expiresAtstring (date-time)
data[].sizeinteger
data[].attachmentCountinteger
nextCursorstring or null

404 Default Response

FieldTypeDescription
errorobject
error.codestring
error.messagestring
error.detailsobject

DELETE /v1/projects/{projectId}/messages

Delete all messages of a project, or those of one recipient

Parameters

NameInTypeDescription
toquerystringOnly messages of this recipient
projectIdpathstring (uuid), required

Responses

200 Default Response

FieldTypeDescription
deletedinteger

404 Default Response

FieldTypeDescription
errorobject
error.codestring
error.messagestring
error.detailsobject

GET /v1/projects/{projectId}/messages/wait

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

NameInTypeDescription
toquerystringRecipient address, exact match
fromquerystringSender address (From header or envelope)
subjectquerystringPart of the subject, any case
received_afterquerystring (date-time)Only messages received after this moment
timeoutqueryintegerSeconds to wait for a matching message. min 0, max 60, default 30
projectIdpathstring (uuid), required

Responses

200 Default Response

FieldTypeDescription
idstring (uuid)
projectIdstring (uuid)
source"mx" | "trap"
tostringEnvelope recipient this copy of the message was accepted for
fromobject or nullFrom header
from.addressstring
from.namestring
subjectstring
receivedAtstring (date-time)
expiresAtstring (date-time)
sizeinteger
envelopeobject
envelope.fromstring
envelope.tostring
recipientsobjectTo and Cc headers
recipients.toarray of object
recipients.to[].addressstring
recipients.to[].namestring
recipients.ccarray of object
recipients.cc[].addressstring
recipients.cc[].namestring
datestring (date-time) or nullDate header
textstring or null
htmlstring or null
headersarray of object
headers[].namestring
headers[].valuestring
attachmentsarray of object
attachments[].indexinteger
attachments[].filenamestring or null
attachments[].contentTypestring
attachments[].sizeinteger
attachments[].contentIdstring or null
attachments[].inlineboolean
linksarray of object
links[].urlstring
links[].textstring
codesarray of stringDigit runs of 4 to 8 characters found in the text
authobject
auth.spfobject or null
auth.spf.resultstring
auth.spf.domainstring or null
auth.dkimarray of object
auth.dkim[].resultstring
auth.dkim[].domainstring or null
auth.dkim[].selectorstring or null
auth.dmarcobject or null
auth.dmarc.resultstring
auth.dmarc.domainstring or null
auth.dmarc.policystring or null

404 Default Response

FieldTypeDescription
errorobject
error.codestring
error.messagestring
error.detailsobject

408 Default Response

FieldTypeDescription
errorobject
error.codestring
error.messagestring
error.detailsobject

429 Default Response

FieldTypeDescription
errorobject
error.codestring
error.messagestring
error.detailsobject

GET /v1/messages/{id}

Get a message

Parameters

NameInTypeDescription
idpathstring (uuid), required

Responses

200 Default Response

FieldTypeDescription
idstring (uuid)
projectIdstring (uuid)
source"mx" | "trap"
tostringEnvelope recipient this copy of the message was accepted for
fromobject or nullFrom header
from.addressstring
from.namestring
subjectstring
receivedAtstring (date-time)
expiresAtstring (date-time)
sizeinteger
envelopeobject
envelope.fromstring
envelope.tostring
recipientsobjectTo and Cc headers
recipients.toarray of object
recipients.to[].addressstring
recipients.to[].namestring
recipients.ccarray of object
recipients.cc[].addressstring
recipients.cc[].namestring
datestring (date-time) or nullDate header
textstring or null
htmlstring or null
headersarray of object
headers[].namestring
headers[].valuestring
attachmentsarray of object
attachments[].indexinteger
attachments[].filenamestring or null
attachments[].contentTypestring
attachments[].sizeinteger
attachments[].contentIdstring or null
attachments[].inlineboolean
linksarray of object
links[].urlstring
links[].textstring
codesarray of stringDigit runs of 4 to 8 characters found in the text
authobject
auth.spfobject or null
auth.spf.resultstring
auth.spf.domainstring or null
auth.dkimarray of object
auth.dkim[].resultstring
auth.dkim[].domainstring or null
auth.dkim[].selectorstring or null
auth.dmarcobject or null
auth.dmarc.resultstring
auth.dmarc.domainstring or null
auth.dmarc.policystring or null

404 Default Response

FieldTypeDescription
errorobject
error.codestring
error.messagestring
error.detailsobject

DELETE /v1/messages/{id}

Delete a message

Parameters

NameInTypeDescription
idpathstring (uuid), required

Responses

200 Default Response

FieldTypeDescription
deletedinteger

404 Default Response

FieldTypeDescription
errorobject
error.codestring
error.messagestring
error.detailsobject

GET /v1/messages/{id}/raw

Download the original message (.eml)

Parameters

NameInTypeDescription
idpathstring (uuid), required

Responses

200 Default Response

GET /v1/messages/{id}/attachments/{index}

Download an attachment

Parameters

NameInTypeDescription
idpathstring (uuid), required
indexpathinteger, requiredmin 0, max 1000

Responses

200 Default Response