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

# Get profile

> Get the authenticated Gmail address and mailbox totals.

`getProfile` returns basic information about the connected Gmail mailbox. Use it to identify the selected account or inspect mailbox-wide message and thread totals.

## Example

```ts automations/get-gmail-profile.automation.ts theme={null}
import { automation } from "automate.ax"
import { getProfile } from "automate.ax/gmail"

export default automation("Get Gmail profile", () => {
  getProfile({})
})
```

## Inputs

| Property  | Type                                              | Required | Description                                                                              |
| --------- | ------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------- |
| `account` | `string \| IntegrationAccountReference<"google">` | No       | Google account binding to use. Defaults to the project's default Google account binding. |

The account can also be supplied by a compatible `Signal`.

## Output

Returns a `Signal<GmailProfile>`:

```ts theme={null}
interface GmailProfile {
  emailAddress: string
  historyId?: string
  messagesTotal?: number
  threadsTotal?: number
}
```

| Property        | Description                                                      |
| --------------- | ---------------------------------------------------------------- |
| `emailAddress`  | Primary email address of the authenticated Gmail account.        |
| `historyId`     | Current Gmail mailbox-history record ID, when supplied by Gmail. |
| `messagesTotal` | Total number of messages in the mailbox, when supplied by Gmail. |
| `threadsTotal`  | Total number of threads in the mailbox, when supplied by Gmail.  |

The totals describe the entire mailbox; they are not counts for a search query or label.
