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

# Me

> Inspect the current principal — user, token, scopes, and active workspace.

export const ExpectedOutput = ({caption = "Expected output", children}) => <div className="gv-output">
    <div className="gv-output__label">
      <svg className="gv-output__icon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
        <polyline points="15 10 20 15 15 20" />
        <path d="M4 4v7a4 4 0 0 0 4 4h12" />
      </svg>
      <span>{caption}</span>
    </div>
    <div className="gv-output__body">{children}</div>
  </div>;

export const APIBadge = ({method = "GET", path, scope}) => {
  const m = method.toUpperCase();
  return <span className="gv-api-badge">
      <span className={`gv-api-badge__method gv-api-badge__method--${m.toLowerCase()}`}>
        {m}
      </span>
      <code className="gv-api-badge__path">{path}</code>
      {scope && <span className="gv-api-badge__scope">
          <span className="gv-api-badge__scope-label">scope</span>
          <code>{scope}</code>
        </span>}
    </span>;
};

export const Eyebrow = ({label, tone = "default"}) => <div className={`gv-eyebrow gv-eyebrow--${tone}`}>
    <span className="gv-eyebrow__bar" aria-hidden="true" />
    <span className="gv-eyebrow__label">{label}</span>
  </div>;

<Eyebrow label="RESOURCE" />

The Me resource returns information about whoever — or whatever — is making the request. It reflects the authenticated principal: the user account behind the token, the token itself and its granted scopes, and the workspace the call resolves against. Use it to verify credentials, debug scope problems, or bootstrap a CLI session. By the end of this page you will know what the endpoint returns and how that differs between API keys and OAuth sessions.

## A first call

<APIBadge method="GET" path="/v1/me" scope="me:read" />

```bash theme={null}
curl https://api.gavai.app/v1/me \
  -H "Authorization: Bearer gak_live_xxxxxxxxxxxxx"
```

<ExpectedOutput>
  ```json theme={null}
  {
    "user":      { "id": "usr_01H...", "email": "you@example.com" },
    "token":     { "id": "tok_01H...", "scopes": ["me:read", "workspaces:read"], "mode": "live" },
    "workspace": { "slug": "acme" }
  }
  ```
</ExpectedOutput>

Three blocks: `user` identifies the human (when there is one), `token` describes the credential that authenticated this request, and `workspace` is the tenant the call resolves to.

## Endpoint

<APIBadge method="GET" path="/v1/me" scope="me:read" />

Returns the current principal: user, token id and scopes, active workspace.

## Behavior notes

| Principal                                      | What `workspace` resolves to                                                                                                                                         |
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Workspace API key (`gak_live_*`, `gak_test_*`) | The workspace the key was minted against. Always the same workspace for the life of the key.                                                                         |
| OAuth session token (`gst_*`)                  | The workspace active when the session was established or last switched. Use [`POST /v1/workspaces/{slug}/switch`](/api-reference/resources/workspaces) to change it. |

The `token.scopes` list is exhaustive — every scope the token holds is included.

## Related

<Card title="Workspaces" icon="building" href="/api-reference/resources/workspaces">
  Enumerate accessible workspaces and switch the active context for OAuth sessions.
</Card>
