For the complete documentation index, see llms.txt. This page is also available as Markdown.

List messages

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

List messages

get

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

Authorizations
AuthorizationstringRequired

Bearer authentication using API tokens in the Authorization header.

Path parameters
mailboxResourceIdstringRequired

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

Example: AC1a2b3c4d5e6f7g
folderstringRequired

Folder path (URL-encoded).

Example: INBOX
Query parameters
pageinteger · min: 1Optional

Page number (1-based).

Default: 1
perPageinteger · min: 1 · max: 100Optional

Items per page (max 100).

Default: 25
sortstringOptional

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

Default: -uid
Responses
200

Paginated list of messages.

application/json

Paginated list of messages.

get/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages
GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages HTTP/1.1
Host: api.mail.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "data": [
    {
      "uid": 123,
      "path": "INBOX",
      "date": "2024-01-15T10:30:00.000Z",
      "flags": [
        "\\Seen",
        "\\Flagged"
      ],
      "unseen": false,
      "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,
          "inline": false,
          "filename": "document.pdf",
          "contentId": "<attachment@example.com>"
        }
      ]
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 25,
    "total": 137,
    "totalPages": 6
  }
}

Last updated

Was this helpful?