---
title: "Gets information about the owner of an access token."
method: GET
path: "/_matrix/client/v3/account/whoami"
tags: ["Session management"]
---

# Gets information about the owner of an access token.

`GET /_matrix/client/v3/account/whoami`

## Request

- Base URL: `https://matrix.org`
- URL: `https://matrix.org/_matrix/client/v3/account/whoami`
- Auth: one of:
  - API key in query parameter `access_token`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/matrix/apis/matrix-client-server-api/docs/_matrix/client/v3/account/whoami/get.ts> (a function with typed inputs; its response is checked against the schema)

Gets information about the owner of a given access token.

Note that, as with the rest of the Client-Server API,
Application Services may masquerade as users within their
namespace by giving a `user_id` query parameter. In this
situation, the server should verify that the given `user_id`
is registered by the appservice, and return it in the response
body.

## Response `200`

The token belongs to a known user.

- object
  - `device_id` string: Device ID associated with the access token. If no device is associated with the access token (such as in the case of application services) then this field can be omitted. Otherwise this is required.
  - `is_guest` boolean: When `true`, the user is a [Guest User](https://spec.matrix.org/v1.19/client-server-api/#guest-access). When not present or `false`, the user is presumed to be a non-guest user.
  - `user_id` string, mx-user-id, required: The user ID that owns the access token.

## Other responses

- `401`: The token is not recognised
- `403`: The appservice cannot masquerade as the user or has not registered them.
- `429`: This request was rate-limited.

---

[API](https://skmtc.dev/matrix/apis/matrix-client-server-api.md) - [All operations](https://skmtc.dev/matrix/apis/matrix-client-server-api/llms.txt) - [OpenAPI document](https://skmtc.dev/matrix/apis/matrix-client-server-api/revisions/c7fe4072c681?raw)
