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

# Update label

> Rename a user-owned Gmail label or change its visibility and color.

`updateLabel` updates selected metadata on a user-owned Gmail label. Identify the label by display name or immutable ID, then provide at least one property to change.

## Example

```ts automations/update-follow-up-label.automation.ts theme={null}
import { automation } from "automate.ax"
import { updateLabel } from "automate.ax/gmail"

export default automation("Update a Gmail label", () => {
  updateLabel({
    label: "Automate.ax/Follow up",
    name: "Automate.ax/Needs reply",
    labelListVisibility: "labelShowIfUnread",
  })
})
```

## Inputs

| Property                | Type                                                | Required | Description                                                                              |
| ----------------------- | --------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------- |
| `label`                 | `string`                                            | Yes      | Gmail label display name or immutable label ID.                                          |
| `name`                  | `string`                                            | No       | Replacement label name.                                                                  |
| `labelListVisibility`   | `"labelHide" \| "labelShow" \| "labelShowIfUnread"` | No       | Visibility in Gmail's label list.                                                        |
| `messageListVisibility` | `"hide" \| "show"`                                  | No       | Visibility beside messages in Gmail's message list.                                      |
| `color`                 | `{ backgroundColor: string; textColor: string }`    | No       | Hex colors from Gmail's supported label-color palette.                                   |
| `account`               | `string \| IntegrationAccountReference<"google">`   | No       | Google account binding to use. Defaults to the project's default Google account binding. |

Provide at least one of `name`, `labelListVisibility`, `messageListVisibility`, or `color`. Each input can also be a compatible `Signal` from an earlier trigger or action.

## Output

Returns a `Signal<GmailLabel>` with the updated metadata:

```ts theme={null}
interface GmailLabel {
  labelId: string
  name: string
  type?: "system" | "user"
  labelListVisibility?: "labelHide" | "labelShow" | "labelShowIfUnread"
  messageListVisibility?: "hide" | "show"
  color?: {
    backgroundColor: string
    textColor: string
  }
  messagesTotal?: number
  messagesUnread?: number
  threadsTotal?: number
  threadsUnread?: number
}
```

The action resolves display names case-insensitively. Use `labelId` to avoid ambiguity when names may change.

<Warning>
  Gmail system labels cannot be renamed or restyled. Gmail also rejects color
  combinations outside its supported label-color palette.
</Warning>
