List Messages

Retrieves the collection of Message resources for a given mailbox.

smtppy.listmessages(accountId, mailboxId, page)

Parameters

  • accountId (string) (required) - The account identifier.

  • mailboxId (string) (required) - The mailbox identifier.

  • page (int) (required) - The collection page number

Response

{
  "member": [
    {
      "id": "string",
      "msgid": "string",
      "from": {
        "name": "string",
        "address": "string"
      },
      "to": [
        {
          "name": "string",
          "address": "string"
        }
      ],
      "subject": "string",
      "intro": "string",
      "isRead": true,
      "isFlagged": true,
      "hasAttachments": true,
      "size": 0,
      "downloadUrl": "string",
      "createdAt": "2025-04-01T00:00:00.000Z",
      "updatedAt": "2025-04-01T00:00:00.000Z"
    }
  ],
  "totalItems": 0,
  "view": {
    "id": "string",
    "type": "string",
    "first": "string",
    "last": "string",
    "previous": "string",
    "next": "string"
  },
  "search": {
    "type": "string",
    "template": "string",
    "variableRepresentation": "string",
    "mapping": [
      {
        "type": "string",
        "variable": "string",
        "property": "string",
        "required": true
      }
    ]
  }
}

Want to learn about writing content from scratch? Head to the Basics section to learn more.

Last updated