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

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

## Constructors

### Constructor

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

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

#### Parameters

##### \_core

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

#### Returns

`Locations`

## Methods

### create()

> **create**(`body`, `options?`): `Promise`\<\{ `description?`: `string` \| `null`; `id`: `string`; `name`: `string`; \}\>

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

Create location

This endpoint creates a new location.

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

#### Parameters

##### body

###### description?

`string` \| `null`

**Description**

Description of the location

###### name

`string`

**Description**

Name of the location

##### options?

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

#### Returns

`Promise`\<\{ `description?`: `string` \| `null`; `id`: `string`; `name`: `string`; \}\>

***

### get()

> **get**(`id`, `options?`): `Promise`\<\{ `description?`: `string` \| `null`; `id`: `string`; `name`: `string`; \}\>

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

Get location

This endpoint gets a location by ID.

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

#### Parameters

##### id

`string`

##### options?

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

#### Returns

`Promise`\<\{ `description?`: `string` \| `null`; `id`: `string`; `name`: `string`; \}\>

***

### list()

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

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

List locations

This endpoint lists all locations.

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

#### Parameters

##### query?

###### cursor?

`string` \| `null`

###### limit?

`number` \| `null`

###### name?

`string` \| `null`

##### options?

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

#### Returns

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