# 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](/docs/platform/graphql/guide/query-record-objects.md).

To get the current user record, use `currentUser` in the `uiapi` field.

```sfdocs-code {"lang":"graphql", "title": "Query currentUser", "src": "" }
{
  uiapi {
    currentUser{
      # User fields
    }
  }
}
```

## Current User Schema

Query `currentUser` by using this schema.

```sfdocs-code {"lang":"graphql", "title": "Query currentUser Schema", "src": "" }
type UIAPI {
  currentUser: RecordRepresentation
}
```

## Example: Query Current User

This example fetches the ID and name for the current user.

```sfdocs-code {"lang":"graphql", "title": "Query Current User ID and Name", "src": "" }
{
  uiapi {
    currentUser{
      Id
      Name {
        value
      }
    }
  }
}
```

The response includes the fields that you request. For example, the previous query returns this response.

```sfdocs-code {"lang":"json", "title": "Response for Current User Query", "src": "" }
{
  "data": {
    "uiapi": {
      "currentUser": {
        "Id": "005xx000001X7sHAAS",
        "Name": {
          "value": "User‘s Name"
        }
      }
    }
  },
  "errors": [],
  "extensions": {}
}
```
