0

Create Folderless List

by
Published Oct 17, 2025

Add a new List in a Space.

Script clickup Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Clickup = {
3
  token: string;
4
};
5
/**
6
 * Create Folderless List
7
 * Add a new List in a Space.
8
 */
9
export async function main(
10
  auth: Clickup,
11
  space_id: string,
12
  body: {
13
    name: string;
14
    content?: string;
15
    markdown_content?: string;
16
    due_date?: number;
17
    due_date_time?: false | true;
18
    priority?: number;
19
    assignee?: number;
20
    status?: string;
21
  },
22
) {
23
  const url = new URL(`https://api.clickup.com/api/v2/space/${space_id}/list`);
24

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