0

Get User

by
Published Oct 17, 2025

View information about a user in a Workspace. \ \ ***Note:** This endpoint is only available to Workspaces on our [Enterprise Plan](https://clickup.com/pricing).*

Script clickup Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Clickup = {
3
  token: string;
4
};
5
/**
6
 * Get User
7
 * View information about a user in a Workspace. \
8
 \
9
***Note:** This endpoint is only available to Workspaces on our [Enterprise Plan](https://clickup.com/pricing).*
10
 */
11
export async function main(
12
  auth: Clickup,
13
  team_id: string,
14
  user_id: string,
15
  include_shared: string | undefined,
16
) {
17
  const url = new URL(
18
    `https://api.clickup.com/api/v2/team/${team_id}/user/${user_id}`,
19
  );
20
  for (const [k, v] of [["include_shared", include_shared]]) {
21
    if (v !== undefined && v !== "" && k !== undefined) {
22
      url.searchParams.append(k, v);
23
    }
24
  }
25
  const response = await fetch(url, {
26
    method: "GET",
27
    headers: {
28
      Authorization: auth.token,
29
    },
30
    body: undefined,
31
  });
32
  if (!response.ok) {
33
    const text = await response.text();
34
    throw new Error(`${response.status} ${text}`);
35
  }
36
  return await response.json();
37
}
38