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

# Profiles

> Switch between API keys, pixels, and environments using named profiles.

Profiles let you keep multiple `(API key, pixel id)` configurations side-by-side — e.g. one for production and one for staging, or one per client.

## Create a profile

```bash theme={null}
upstack init --profile staging
upstack init --profile client-b
```

## Use a profile

Pass `--profile <name>` on any command. Without `--profile`, the `default` profile is used.

```bash theme={null}
upstack --profile staging query --measures revenue \
  --date-start 2026-04-01 --date-end 2026-04-30

upstack whoami --profile staging
```

## List profiles

```bash theme={null}
upstack profiles
```

Prints all configured profile names.

## Remove a profile

```bash theme={null}
upstack logout --profile staging
```

Removes credentials for the named profile from `~/.upstackrc`. If it was the last profile, the file is deleted.

## Storage

All profiles live in `~/.upstackrc` (mode `0600`) under a `profiles` map:

```json theme={null}
{
  "profiles": {
    "default": { "baseUrl": "...", "apiKey": "upstack_...", "pixelId": "..." },
    "staging": { "baseUrl": "...", "apiKey": "upstack_...", "pixelId": "..." }
  }
}
```
