# sz auth status

The `sz auth status` command is part of the [Scheduler Zero CLI](/cli). Checks the effective key from an explicit option, environment or saved configuration against the API. This is a live authentication check, not just a local-file check. Without an available key it reports loggedIn: false; an invalid or revoked available key produces an API error.

## Usage

```bash
sz auth status [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 auth status
sz auth status --json
```

## Output and side effects

A JSON object with loggedIn and, when authenticated, identity including a representative workspace. No key secret is printed. A no-key result is a successful command with loggedIn: false; scripts that require authentication must inspect that field as well as the exit code.

## Authorization

An available key is validated with its existing restrictions; checking status cannot issue or widen a key.

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

[Credential precedence](/cli/reference) · [Login](/cli/commands/auth-login) · [Logout](/cli/commands/auth-logout)

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

