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

# Delete label

> Permanently delete a user-owned Gmail label by name or ID.

`deleteLabel` permanently deletes a user-owned Gmail label. The messages and threads that carried the label remain in the mailbox; only the label is removed.

Use an immutable label ID when possible. Display names are resolved case-insensitively against the connected mailbox.

## Example

```ts automations/delete-old-label.automation.ts theme={null}
import { automation } from "automate.ax"
import { deleteLabel } from "automate.ax/gmail"

export default automation("Delete an obsolete Gmail label", () => {
  deleteLabel({
    label: "Automate.ax/Old",
  })
})
```

## Inputs

| Property  | Type                                              | Required | Description                                                                              |
| --------- | ------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------- |
| `label`   | `string`                                          | Yes      | Gmail label display name or immutable label ID.                                          |
| `account` | `string \| IntegrationAccountReference<"google">` | No       | Google account binding to use. Defaults to the project's default Google account binding. |

Each input can also be a compatible `Signal` from an earlier trigger or action.

## Output

Returns a `Signal<string>` containing the immutable ID of the deleted label.

<Warning>
  Deletion cannot be undone. Gmail system labels such as `INBOX`, `SPAM`, and
  `TRASH` cannot be deleted.
</Warning>

The action fails before deletion when no label in the connected mailbox matches the supplied name or ID.
