0

Invite Guest To Workspace

by
Published Oct 17, 2025

Invite a guest to join a Workspace. To invite a member to your Workspace, use the [Invite User to Workspace](ref:inviteusertoworkspace) endpoint. \ \ You'll also need to grant the guest access to specific items using the following endpoints: [Add Guest to Folder](ref:addguesttofolder), [Add Guest to List](ref:addguesttolist), or [Add Guest to Task](ref:addguesttotask). \ \ ***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
 * Invite Guest To Workspace
7
 * Invite a guest to join a Workspace. To invite a member to your Workspace, use the [Invite User to Workspace](ref:inviteusertoworkspace) endpoint. \
8
 \
9
You'll also need to grant the guest access to specific items using the following endpoints: [Add Guest to Folder](ref:addguesttofolder), [Add Guest to List](ref:addguesttolist), or [Add Guest to Task](ref:addguesttotask). \
10
 \
11
***Note:** This endpoint is only available to Workspaces on our [Enterprise Plan](https://clickup.com/pricing).*
12
 */
13
export async function main(
14
  auth: Clickup,
15
  team_id: string,
16
  body: {
17
    email: string;
18
    can_edit_tags?: false | true;
19
    can_see_time_spent?: false | true;
20
    can_see_time_estimated?: false | true;
21
    can_create_views?: false | true;
22
    can_see_points_estimated?: false | true;
23
    custom_role_id?: number;
24
  },
25
) {
26
  const url = new URL(`https://api.clickup.com/api/v2/team/${team_id}/guest`);
27

28
  const response = await fetch(url, {
29
    method: "POST",
30
    headers: {
31
      "Content-Type": "application/json",
32
      Authorization: auth.token,
33
    },
34
    body: JSON.stringify(body),
35
  });
36
  if (!response.ok) {
37
    const text = await response.text();
38
    throw new Error(`${response.status} ${text}`);
39
  }
40
  return await response.json();
41
}
42