> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# List messages

> List full Outlook messages from a mailbox or folder.

`listMessages` returns complete normalized messages, including body and preview.

## Example

```ts automations/list-recent-outlook-mail.automation.ts theme={null}
import { automation } from "automate.ax"
import { listMessages } from "automate.ax/outlook"

export default automation("List recent Outlook mail", () => {
  listMessages({ folder: "inbox", orderBy: "receivedDateTime desc", limit: 25 })
})
```

## Inputs

Optional `folder` is a display path, folder ID, or well-known name. Optional
`filter` and `orderBy` are OData expressions. `limit` defaults to 100 and permits
1–10,000 across Graph pages. `account` selects the Microsoft binding.

## Output

Returns `OutlookMessage[]`. A message contains `messageId`, `subject`, optional
`body: { content; contentType: "text" | "html" }`, preview, recipients, sender,
timestamps, IDs, read/draft/attachment state, categories, importance, flag,
Focused Inbox classification, folder, web link, and ETag. Recipient arrays and
categories default to `[]`; subject defaults to an empty string.

This action does not download attachments. Use `listAttachments` or
`getAttachment` with the message ID.
