Users
Defined in: src/team/client.gen.ts:443
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Users(
_core):Users
Defined in: src/team/client.gen.ts:444
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Users
Methods
Section titled “Methods”create()
Section titled “create()”create(
body,options?):Promise<{department_id?:string|null;string;first_name:string;id:string;last_name:string;location_id?:string|null;manager_id?:string|null;metadata?: {[key:string]:string; } |null;remote_display_id?:string|null;status?:"ACTIVE"|"DISABLED"|"ARCHIVED"|"DELETED"|"INACTIVE"|"INVITED"|"PENDING_ACTIVATION"|"CLOSED"|null;title_id?:string|null; }>
Defined in: src/team/client.gen.ts:455
Invite user
This endpoint invites a new user as an employee. To update user’s role, check out this article.
POST /v2/users — requires OAuth scope: users
Supports an optional Idempotency-Key via options.idempotencyKey.
Parameters
Section titled “Parameters”department_id?
Section titled “department_id?”string | null
string
Format: email
first_name
Section titled “first_name”string
last_name
Section titled “last_name”string
location_id?
Section titled “location_id?”string | null
manager_id?
Section titled “manager_id?”string | null
metadata?
Section titled “metadata?”{[key: string]: string; } | null
Description
The metadata or customized attributes of the user. Maximum number of entries: 100
title_id?
Section titled “title_id?”string | null
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ department_id?: string | null; email: string; first_name: string; id: string; last_name: string; location_id?: string | null; manager_id?: string | null; metadata?: {[key: string]: string; } | null; remote_display_id?: string | null; status?: "ACTIVE" | "DISABLED" | "ARCHIVED" | "DELETED" | "INACTIVE" | "INVITED" | "PENDING_ACTIVATION" | "CLOSED" | null; title_id?: string | null; }>
get(
id,options?):Promise<{department_id?:string|null;string;first_name:string;id:string;last_name:string;location_id?:string|null;manager_id?:string|null;metadata?: {[key:string]:string; } |null;remote_display_id?:string|null;status?:"ACTIVE"|"DISABLED"|"ARCHIVED"|"DELETED"|"INACTIVE"|"INVITED"|"PENDING_ACTIVATION"|"CLOSED"|null;title_id?:string|null; }>
Defined in: src/team/client.gen.ts:471
Get user
This endpoint gets a user by ID.
GET /v2/users/{id} — requires OAuth scope: users, users.readonly
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ department_id?: string | null; email: string; first_name: string; id: string; last_name: string; location_id?: string | null; manager_id?: string | null; metadata?: {[key: string]: string; } | null; remote_display_id?: string | null; status?: "ACTIVE" | "DISABLED" | "ARCHIVED" | "DELETED" | "INACTIVE" | "INVITED" | "PENDING_ACTIVATION" | "CLOSED" | null; title_id?: string | null; }>
getLimit()
Section titled “getLimit()”getLimit(
id,options?):Promise<{monthly_available?: {amount:number;currency:string|null; } |null;monthly_limit?: {amount:number;currency:string|null; } |null; }>
Defined in: src/team/client.gen.ts:487
Get limit for the user
This endpoint gets the monthly limit for the user including the monthly available limit.
GET /v2/users/{id}/limit — requires OAuth scope: users, users.readonly
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ monthly_available?: { amount: number; currency: string | null; } | null; monthly_limit?: { amount: number; currency: string | null; } | null; }>
getMe()
Section titled “getMe()”getMe(
options?):Promise<{department_id?:string|null;string;first_name:string;id:string;last_name:string;location_id?:string|null;manager_id?:string|null;metadata?: {[key:string]:string; } |null;remote_display_id?:string|null;status?:"ACTIVE"|"DISABLED"|"ARCHIVED"|"DELETED"|"INACTIVE"|"INVITED"|"PENDING_ACTIVATION"|"CLOSED"|null;title_id?:string|null; }>
Defined in: src/team/client.gen.ts:505
Get current user
This endpoint returns the user associated with the OAuth2 access token.
GET /v2/users/me — requires OAuth scope: users, users.readonly
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ department_id?: string | null; email: string; first_name: string; id: string; last_name: string; location_id?: string | null; manager_id?: string | null; metadata?: {[key: string]: string; } | null; remote_display_id?: string | null; status?: "ACTIVE" | "DISABLED" | "ARCHIVED" | "DELETED" | "INACTIVE" | "INVITED" | "PENDING_ACTIVATION" | "CLOSED" | null; title_id?: string | null; }>
list()
Section titled “list()”list(
query?,options?):PagePromise<{items:object[];next_cursor?:string|null; }>
Defined in: src/team/client.gen.ts:521
List users
This endpoint lists all users. To find a user id by email, you can filter using the email query parameter.
GET /v2/users — requires OAuth scope: users, users.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
email?
Section titled “email?”string | null
expand[]?
Section titled “expand[]?”string[] | null
limit?
Section titled “limit?”number | null
remote_display_id?
Section titled “remote_display_id?”string | null
options?
Section titled “options?”Returns
Section titled “Returns”PagePromise<{ items: object[]; next_cursor?: string | null; }>
setLimit()
Section titled “setLimit()”setLimit(
id,body,options?):Promise<{monthly_available?: {amount:number;currency:string|null; } |null;monthly_limit?: {amount:number;currency:string|null; } |null; }>
Defined in: src/team/client.gen.ts:540
Set limit for the user
This endpoint sets the monthly limit for a user.
The limit amount must be non-negative.
To unset the monthly limit of the user, just set monthly_limit to null.
POST /v2/users/{id}/limit — requires OAuth scope: users
Supports an optional Idempotency-Key via options.idempotencyKey.
Parameters
Section titled “Parameters”string
monthly_limit?
Section titled “monthly_limit?”{ amount: number; currency: string | null; } | null
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ monthly_available?: { amount: number; currency: string | null; } | null; monthly_limit?: { amount: number; currency: string | null; } | null; }>
update()
Section titled “update()”update(
id,body,options?):Promise<{department_id?:string|null;string;first_name:string;id:string;last_name:string;location_id?:string|null;manager_id?:string|null;metadata?: {[key:string]:string; } |null;remote_display_id?:string|null;status?:"ACTIVE"|"DISABLED"|"ARCHIVED"|"DELETED"|"INACTIVE"|"INVITED"|"PENDING_ACTIVATION"|"CLOSED"|null;title_id?:string|null; }>
Defined in: src/team/client.gen.ts:566
Update user
This endpoint updates a user. Any parameters not provided will be left unchanged.
PUT /v2/users/{id} — requires OAuth scope: users
Supports an optional Idempotency-Key via options.idempotencyKey.
Parameters
Section titled “Parameters”string
department_id?
Section titled “department_id?”string | null
location_id?
Section titled “location_id?”string | null
manager_id?
Section titled “manager_id?”string | null
Description
The user id of the manager of this user
metadata?
Section titled “metadata?”{[key: string]: string; } | null
Description
The metadata or customized attributes of the user. Maximum number of entries: 100
status?
Section titled “status?”"ACTIVE" | "DISABLED" | null
title_id?
Section titled “title_id?”string | null
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ department_id?: string | null; email: string; first_name: string; id: string; last_name: string; location_id?: string | null; manager_id?: string | null; metadata?: {[key: string]: string; } | null; remote_display_id?: string | null; status?: "ACTIVE" | "DISABLED" | "ARCHIVED" | "DELETED" | "INACTIVE" | "INVITED" | "PENDING_ACTIVATION" | "CLOSED" | null; title_id?: string | null; }>