---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [clients](../index.md) / getUser

# Function: getUser()

> **getUser**(`client`, `userId`, `expand?`): `Promise`\<\{ \}\>

Defined in: [packages/b2c-tooling-sdk/src/clients/am-api.ts:265](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d9cf11cf4a11828e783aed6313f5ea49990488ff/packages/b2c-tooling-sdk/src/clients/am-api.ts#L265)

Retrieves details of a user by ID.

## Parameters

### client

[`AccountManagerUsersClient`](../type-aliases/AccountManagerUsersClient.md)

Account Manager Users client

### userId

`string`

User ID (UUID)

### expand?

(`"roles"` \| `"organizations"`)[]

Optional array of fields to expand (organizations, roles)

## Returns

`Promise`\<\{ \}\>

User details

## Throws

Error if user is not found or request fails
