# sz whoami

The `sz whoami` command is part of the [Scheduler Zero CLI](/cli). Validates the effective credential by requesting its identity. Reports one representative workspace the credential can see, rather than the full organization/workspace directory. It does not change a selected workspace or local configuration. Since CLI 0.2.1, the API's legacy workspace field named organization is displayed as workspace.

## Usage

```bash
sz whoami [options]
```

If you have not installed `sz` globally, replace `sz` in the usage above with `npx --yes @scheduler-zero/sz@latest` or `bunx @scheduler-zero/sz@latest`, preserving the arguments and options. See [installation](/cli/installation).

## Options

| Option | Meaning |
| --- | --- |
| `--api-key <key>` | API key (prefer SCHEDULER_ZERO_API_KEY) |
| `--base-url <url>` | API origin (default: https://api.schedulerzero.com) |
| `--json` | Emit machine-readable JSON |
| `--format table\|json` | Select output format |
| `-h, --help` | Show this help |

## Examples

The UUIDs below are illustrative; use IDs from your own visible workspaces and campaigns.

```bash
sz whoami
sz whoami --json
bunx @scheduler-zero/sz@latest whoami --json
```

## Output and side effects

An identity object with authMethod, credential, agent, mcpGrant and workspace. For a personal key, authMethod is api_key and credential contains its ID and permission metadata. This metadata is not a list of implemented CLI subcommands or proof of every workspace-specific permission. A credential with no visible workspace can fail identity introspection.

## Authorization

Requires a valid credential; representative-workspace selection respects live visibility and key restrictions.

## Underlying operations

- `me.whoami`

Browser issuance stays a human-approved handoff where applicable; the command does not bypass that boundary. The exact product operation schemas are in [OpenAPI](/openapi.json) and [the REST Markdown reference](/rest-api/reference.md). For broader capabilities, use [MCP tools](/mcp/tools).

## Related documentation

[List every visible workspace](/cli/commands/workspaces-list) · [Authentication](/cli/authentication) · [JSON output](/cli/reference)

[All CLI commands](/cli/commands) · [Troubleshooting](/cli/troubleshooting) · [This command as Markdown](/cli/commands/whoami.md) · [CLI LLM index](/cli/llms.txt)

