---
title: Users
editUrl: false
head: []
template: doc
prev: false
next: false
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

Defined in: [src/team/client.gen.ts:443](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/team/client.gen.ts#L443)

## Constructors

### Constructor

> **new Users**(`_core`): `Users`

Defined in: [src/team/client.gen.ts:444](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/team/client.gen.ts#L444)

#### Parameters

##### \_core

[`BrexCore`](/brex/api/index/classes/brexcore/)

#### Returns

`Users`

## Methods

### create()

> **create**(`body`, `options?`): `Promise`\<\{ `department_id?`: `string` \| `null`; `email`: `string`; `first_name`: `string`; `id`: `string`; `last_name`: `string`; `location_id?`: `string` \| `null`; `manager_id?`: `string` \| `null`; `metadata?`: \{\[`key`: `string`\]: `string`; \} \| `null`; `remote_display_id?`: `string` \| `null`; `status?`: `"ACTIVE"` \| `"DISABLED"` \| `"ARCHIVED"` \| `"DELETED"` \| `"INACTIVE"` \| `"INVITED"` \| `"PENDING_ACTIVATION"` \| `"CLOSED"` \| `null`; `title_id?`: `string` \| `null`; \}\>

Defined in: [src/team/client.gen.ts:455](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/team/client.gen.ts#L455)

Invite user

This endpoint invites a new user as an employee.
To update user's role, check out [this article](https://support.brex.com/how-do-i-change-another-user-s-role/).

`POST /v2/users` — requires OAuth scope: `users`
Supports an optional `Idempotency-Key` via `options.idempotencyKey`.

#### Parameters

##### body

###### department_id?

`string` \| `null`

###### email

`string`

Format: email

###### first_name

`string`

###### last_name

`string`

###### location_id?

`string` \| `null`

###### manager_id?

`string` \| `null`

###### metadata?

\{\[`key`: `string`\]: `string`; \} \| `null`

**Description**

The metadata or customized attributes of the user. Maximum number of entries: 100

###### title_id?

`string` \| `null`

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

`Promise`\<\{ `department_id?`: `string` \| `null`; `email`: `string`; `first_name`: `string`; `id`: `string`; `last_name`: `string`; `location_id?`: `string` \| `null`; `manager_id?`: `string` \| `null`; `metadata?`: \{\[`key`: `string`\]: `string`; \} \| `null`; `remote_display_id?`: `string` \| `null`; `status?`: `"ACTIVE"` \| `"DISABLED"` \| `"ARCHIVED"` \| `"DELETED"` \| `"INACTIVE"` \| `"INVITED"` \| `"PENDING_ACTIVATION"` \| `"CLOSED"` \| `null`; `title_id?`: `string` \| `null`; \}\>

***

### get()

> **get**(`id`, `options?`): `Promise`\<\{ `department_id?`: `string` \| `null`; `email`: `string`; `first_name`: `string`; `id`: `string`; `last_name`: `string`; `location_id?`: `string` \| `null`; `manager_id?`: `string` \| `null`; `metadata?`: \{\[`key`: `string`\]: `string`; \} \| `null`; `remote_display_id?`: `string` \| `null`; `status?`: `"ACTIVE"` \| `"DISABLED"` \| `"ARCHIVED"` \| `"DELETED"` \| `"INACTIVE"` \| `"INVITED"` \| `"PENDING_ACTIVATION"` \| `"CLOSED"` \| `null`; `title_id?`: `string` \| `null`; \}\>

Defined in: [src/team/client.gen.ts:471](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/team/client.gen.ts#L471)

Get user

This endpoint gets a user by ID.

`GET /v2/users/{id}` — requires OAuth scope: `users`, `users.readonly`

#### Parameters

##### id

`string`

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

`Promise`\<\{ `department_id?`: `string` \| `null`; `email`: `string`; `first_name`: `string`; `id`: `string`; `last_name`: `string`; `location_id?`: `string` \| `null`; `manager_id?`: `string` \| `null`; `metadata?`: \{\[`key`: `string`\]: `string`; \} \| `null`; `remote_display_id?`: `string` \| `null`; `status?`: `"ACTIVE"` \| `"DISABLED"` \| `"ARCHIVED"` \| `"DELETED"` \| `"INACTIVE"` \| `"INVITED"` \| `"PENDING_ACTIVATION"` \| `"CLOSED"` \| `null`; `title_id?`: `string` \| `null`; \}\>

***

### getLimit()

> **getLimit**(`id`, `options?`): `Promise`\<\{ `monthly_available?`: \{ `amount`: `number`; `currency`: `string` \| `null`; \} \| `null`; `monthly_limit?`: \{ `amount`: `number`; `currency`: `string` \| `null`; \} \| `null`; \}\>

Defined in: [src/team/client.gen.ts:487](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/team/client.gen.ts#L487)

Get limit for the user

This endpoint gets the monthly limit for the user including the monthly available limit.

`GET /v2/users/{id}/limit` — requires OAuth scope: `users`, `users.readonly`

#### Parameters

##### id

`string`

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

`Promise`\<\{ `monthly_available?`: \{ `amount`: `number`; `currency`: `string` \| `null`; \} \| `null`; `monthly_limit?`: \{ `amount`: `number`; `currency`: `string` \| `null`; \} \| `null`; \}\>

***

### getMe()

> **getMe**(`options?`): `Promise`\<\{ `department_id?`: `string` \| `null`; `email`: `string`; `first_name`: `string`; `id`: `string`; `last_name`: `string`; `location_id?`: `string` \| `null`; `manager_id?`: `string` \| `null`; `metadata?`: \{\[`key`: `string`\]: `string`; \} \| `null`; `remote_display_id?`: `string` \| `null`; `status?`: `"ACTIVE"` \| `"DISABLED"` \| `"ARCHIVED"` \| `"DELETED"` \| `"INACTIVE"` \| `"INVITED"` \| `"PENDING_ACTIVATION"` \| `"CLOSED"` \| `null`; `title_id?`: `string` \| `null`; \}\>

Defined in: [src/team/client.gen.ts:505](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/team/client.gen.ts#L505)

Get current user

This endpoint returns the user associated with the OAuth2 access token.

`GET /v2/users/me` — requires OAuth scope: `users`, `users.readonly`

#### Parameters

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

`Promise`\<\{ `department_id?`: `string` \| `null`; `email`: `string`; `first_name`: `string`; `id`: `string`; `last_name`: `string`; `location_id?`: `string` \| `null`; `manager_id?`: `string` \| `null`; `metadata?`: \{\[`key`: `string`\]: `string`; \} \| `null`; `remote_display_id?`: `string` \| `null`; `status?`: `"ACTIVE"` \| `"DISABLED"` \| `"ARCHIVED"` \| `"DELETED"` \| `"INACTIVE"` \| `"INVITED"` \| `"PENDING_ACTIVATION"` \| `"CLOSED"` \| `null`; `title_id?`: `string` \| `null`; \}\>

***

### list()

> **list**(`query?`, `options?`): [`PagePromise`](/brex/api/index/classes/pagepromise/)\<\{ `items`: `object`[]; `next_cursor?`: `string` \| `null`; \}\>

Defined in: [src/team/client.gen.ts:521](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/team/client.gen.ts#L521)

List users

This endpoint lists all users. To find a user id by email, you can filter using the `email` query parameter.

`GET /v2/users` — requires OAuth scope: `users`, `users.readonly`
Await for a single page, or `for await` to iterate items across all pages.

#### Parameters

##### query?

###### cursor?

`string` \| `null`

###### email?

`string` \| `null`

###### expand[]?

`string`[] \| `null`

###### limit?

`number` \| `null`

###### remote_display_id?

`string` \| `null`

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

[`PagePromise`](/brex/api/index/classes/pagepromise/)\<\{ `items`: `object`[]; `next_cursor?`: `string` \| `null`; \}\>

***

### setLimit()

> **setLimit**(`id`, `body`, `options?`): `Promise`\<\{ `monthly_available?`: \{ `amount`: `number`; `currency`: `string` \| `null`; \} \| `null`; `monthly_limit?`: \{ `amount`: `number`; `currency`: `string` \| `null`; \} \| `null`; \}\>

Defined in: [src/team/client.gen.ts:540](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/team/client.gen.ts#L540)

Set limit for the user

This endpoint sets the monthly limit for a user.
The limit amount must be non-negative.
To unset the monthly limit of the user, just set `monthly_limit` to null.

`POST /v2/users/{id}/limit` — requires OAuth scope: `users`
Supports an optional `Idempotency-Key` via `options.idempotencyKey`.

#### Parameters

##### id

`string`

##### body

###### monthly_limit?

\{ `amount`: `number`; `currency`: `string` \| `null`; \} \| `null`

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

`Promise`\<\{ `monthly_available?`: \{ `amount`: `number`; `currency`: `string` \| `null`; \} \| `null`; `monthly_limit?`: \{ `amount`: `number`; `currency`: `string` \| `null`; \} \| `null`; \}\>

***

### update()

> **update**(`id`, `body`, `options?`): `Promise`\<\{ `department_id?`: `string` \| `null`; `email`: `string`; `first_name`: `string`; `id`: `string`; `last_name`: `string`; `location_id?`: `string` \| `null`; `manager_id?`: `string` \| `null`; `metadata?`: \{\[`key`: `string`\]: `string`; \} \| `null`; `remote_display_id?`: `string` \| `null`; `status?`: `"ACTIVE"` \| `"DISABLED"` \| `"ARCHIVED"` \| `"DELETED"` \| `"INACTIVE"` \| `"INVITED"` \| `"PENDING_ACTIVATION"` \| `"CLOSED"` \| `null`; `title_id?`: `string` \| `null`; \}\>

Defined in: [src/team/client.gen.ts:566](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/team/client.gen.ts#L566)

Update user

This endpoint updates a user. Any parameters not provided will be left unchanged.

`PUT /v2/users/{id}` — requires OAuth scope: `users`
Supports an optional `Idempotency-Key` via `options.idempotencyKey`.

#### Parameters

##### id

`string`

##### body

###### department_id?

`string` \| `null`

###### location_id?

`string` \| `null`

###### manager_id?

`string` \| `null`

**Description**

The user id of the manager of this user

###### metadata?

\{\[`key`: `string`\]: `string`; \} \| `null`

**Description**

The metadata or customized attributes of the user. Maximum number of entries: 100

###### status?

`"ACTIVE"` \| `"DISABLED"` \| `null`

###### title_id?

`string` \| `null`

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

`Promise`\<\{ `department_id?`: `string` \| `null`; `email`: `string`; `first_name`: `string`; `id`: `string`; `last_name`: `string`; `location_id?`: `string` \| `null`; `manager_id?`: `string` \| `null`; `metadata?`: \{\[`key`: `string`\]: `string`; \} \| `null`; `remote_display_id?`: `string` \| `null`; `status?`: `"ACTIVE"` \| `"DISABLED"` \| `"ARCHIVED"` \| `"DELETED"` \| `"INACTIVE"` \| `"INVITED"` \| `"PENDING_ACTIVATION"` \| `"CLOSED"` \| `null`; `title_id?`: `string` \| `null`; \}\>