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

# gtm gmail

> Command reference for gtm gmail — Gmail commands. Generated from the CLI help text.

Gmail commands.

Every command follows the [CLI contract](/concepts/cli-contract): JSON on stdout, errors on stderr, and command-specific mutation safety controls. Keys resolve as described in [Secrets and API keys](/secrets).

## `gtm gmail url`

Gmail URL decoding.

### `gtm gmail url decode`

Decode a Gmail URL or token to a hex API ID, optionally fetching the message.

```bash theme={"system"}
uv run gtm gmail url decode [OPTIONS] URL_OR_TOKEN
```

| Argument       | Type | Required |
| -------------- | ---- | -------- |
| `URL_OR_TOKEN` | text | yes      |

| Option          | Type    | Default           | Description                                                                |
| --------------- | ------- | ----------------- | -------------------------------------------------------------------------- |
| `--read, -r`    | boolean | `false`           | Fetch the message via gws after decoding                                   |
| `--format, -f`  | choice  | `ReadFormat.text` | Output format when --read is set                                           |
| `--html`        | boolean | `false`           | Return HTML body instead of plain text (text format only)                  |
| `--headers, -H` | boolean | `false`           | Include parsed headers (text format only; json/markdown always carry them) |


## Related topics

- [CLI overview](/cli/index.md)
- [Quickstart: install gtm-sdk and run your first command](/quickstart.md)
- [Architecture](/concepts/architecture.md)
- [CLI contract](/concepts/cli-contract.md)
