Skip to content

Departments

Defined in: src/team/client.gen.ts:224

new Departments(_core): Departments

Defined in: src/team/client.gen.ts:225

BrexCore

Departments

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

Defined in: src/team/client.gen.ts:235

Create department

This endpoint creates a new department

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

string | null

Description

Description of the department

string

Description

Name of the department

RequestOptions

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


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

Defined in: src/team/client.gen.ts:255

Get department

This endpoint gets a department by ID.

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

string

RequestOptions

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


list(query?, options?): PagePromise<{ items: object[]; next_cursor?: string | null; }>

Defined in: src/team/client.gen.ts:274

List departments

This endpoint lists all departments.

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

string | null

number | null

string | null

RequestOptions

PagePromise<{ items: object[]; next_cursor?: string | null; }>