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

# Unstar

> Remove Gmail's star from one or many messages.

`unstar` removes Gmail's `STARRED` system label from one or many messages. Use it after an automation has completed the work represented by a standard Gmail star.

## Example

Remove the star from messages after applying a `Completed` label:

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

export default automation("Complete starred Gmail work", () => {
  const email = onNewEmail()
  const completedMessageIds = addLabel({
    label: "Completed",
    messageIds: email.messageId,
  })

  unstar({ messageIds: completedMessageIds })
})
```

The `Completed` label must already exist in the selected Gmail account.

## 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 chains the output of `addLabel` into `unstar`.

## Output

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

This removes the standard `STARRED` label from individual messages. It does not change unrelated labels or other messages in the same thread.
