Get one email by refId or Message-ID
GET/v1/imap/:mailerID/messages
Returns one email of a connected mailbox in the same JSON shape as the INCOMING_EMAIL webhook body. Give exactly one of refId or messageId. refId (the ref-id sent in INCOMING_EMAIL webhooks) reads the email Edith stored; if it is no longer stored the call returns 404 and the email can still be fetched by messageId. messageId (the email's Message-ID header, with or without angle brackets) returns the stored copy when Edith has one; otherwise the email is fetched from the mailbox, stored the same way as live inbound, and returned (source mailbox). No webhook is sent. Works for Google (Gmail) and Microsoft (Outlook) OAuth mailboxes and basic username/password IMAP mailboxes.
Request
Path Parameters
Mailer ID
Query Parameters
ref-id from an INCOMING_EMAIL webhook
Message-ID header of the email
Responses
- 200
- 400
- 404
- 409
- 422
- 429
The email
- application/json
- Schema
- Example (from schema)
Schema
The email, in the same JSON shape as the INCOMING_EMAIL webhook body (event, details, success).
Edith's reference for the stored email, the same value as ref-id in INCOMING_EMAIL webhooks.
Possible values: [stored, mailbox]
stored: Edith already had the email. mailbox: fetched from the mailbox just now and stored.
{
"email": {},
"refId": "01M6G4QWRZ1YJACS8TVPNE5AYJ",
"source": "stored",
"success": true
}
Give exactly one of refId or messageId
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "string",
"success": false
}
Mailer not found / email not found / email no longer stored for this refId
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "string",
"success": false
}
Mailer is inactive
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "string",
"success": false
}
Provider not supported / mailbox cannot be read
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "string",
"success": false
}
The mail provider is throttling this mailbox; retry after the Retry-After header
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "string",
"success": false
}