# Account & Team

> Access account details, team members, and user profile in the Lev API.

Source: https://www.lev.com/docs/build/account

Last updated: June 2026

---
## Multi-Account Access

A single Lev user can belong to more than one account — for example, a broker who works across two brokerages, or a user who sits on both a sponsor account and a lender account. Every Lev API response is scoped to a single **active account**, so callers that need data across accounts must tell Lev which account a given request targets.

**How scoping works**

Every request on a multi-account user must carry the `X-Active-Account` header with the target account's `slug`. The backend resolves the slug against the user's active memberships and returns that account's data. Requests from single-account users, or from API keys (which are bound to a specific account at issuance and don't read this header), may omit it — the account is implied.

```
X-Active-Account: broker-magicians
```

**`GET /me` is the one exception.** It's the discovery endpoint — calling it without `X-Active-Account` is how clients bootstrap, and it returns the [unscoped response](#current-user) with `available_accounts[]`. Every other endpoint enforces the rule.

If a multi-account user sends a non-`/me` request without `X-Active-Account` (and the caller is not an API key), the backend returns `400 Bad Request`:

```json
{
  "error": "Active account required. Provide X-Active-Account header or use an API key."
}
```

**Discovering available accounts**

Call `GET /api/external/v2/me` **without** the `X-Active-Account` header. The unscoped response returns the authenticated user plus an `available_accounts` array — every account the user has an active membership on — so clients can present a picker or pass a slug programmatically. The [Current User](#current-user) section below documents both response branches.

**Switching accounts**

There are two ways to switch the account a request is scoped to:

- **Per-request (JWT users)** — change the `X-Active-Account` header value on the next request. This is the lightweight path for clients that already hold the target slug.
- **Persisted (MCP, and anyone who wants sticky scoping)** — call [`PATCH /me/active-account`](#set-active-account) with `{ "slug": "<target>" }`. The backend stores the preference on the user's record and auto-resolves subsequent requests against it until you switch again. The MCP server's `switch_account` tool is a wrapper around this endpoint.

## Current User

### `GET /api/external/v2/me`

Get the authenticated user's profile, account, and platform details

#### Error Responses

- **401** (unauthorized): Authentication required

## Available Accounts

### `GET /api/external/v2/me/accounts`

List every account the authenticated user has an active membership on

Response: `200`

#### Error Responses

- **401** (unauthorized): Authentication required

## Set Active Account

### `PATCH /api/external/v2/me/active-account`

Persist the authenticated user's active-account preference on the server

#### Request Body

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `slug` | `string` | Yes | Account slug returned by GET /me (unscoped) or GET /me/accounts. Must match an account the authenticated user has an active membership on. |

Response: `200`

#### Error Responses

- **400** (bad_request): slug is required
- **401** (unauthorized): Authentication required
- **404** (not_found): Account not found or user is not a member

## Account Team

### `GET /api/external/v2/account/team`

List team members in your account

Response: `200`

#### Error Responses

- **401** (unauthorized): Authentication required