# Get the caller

> GET /v1/me. Returns the user, organization and permissions behind the credential, and access: whether the person may use Legion during the beta, and the verified…

Source: https://legion.ambient.xyz/docs/api/identity/get-me

`GET https://api.legion.ambient.xyz/v1/me`

Authenticate with an API key: `Authorization: Bearer $LEGION_API_KEY`.

Returns the user, organization and permissions behind the credential,
and `access`: whether the person may use Legion during the
beta, and the verified email that decides it. A member is always
`approved`.

A signed-in person who belongs to no organization yet gets 403 with
`access` in the problem: `no_organization` when they are approved
(`getOnboarding` works for them), or `access_not_approved` with
`access.state` `waitlisted` (on the waitlist, not approved yet) or
`not_requested` (not on the waitlist; `joinMyWaitlist` puts them on
it). This operation is one of the few an unapproved person may call:
see `access_not_approved` on the `Forbidden` response.

`legal` holds the current legal documents and whether the
caller accepted them, in the 200 and in the problem of `no_organization`. This operation works before the legal documents are accepted; until
they are, `getOnboarding` and the rest answer 403 `terms_not_accepted`.

`permissions` are the member's role's, not the credential's. When the caller used an API key or an
OAuth access token, `credential` says what that credential may call: read
`credential.scope` (`full` or `agent`) and `credential.provider_tools` to learn your reach before you
try an operation. An `agent` key is refused every operation outside the MCP tools (403
`api_key_scope`) however many `permissions` its role has, and an OAuth grant (`kind` `oauth_grant`,
always `agent`) likewise (403 `oauth_token_mcp_only`); without `provider_tools` neither has the
provider tools. A signed-in person gets no `credential`.

When Legion has suspended the caller's organization, `org.suspended_at` and
`org.suspension_reason` say so, and this is one of the few operations that still works: the rest
answer 403 `org_suspended`. The reason is shown as Legion wrote it.

A person can belong to several organizations. `org`, `role` and `permissions` are the
organization the request acts in: an API key's or OAuth grant's own organization, or for a
signed-in person the session's active organization (see `setActiveOrg`). `orgs` lists every
organization the person belongs to, sorted by name, so a client can offer a switch.

## Responses

### 200

The caller.

- `user`, User, required
  - `id`, string (uuid), required
  - `email`, string (email), required
  - `name`, string, required
- `org`, MeOrg, required: The caller's organization (an `Org`, plus its suspension when it has one).
  - `id`, string (uuid), required
  - `name`, string, required
  - `test_org`, boolean, required: A test organization: it sees and rents only test organizations' hosts and only test organizations rent its hosts, it is never paid out, and its money is not counted as revenue. A Legion Legion decides it.
  - `suspended_at`, string (date-time): When Legion suspended the organization. Absent when it is not suspended.
  - `suspension_reason`, string: Why, as Legion wrote it for the organization's members to read. Absent when the organization is not suspended.
- `role`, OrgRole, required: `owner` and `member` apply within a customer or provider organization.
- `permissions`, array of Permission, required
  
- `orgs`, array of MeMembership, required: Every organization the person belongs to, sorted by name, at most 20. `org` is the one this request acts in.
  - `id`, string (uuid), required
  - `name`, string, required
  - `role`, OrgRole, required: `owner` and `member` apply within a customer or provider organization.
  - `test_org`, boolean, required: A test organization.
  - `suspended`, boolean, required: Legion suspended the organization.
- `access`, MeAccess: Whether a signed-in person may use Legion during the closed beta, decided on their verified email (case-insensitive): `approved` (a member of an organization, holding a pending invitation, or Legion), `waitlisted` (on the waitlist, not approved yet) or `not_requested` (not on the waitlist). Carried by `Me` (always `approved` for a member) and by the problem of a 403 `access_not_approved`, and of `getMe`'s 403 `no_organization`.
  - `state`, string, required
  - `email`, string (email), required: The verified email the state was decided on.
- `legal`, MeLegal: The caller's consent to Legion's legal documents. `required` lists every document the consent step shows and `acceptLegalDocuments` takes, at its current version. `accepted` is true when the caller accepted the current version of every `agree` document; while it is false, every operation except `getMe`, `acceptLegalDocuments`, `joinMyWaitlist` and the wind-down operations (listing, stopping and deleting rentals; listing hosts, stopping new rentals on them and removing them) answers 403 `terms_not_accepted`.
  - `required`, array of LegalDocument, required
    - `key`, LegalDocumentKey, required: A legal document: `terms` (Terms of Use), `acceptable_use` (Acceptable Use Policy), `privacy` (Privacy Policy), `data_handling` (Data Handling).
    - `version`, string, required: The current version. A new version of an `agree` document must be accepted again.
    - `effective`, string (date), required: The date the current version took effect.
    - `title`, string, required
    - `url`, string (uri), required: The document's public page.
    - `acceptance`, string, required: `agree`: the person agrees to it, and the API is refused until the current version is accepted. `acknowledge`: the person confirms having read it, in the same step.
  - `accepted`, boolean, required
- `credential`, MeCredential: What this credential may call, present in `Me` for a customer API key or an OAuth grant (absent for a signed-in person). `Me.permissions` are the role's; this is the credential's reach on top of them: `scope` `full` is every operation the role allows, `scope` `agent` is only the MCP tools (`/v1/mcp`), with the provider tools only when `provider_tools` is true. Anything else answers 403 `api_key_scope` (an API key) or `oauth_token_mcp_only` (an OAuth access token). It never holds a token or its hash.
  - `kind`, string, required: The kind of credential the request used. `api_key`: an API key (`api_key_id` and `prefix` are set). `oauth_grant`: an app the person connected with OAuth (`grant_id` and `client_name` are set; `scope` is always `agent`). A list that may grow.
  - `api_key_id`, string (uuid): The key's id, as `ApiKey.id`. Set when `kind` is `api_key`.
  - `prefix`, string: The first characters of the token, as `ApiKey.prefix`. Set when `kind` is `api_key`.
  - `grant_id`, string (uuid): The grant's id. Set when `kind` is `oauth_grant`.
  - `client_name`, string: The connected app's name. Set when `kind` is `oauth_grant`.
  - `scope`, ApiKeyScope, required: What an API key may do. `full`: every operation its creator's role allows (keys made before scopes existed are `full`, as is a key created without one). `agent`: only the operations marked `x-legion-mcp` without `audience: provider` (the renter tools) and the MCP endpoint (`mcpMessage`), plus the provider tools when the key has `provider_tools`. Every other operation answers 403 `api_key_scope`.
  - `provider_tools`, boolean, required: As `ApiKey.provider_tools`; for a grant, true when its scope is `mcp:hosts`. Always false for a `full` key.

Example:

```json
{
  "user": {
    "id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "email": "you@example.com",
    "name": "string"
  },
  "org": {
    "id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "name": "string",
    "test_org": false,
    "suspended_at": "2026-10-15T12:00:00Z",
    "suspension_reason": "string"
  },
  "role": "owner",
  "permissions": [
    "api_keys.manage"
  ],
  "orgs": [
    {
      "id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
      "name": "string",
      "role": "owner",
      "test_org": false,
      "suspended": false
    }
  ],
  "access": {
    "state": "approved",
    "email": "you@example.com"
  },
  "legal": {
    "required": [
      {
        "key": "terms",
        "version": "1.0",
        "effective": "2026-10-15",
        "title": "Terms of Use",
        "url": "https://legion.ambient.xyz/terms",
        "acceptance": "agree"
      }
    ],
    "accepted": false
  },
  "credential": {
    "kind": "api_key",
    "api_key_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "prefix": "lgn_3Fq9",
    "grant_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
    "client_name": "string",
    "scope": "full",
    "provider_tools": false
  }
}
```

### 401

Missing, unknown, expired or revoked credentials.

### 403

The caller lacks the permission this operation requires (`forbidden`),
or signed in without having joined an organization yet
(`no_organization`; `getOnboarding` and the invitation and
organization operations under it work), or could not sign in
(`email_unverified`, `account_conflict`, and `domain_not_allowed`). `not_invited` is no longer returned to
session tokens.

`access_not_approved`: a signed-in person who is not approved
for the beta yet. Every operation that takes a credential answers it to
them, except `getMe` and `joinMyWaitlist`; the problem carries
`access` (`waitlisted` or `not_requested`, and the email). Approved
means a member of an organization, holding a pending invitation, or Legion; an API key always belongs to a member.

`oauth_token_mcp_only`: the caller sent an OAuth access token (`lgo_`), which is accepted
only by `mcpMessage` and the tool calls it dispatches. Every other operation answers it, whatever
the token's scope. Use an API key or the Legion web app.

`org_suspended`: the caller's organization is suspended. Every operation that takes a
credential answers it, by session or API key, except `getMe` (which shows `org.suspended_at` and
`org.suspension_reason`) and the support operations under `/v1/support/`.

`terms_not_accepted`: an approved caller who has not accepted
the current version of the Terms of Use and the Acceptable Use Policy. Every operation that takes a credential answers it, except `getMe`,
`acceptLegalDocuments`, `joinMyWaitlist` and the wind-down operations
(`listRentals`, `stopRental`, `deleteRental`, `listHosts`,
`updateListing` with `listed` false, `removeHost`); the problem
carries `legal`. An API key acts for the person who created it, so it
is refused until that person accepts. Terminal
operations also return
`session_required` (called with an API key) and `step_up_required`
(neither a sign-in nor a step-up challenge within the step-up window).

### 500

An unexpected server error. Safe to retry.

## Errors

- 403 [`no_organization`](https://legion.ambient.xyz/docs/errors#no_organization)

## Example request

```sh
curl -s "https://api.legion.ambient.xyz/v1/me" \
  -H "Authorization: Bearer $LEGION_API_KEY"
```
