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

Defined in: [src/fields/client.gen.ts:8](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/fields/client.gen.ts#L8)

## Constructors

### Constructor

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

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

#### Parameters

##### \_core

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

#### Returns

`Fields`

## Methods

### create()

> **create**(`body`, `options?`): `Promise`\<\{ `brex_id`: `string`; `group?`: `"TRAVEL"` \| `"ACCOUNTING"` \| `"USER"` \| `"ERP"` \| `null`; `is_disabled`: `boolean`; `name`: `string` \| `null`; `remote_id?`: `string` \| `null`; `updated_at`: `string`; \}\>

Defined in: [src/fields/client.gen.ts:19](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/fields/client.gen.ts#L19)

Create a custom field

Create a custom field

`POST /v1/fields` — requires OAuth scope: `fields.write`
Sends an `Idempotency-Key` header: `options.idempotencyKey`, or an auto-generated UUID.

#### Parameters

##### body

###### group

`"TRAVEL"` \| `"ACCOUNTING"` \| `"USER"` \| `"ERP"`

###### integration_id?

`string` \| `null`

**Description**

The ID of the Accounting Integration to associate this field with. This property is **required** when `group` is `ERP`: it must reference an existing Accounting Integration, and requests that omit it or send `null` for an `ERP` field are rejected. For all other groups (`ACCOUNTING`, `USER`, `TRAVEL`) `integration_id` is not applicable and should be left null.

**Example**

```ts
int_123
```

###### is_disabled?

`boolean` \| `null`

**Description**

Indicates whether the field is disabled. A disabled field is not selectable: it is no longer offered as an option in the Brex dropdown and cannot be applied to new transactions. Records that already reference the field are unaffected.

###### name

`string`

**Description**

The name of the field

###### remote_id?

`string` \| `null`

**Description**

Remote/external ID of custom field from external system (e.g. ERP or HRIS system)

**Example**

```ts
foo_bar
```

##### options?

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

#### Returns

`Promise`\<\{ `brex_id`: `string`; `group?`: `"TRAVEL"` \| `"ACCOUNTING"` \| `"USER"` \| `"ERP"` \| `null`; `is_disabled`: `boolean`; `name`: `string` \| `null`; `remote_id?`: `string` \| `null`; `updated_at`: `string`; \}\>

***

### delete()

> **delete**(`id`, `options?`): `Promise`\<`void`\>

Defined in: [src/fields/client.gen.ts:37](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/fields/client.gen.ts#L37)

Delete a custom field

Delete a custom field by Brex ID

`DELETE /v1/fields/{id}` — requires OAuth scope: `fields.write`

#### Parameters

##### id

`string`

##### options?

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

#### Returns

`Promise`\<`void`\>

***

### get()

> **get**(`id`, `options?`): `Promise`\<\{ `brex_id`: `string`; `group?`: `"TRAVEL"` \| `"ACCOUNTING"` \| `"USER"` \| `"ERP"` \| `null`; `is_disabled`: `boolean`; `name`: `string` \| `null`; `remote_id?`: `string` \| `null`; `updated_at`: `string`; \}\>

Defined in: [src/fields/client.gen.ts:53](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/fields/client.gen.ts#L53)

Get custom field

Get a custom field by Brex ID

`GET /v1/fields/{id}` — requires OAuth scope: `fields.read`, `fields.write`

#### Parameters

##### id

`string`

##### options?

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

#### Returns

`Promise`\<\{ `brex_id`: `string`; `group?`: `"TRAVEL"` \| `"ACCOUNTING"` \| `"USER"` \| `"ERP"` \| `null`; `is_disabled`: `boolean`; `name`: `string` \| `null`; `remote_id?`: `string` \| `null`; `updated_at`: `string`; \}\>

***

### list()

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

Defined in: [src/fields/client.gen.ts:70](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/fields/client.gen.ts#L70)

List custom fields

List custom fields under the same account

`GET /v1/fields` — requires OAuth scope: `fields.read`, `fields.write`
Await for a single page, or `for await` to iterate items across all pages.

#### Parameters

##### query?

###### cursor?

`string` \| `null`

**Description**

The cursor to use for pagination. This is the `next_cursor` value returned from the previous response.

###### field_id[]?

`string`[] \| `null`

**Description**

The Brex identifiers of the field to filter by

**Example**

```ts
extended_field_foobar
```

###### limit?

`number` \| `null`

**Description**

Controls the maximum number of field values returned in the response. It can't be greater than 1000.

##### options?

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

#### Returns

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

***

### update()

> **update**(`id`, `body`, `options?`): `Promise`\<\{ `brex_id`: `string`; `group?`: `"TRAVEL"` \| `"ACCOUNTING"` \| `"USER"` \| `"ERP"` \| `null`; `is_disabled`: `boolean`; `name`: `string` \| `null`; `remote_id?`: `string` \| `null`; `updated_at`: `string`; \}\>

Defined in: [src/fields/client.gen.ts:86](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/fields/client.gen.ts#L86)

Update a custom field

Update a field by ID

`PUT /v1/fields/{id}` — requires OAuth scope: `fields.write`

#### Parameters

##### id

`string`

##### body

###### is_disabled?

`boolean` \| `null`

**Description**

Indicates whether the field is disabled. A disabled field is not selectable: it is no longer offered as an option in the Brex dropdown and cannot be applied to new transactions. Records that already reference the field are unaffected.

###### name?

`string` \| `null`

**Description**

The name of the field

##### options?

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

#### Returns

`Promise`\<\{ `brex_id`: `string`; `group?`: `"TRAVEL"` \| `"ACCOUNTING"` \| `"USER"` \| `"ERP"` \| `null`; `is_disabled`: `boolean`; `name`: `string` \| `null`; `remote_id?`: `string` \| `null`; `updated_at`: `string`; \}\>