0

Add Guest To List

by
Published Oct 17, 2025

Share a List with a guest. \ \ ***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
 * Add Guest To List
7
 * Share a List with a guest. \
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
  list_id: string,
14
  guest_id: string,
15
  include_shared: string | undefined,
16
  body: { permission_level: string },
17
) {
18
  const url = new URL(
19
    `https://api.clickup.com/api/v2/list/${list_id}/guest/${guest_id}`,
20
  );
21
  for (const [k, v] of [["include_shared", include_shared]]) {
22
    if (v !== undefined && v !== "" && k !== undefined) {
23
      url.searchParams.append(k, v);
24
    }
25
  }
26
  const response = await fetch(url, {
27
    method: "POST",
28
    headers: {
29
      "Content-Type": "application/json",
30
      Authorization: auth.token,
31
    },
32
    body: JSON.stringify(body),
33
  });
34
  if (!response.ok) {
35
    const text = await response.text();
36
    throw new Error(`${response.status} ${text}`);
37
  }
38
  return await response.json();
39
}
40