0

Create Project

by
Published Jun 6, 2022

Creates a project. [See the docs here](https://developer.todoist.com/rest/v2/#create-a-new-project)

Script todoist Verified

The script

Submitted by hugo697 Bun
Verified 398 days ago
1
import { TodoistApi } from '@doist/todoist-api-typescript'
2
import { v9 as Todoist } from 'todoist'
3

4
type Todoist = {
5
	Token: string
6
}
7

8
export async function main(
9
	resource: Todoist,
10
	project: {
11
		name: string
12
		parentId?: string
13
		color?: string
14
		isFavorite?: boolean
15
		viewStyle?: 'list' | 'board'
16
	}
17
) {
18
	const api = new TodoistApi(resource.Token)
19
	const projectResponse = await api.addProject(project)
20
	return projectResponse
21
}
22