Messages•REST API v1
Read Latest Mails
Fetches the latest incoming emails from your mailbox. Returns a clean, structured payload containing sender, recipients, subject, date, snippet, rendered HTML, plaintext body, and attachments list. Excludes internal folder paths, IMAP flags, and raw headers.
POSThttps://mailvenue.com/api/v1/mails
Request Headers
Content-Typeapplication/json
Request Parameters (JSON Body)
2 required| Field | Type | Status | Default | Description |
|---|---|---|---|---|
| string | Required | - | Mailbox account address (e.g. [email protected]) | |
| password | string | Required | - | Mailbox account password |
| mails | number | Optional | 1 | Number of latest emails to retrieve (1 = latest single email, max 50) |
Response Attributes
| Key | Type | Description |
|---|---|---|
| success | boolean | true if fetch succeeded |
| count | number | Total emails returned in payload |
| mails | array | Array of email objects ordered newest first |
| mails[].id | number | Unique message identifier (UID) |
| mails[].from | object | Sender display name and email address |
| mails[].to | array | List of recipient objects |
| mails[].subject | string | Subject line of the email |
| mails[].date | string | ISO 8601 message timestamp |
| mails[].snippet | string | Sanitized plain preview snippet |
| mails[].html | string | Sanitized HTML message body |
| mails[].text | string | Plain text message body |
| mails[].read | boolean | Whether the message has been opened |
| mails[].attachments | array | Attached files metadata |
Status Codes
200
OK: Emails fetched successfully.
400
Bad Request: Missing email/password or invalid email format.
401
Unauthorized: Incorrect email or password.
500
Server Error: IMAP server connection failure or timeout.
