0

Update privacy and access of an object or location

by
Published Oct 17, 2025

Update the privacy and access settings of an object or location in the Workspace. Note that sharing an item may incur charges.

Script clickup Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Clickup = {
3
  token: string;
4
};
5
/**
6
 * Update privacy and access of an object or location
7
 * Update the privacy and access settings of an object or location in the Workspace. Note that sharing an item may incur charges.
8
 */
9
export async function main(
10
  auth: Clickup,
11
  workspace_id: string,
12
  object_type: string,
13
  object_id: string,
14
  body: {
15
    entries?: { id?: string; kind?: string; permission_level?: number }[];
16
    private?: false | true;
17
  },
18
) {
19
  const url = new URL(
20
    `https://api.clickup.com/api/v3/workspaces/${workspace_id}/${object_type}/${object_id}/acls`,
21
  );
22

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