# Who the CLI token acts for

Source: https://immiscible.fly.dev/docs/api/get-v1-cli-whoami

`GET /v1/cli/whoami`

The person, the workspace (with its books currency), the token's scopes and expiry, and whether this person may add agents.

## Authentication

CLI token. A token (`imc_...`) the developer CLI gets by signing in through the browser (`immiscible login`, the OAuth device grant), sent as `Authorization: Bearer`. It acts for one person in one workspace: it reads agents and status, and registers an agent with a rule from the same purposes as the console's "Add an agent". It never approves anything or changes an existing rule. Every use re-checks the person's membership and the workspace's sign-in rules; it lasts 90 days and ends from the console's sessions.

## Request

curl:

```bash
curl "https://immiscible.fly.dev/v1/cli/whoami" \
  -H "authorization: Bearer $IMMISCIBLE_TOKEN"
```

Node:

```ts
const res = await fetch('https://immiscible.fly.dev/v1/cli/whoami', {
  headers: {
    authorization: `Bearer ${process.env.IMMISCIBLE_TOKEN}`,
  },
});
const data = await res.json();
console.log(res.status, data);
```

Python:

```python
import os
import requests

res = requests.get(
    "https://immiscible.fly.dev/v1/cli/whoami",
    headers={
        "authorization": f"Bearer {os.environ['IMMISCIBLE_TOKEN']}",
    },
)
print(res.status_code, res.json())
```

## Response

```json
{
  "user": {
    "id": "usr_d253e4892f3a4c5d",
    "email": "jules@amethyst.example",
    "name": "Jules Moreau"
  },
  "workspace": {
    "id": "ws_12832a06f3134d5f",
    "name": "Amethyst",
    "role": "owner",
    "currency": "GBP"
  },
  "token": {
    "id": "clt_b11e4ffb3aeb0179",
    "name": "docs",
    "scopes": [
      "agents:read"
    ],
    "createdAt": "2026-10-06T12:47:41.518Z",
    "expiresAt": "2027-01-04T12:47:41.518Z"
  },
  "can": {
    "addAgents": true
  },
  "server": {
    "url": "https://immiscible.fly.dev",
    "version": "1.0.0",
    "time": "2026-10-06T12:47:47.522Z"
  }
}
```
