Skip to content

Fields API (1.0.0-beta)

The Fields API allows you to manage fields and field values information. The Fields API is currently in Beta and is available for use. Customers do not need to explicitly opt-in to Beta. However, the API is subject to changes as per the expectations set regarding Beta APIs in the API Launch Stages documentation: https://developer.brex.com/docs/api-launch-stages/.

Download OpenAPI description
Languages
Servers
Production
https://api.brex.com
Staging (Note: This is not a sandbox. It will not work with customer tokens.)
https://api-staging.brex.com

View and manage fields data.

Operations
Operations

Request

List values under the same custom field

Security
OAuth2(Required scopes:
field_values.read
field_values.write
)
Path
field_idstringrequired

The Field Brex identifier

Example: extended_field_foobar
Query
brex_id[]Array of strings or null

Field value Brex identifier(s) to filter by

Example: brex_id[]=efo_foobar
value_id[]Array of strings or null

Field value identifier(s) to filter by

Example: value_id[]=FooBar
remote_id[]Array of strings or null

Field value remote identifier(s) to filter by

Example: remote_id[]=foo_bar
cursorstring or null

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

limitinteger or null(int32)

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

valuestring or null

Field value's value to filter by

Example: value=Foobar
curl -i -X GET \
  https://api.brex.com/v1/fields/extended_field_foobar/values \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

List custom field values response

Bodyapplication/json
next_cursorstring or null
itemsArray of objects(Field value)required
items[].​brex_idstringrequired

The internal Brex ID of the field value

Example: "efo_foobar"
items[].​remote_idstring or null

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

Example: "foo_bar"
items[].​value_idstring or null

The value ID or code of the field value; Usually it is a unique identifier for the custom field value in the remote system

Example: "foo_bar"
items[].​valuestringrequired

The display name of the field value

items[].​field_idstringrequired

The ID of the parent field this value belongs to

Example: "extended_field_foobar"
items[].​updated_atstring(date-time)required

The last updated timestamp of the field value

items[].​is_disabledbooleanrequired

Indicates if the field value is disabled

Response
application/json
{ "next_cursor": "string", "items": [ {} ] }

Request

Update custom field values (up to 1000 values at once) for a specific field

Security
OAuth2(Required scopes:
field_values.write
)
Path
field_idstringrequired

The Field Brex identifier

Example: extended_field_foobar
Bodyapplication/jsonrequired
itemsArray of by `brex_id` (object) or by `value_id` (object) or by `remote_id` (object)(Field value to update)[ 1 .. 1000 ] itemsrequired
One of:

Represents the data needed to update a field value using its brex_id.

items[].​brex_idstringrequired

The internal Brex ID of the field value

Example: "efo_foobar"
items[].​dataobject(Field value update data)required

Represents the updated data of a field value

items[].​data.​valuestring or null

The display name of the field value

items[].​data.​is_disabledboolean or null

Indicates if the field value is disabled

curl -i -X PUT \
  https://api.brex.com/v1/fields/extended_field_foobar/values \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "items": [
      {
        "brex_id": "efo_foobar",
        "data": {
          "value": "string",
          "is_disabled": true
        }
      }
    ]
  }'

Responses

Update custom field value list response

Bodyapplication/json
itemsArray of objects(Field value)required

The list of updated field values

items[].​brex_idstringrequired

The internal Brex ID of the field value

Example: "efo_foobar"
items[].​remote_idstring or null

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

Example: "foo_bar"
items[].​value_idstring or null

The value ID or code of the field value; Usually it is a unique identifier for the custom field value in the remote system

Example: "foo_bar"
items[].​valuestringrequired

The display name of the field value

items[].​field_idstringrequired

The ID of the parent field this value belongs to

Example: "extended_field_foobar"
items[].​updated_atstring(date-time)required

The last updated timestamp of the field value

items[].​is_disabledbooleanrequired

Indicates if the field value is disabled

Response
application/json
{ "items": [ {} ] }

Request

Create custom field values (up to 1000 values at once) for a specific field

Security
OAuth2(Required scopes:
field_values.write
)
Path
field_idstringrequired

The Field Brex identifier

Example: extended_field_foobar
Headers
Idempotency-Keystringrequired

Idempotency key for this request.

Bodyapplication/jsonrequired
itemsArray of objects(Field value creation)non-emptyrequired

The list of field values to be created

items[].​valuestringrequired

The display name of the field value

items[].​value_idstring or null

The value ID or code of the field value; Usually it is a unique identifier for the custom field value in the remote system

Example: "FooBar"
items[].​remote_idstring or null

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

Example: "foo_bar"
items[].​is_disabledboolean or null

Indicates if the field value is disabled

curl -i -X POST \
  https://api.brex.com/v1/fields/extended_field_foobar/values \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: string' \
  -d '{
    "items": [
      {
        "value": "string",
        "value_id": "FooBar",
        "remote_id": "foo_bar",
        "is_disabled": true
      }
    ]
  }'

Responses

Create custom field values response

Bodyapplication/json
itemsArray of objects(Field value)required

The list of created field values

items[].​brex_idstringrequired

The internal Brex ID of the field value

Example: "efo_foobar"
items[].​remote_idstring or null

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

Example: "foo_bar"
items[].​value_idstring or null

The value ID or code of the field value; Usually it is a unique identifier for the custom field value in the remote system

Example: "foo_bar"
items[].​valuestringrequired

The display name of the field value

items[].​field_idstringrequired

The ID of the parent field this value belongs to

Example: "extended_field_foobar"
items[].​updated_atstring(date-time)required

The last updated timestamp of the field value

items[].​is_disabledbooleanrequired

Indicates if the field value is disabled

Response
application/json
{ "items": [ {} ] }

Request

Delete custom field values (up to 1000 values at once) for a specific field

Security
OAuth2(Required scopes:
fields.write
)
Path
field_idstringrequired

The Field Brex identifier

Example: extended_field_foobar
Bodyapplication/jsonrequired
itemsArray of by `brex_id` (object) or by `value_id` (object) or by `remote_id` (object)(Field value to delete)[ 1 .. 1000 ] itemsrequired
One of:

Represents the data needed to delete a field value using its brex_id.

items[].​brex_idstringrequired

The internal Brex ID of the field value

Example: "efo_foobar"
curl -i -X DELETE \
  https://api.brex.com/v1/fields/extended_field_foobar/values \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "items": [
      {
        "brex_id": "efo_foobar"
      }
    ]
  }'

Responses

Delete custom field value list response

Bodyapplication/json
object(Field value deleted response)

Represents the confirmation of number of deleted field values

Response
application/json
{}

Request

Get a field value by field ID and field value ID

Security
OAuth2(Required scopes:
field_values.read
field_values.write
)
Path
field_idstringrequired

The Field Brex identifier

Example: extended_field_foobar
brex_idstringrequired

The field value ID (brex_id) to retrieve.

Example: efo_foobar
curl -i -X GET \
  https://api.brex.com/v1/fields/extended_field_foobar/values/efo_foobar \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Get a field value response

Bodyapplication/json
brex_idstringrequired

The internal Brex ID of the field value

Example: "efo_foobar"
remote_idstring or null

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

Example: "foo_bar"
value_idstring or null

The value ID or code of the field value; Usually it is a unique identifier for the custom field value in the remote system

Example: "foo_bar"
valuestringrequired

The display name of the field value

field_idstringrequired

The ID of the parent field this value belongs to

Example: "extended_field_foobar"
updated_atstring(date-time)required

The last updated timestamp of the field value

is_disabledbooleanrequired

Indicates if the field value is disabled

Response
application/json
{ "brex_id": "efo_foobar", "remote_id": "foo_bar", "value_id": "foo_bar", "value": "string", "field_id": "extended_field_foobar", "updated_at": "2019-08-24T14:15:22Z", "is_disabled": true }