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

# whoami()

> Return the caller's authenticated organization, key metadata, and scopes.

`mesa.whoami()` calls the API once, caches the result, and also populates the client's default organization.

**Required scope: `read`**

```python theme={null}
identity = await mesa.whoami()
print(identity.org.slug)
print(identity.key_id)
```

## Options

This method does not take options.

## Response

<ResponseField name="org" type="OrgIdentity">
  Organization associated with the authenticated key.
</ResponseField>

<ResponseField name="key_id" type="str | None">
  Current API key or key ID, or null when unavailable.
</ResponseField>

<ResponseField name="key_name" type="str | None">
  Current API key name. Private-key clients return null.
</ResponseField>

<ResponseField name="scopes" type="list[str]">
  Effective scopes granted to the credential.
</ResponseField>

### OrgIdentity

<ResponseField name="id" type="str">
  Organization ID.
</ResponseField>

<ResponseField name="slug" type="str">
  Organization slug.
</ResponseField>

<ResponseField name="name" type="str">
  Organization display name.
</ResponseField>

## Errors

Raises `AuthenticationError` for invalid credentials and other `ApiError` subclasses for non-2xx responses.
