---
schema_version: "1"
id: 0d2e6ac36003cedc68bb263d51cf71b3d7402e3f4efc78cd9203503f6dccda62
title: Get Current User Record
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/graphql-api/graphql/guides/query/query-current-user-record.md
canonical_url: https://developer.salesforce.com/docs/platform/graphql/guide/query-current-user-record.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 87e6fd19f998a0842a444e0ffd9297e89edbd2e8c0dd90bc1403c57542a94b39
products:
  - GraphQL API
---
# Get Current User Record

| AVAILABLE API VERSION |
| --------------------- |
| API v66.0 and later   |

The `currentUser` type returns the currently logged-in user’s User record data, even if the caller doesn’t know the user ID. The response always represents the current user. You can request any fields that are available on the [User](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_user.htm) record.

To query or aggregate multiple users or use complex filtering, sorting, or pagination, use the `RecordQuery` type for the User object instead. See [Query Objects](https://developer.salesforce.com/docs/platform/graphql/guide/query-record-objects.md).

To get the current user record, use `currentUser` in the `uiapi` field.

```
{
  uiapi {
    currentUser{
      # User fields
    }
  }
}
```

## Current User Schema

Query `currentUser` by using this schema.

```
type UIAPI {
  currentUser: RecordRepresentation
}
```

## Example: Query Current User

This example fetches the ID and name for the current user.

```
{
  uiapi {
    currentUser{
      Id
      Name {
        value
      }
    }
  }
}
```

The response includes the fields that you request. For example, the previous query returns this response.

```
{
  "data": {
    "uiapi": {
      "currentUser": {
        "Id": "005xx000001X7sHAAS",
        "Name": {
          "value": "User‘s Name"
        }
      }
    }
  },
  "errors": [],
  "extensions": {}
}
```
