Messages

List messages

List messages in a folder. Use POST /search for filtering. Sort fields: uid, date, size (prefix with - for descending). Default -uid.

get/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages

Request

  • Base URL: https://api.mail.hostinger.com
  • URL: https://api.mail.hostinger.com/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages
  • Auth: HTTP bearer

Path parameters

mailboxResourceIdstring required

Resource ID of the managed mailbox the bearer token is authorized for.

folderstring required

Folder path (URL-encoded).

Query parameters

pageinteger

Page number (1-based).

perPageinteger

Items per page (max 100).

sortstring

Sort field with optional - prefix for descending. Allowed: uid, date, size.

Response

Paginated list of messages.

Example response

{
  "data": [
    {
      "uid": 123,
      "path": "INBOX",
      "date": "2024-01-15T10:30:00.000Z",
      "flags": [
        "\\Seen",
        "\\Flagged"
      ],
      "size": 2048,
      "subject": "Test Email Subject",
      "from": {
        "name": "John Doe",
        "address": "john@example.com"
      },
      "to": [
        {
          "name": "John Doe",
          "address": "john@example.com"
        }
      ],
      "cc": [
        {
          "name": "John Doe",
          "address": "john@example.com"
        }
      ],
      "bcc": [
        {
          "name": "John Doe",
          "address": "john@example.com"
        }
      ],
      "messageId": "<1234567890@example.com>",
      "inReplyTo": "<0987654321@example.com>",
      "attachments": [
        {
          "id": "YXR0YWNobWVudDpJTkJPWDoxMjM6MS4y",
          "contentType": "application/pdf",
          "sizeBytes": 1024,
          "filename": "document.pdf",
          "contentId": "<attachment@example.com>"
        }
      ]
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 25,
    "total": 137,
    "totalPages": 6
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.