> ## 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 user and organization associated with the current API key.

`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 ID, or null when unavailable.
</ResponseField>

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

<ResponseField name="scopes" type="list[str]">
  Scopes granted to the current key.
</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 API keys and other `ApiError` subclasses for non-2xx responses.
