Departments
Defined in: src/team/client.gen.ts:224
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Departments(
_core):Departments
Defined in: src/team/client.gen.ts:225
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Departments
Methods
Section titled “Methods”create()
Section titled “create()”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.
Parameters
Section titled “Parameters”description?
Section titled “description?”string | null
Description
Description of the department
string
Description
Name of the department
options?
Section titled “options?”Returns
Section titled “Returns”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
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ description?: string | null; id: string; name: string; }>
list()
Section titled “list()”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.
Parameters
Section titled “Parameters”query?
Section titled “query?”cursor?
Section titled “cursor?”string | null
limit?
Section titled “limit?”number | null
string | null
options?
Section titled “options?”Returns
Section titled “Returns”PagePromise<{ items: object[]; next_cursor?: string | null; }>