> ## 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.

# Mark as read

> Mark one or many Gmail messages as read.

`markAsRead` removes Gmail's `UNREAD` system label from one or many messages. Use it after an automation has fully handled mail that no longer needs a person's attention.

## Example

Mark each newly received automated receipt as read:

```ts theme={null}
import { automation, filter } from "automate.ax"
import { markAsRead, onNewEmail } from "automate.ax/gmail"

export default automation("Read automated receipts", () => {
  const receipt = filter(onNewEmail(), (message) =>
    message.subject.toLowerCase().includes("receipt"),
  )

  markAsRead({ messageIds: receipt.messageId })
})
```

## Inputs

| Name         | Type                                 | Required | Description                                                                      |
| ------------ | ------------------------------------ | -------- | -------------------------------------------------------------------------------- |
| `messageIds` | `string \| string[]`                 | Yes      | One or up to 1,000 immutable Gmail message IDs.                                  |
| `account`    | `string \| Google account reference` | No       | Google account binding to use. Defaults to the project's default Google account. |

Every input field also accepts a compatible `Signal`; the example passes the filtered message ID signal directly.

## Output

The action returns a `Signal<string[]>` containing the modified message IDs in input order.

Gmail stores read state per message using `UNREAD`. Marking one message as read does not necessarily mark the other messages in its thread as read.
