TodoistApi
A client for interacting with the Todoist API v1. This class provides methods to manage tasks, projects, sections, labels, and comments in Todoist.
Example
const api = new TodoistApi('your-api-token');
// Get all tasks
const tasks = await api.getTasks();
// Create a new task
const newTask = await api.addTask({
content: 'My new task',
projectId: '12345'
});
For more information about the Todoist API v1, see the official documentation. If you're migrating from v9, please refer to the migration guide.
Constructors
Constructor
new TodoistApi(authToken: string, baseUrl?: string): TodoistApi;
Parameters
Parameter | Type | Description |
---|---|---|
authToken | string | Your Todoist API token. |
baseUrl? | string | Optional custom API base URL. If not provided, defaults to Todoist's standard API endpoint |
Returns
TodoistApi
Methods
addComment()
addComment(args: AddCommentArgs, requestId?: string): Promise<{
content: string;
fileAttachment: | null
| {
fileDuration?: null | number;
fileName?: null | string;
fileSize?: null | number;
fileType?: null | string;
fileUrl?: null | string;
image?: null | string;
imageHeight?: null | number;
imageWidth?: null | number;
resourceType: string;
title?: null | string;
uploadState?: null | "pending" | "completed";
url?: null | string;
};
id: string;
isDeleted: boolean;
postedAt: string;
postedUid: string;
projectId?: string;
reactions: null | Record<string, string[]>;
taskId: undefined | string;
uidsToNotify: null | string[];
}>;
Adds a comment to a task or project.
Parameters
Parameter | Type | Description |
---|---|---|
args | AddCommentArgs | Parameters for creating the comment, such as content and the target task or project ID. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<{
content
: string
;
fileAttachment
: | null
| {
fileDuration?
: null
| number
;
fileName?
: null
| string
;
fileSize?
: null
| number
;
fileType?
: null
| string
;
fileUrl?
: null
| string
;
image?
: null
| string
;
imageHeight?
: null
| number
;
imageWidth?
: null
| number
;
resourceType
: string
;
title?
: null
| string
;
uploadState?
: null
| "pending"
| "completed"
;
url?
: null
| string
;
};
id
: string
;
isDeleted
: boolean
;
postedAt
: string
;
postedUid
: string
;
projectId?
: string
;
reactions
: null
| Record
<string
, string
[]>;
taskId
: undefined
| string
;
uidsToNotify
: null
| string
[];
}>
A promise that resolves to the created comment.
addLabel()
addLabel(args: AddLabelArgs, requestId?: string): Promise<{
color: string;
id: string;
isFavorite: boolean;
name: string;
order: null | number;
}>;
Adds a new label.
Parameters
Parameter | Type | Description |
---|---|---|
args | AddLabelArgs | Label creation parameters such as name. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<{
color
: string
;
id
: string
;
isFavorite
: boolean
;
name
: string
;
order
: null
| number
;
}>
A promise that resolves to the created label.
addProject()
addProject(args: AddProjectArgs, requestId?: string): Promise<
| {
canAssignTasks: boolean;
childOrder: number;
color: string;
createdAt: null | string;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: null | string;
updatedAt: null | string;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: null | string;
defaultOrder: number;
description: string;
folderId: null | string;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: null | boolean;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: null | string;
status: string;
updatedAt: null | string;
url: string;
viewStyle: string;
workspaceId: string;
}>;
Creates a new project with the provided parameters.
Parameters
Parameter | Type | Description |
---|---|---|
args | AddProjectArgs | Project creation parameters such as name or color. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<
| {
canAssignTasks
: boolean
;
childOrder
: number
;
color
: string
;
createdAt
: null
| string
;
defaultOrder
: number
;
description
: string
;
id
: string
;
inboxProject
: boolean
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
isFavorite
: boolean
;
isFrozen
: boolean
;
isShared
: boolean
;
name
: string
;
parentId
: null
| string
;
updatedAt
: null
| string
;
url
: string
;
viewStyle
: string
;
}
| {
canAssignTasks
: boolean
;
childOrder
: number
;
collaboratorRoleDefault
: string
;
color
: string
;
createdAt
: null
| string
;
defaultOrder
: number
;
description
: string
;
folderId
: null
| string
;
id
: string
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
isFavorite
: boolean
;
isFrozen
: boolean
;
isInviteOnly
: null
| boolean
;
isLinkSharingEnabled
: boolean
;
isShared
: boolean
;
name
: string
;
role
: null
| string
;
status
: string
;
updatedAt
: null
| string
;
url
: string
;
viewStyle
: string
;
workspaceId
: string
;
}>
A promise that resolves to the created project.
addSection()
addSection(args: AddSectionArgs, requestId?: string): Promise<{
addedAt: string;
archivedAt: null | string;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
name: string;
projectId: string;
sectionOrder: number;
updatedAt: string;
url: string;
userId: string;
}>;
Creates a new section within a project.
Parameters
Parameter | Type | Description |
---|---|---|
args | AddSectionArgs | Section creation parameters such as name or project ID. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<{
addedAt
: string
;
archivedAt
: null
| string
;
id
: string
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
name
: string
;
projectId
: string
;
sectionOrder
: number
;
updatedAt
: string
;
url
: string
;
userId
: string
;
}>
A promise that resolves to the created section.
addTask()
addTask(args: AddTaskArgs, requestId?: string): Promise<{
addedAt: null | string;
addedByUid: null | string;
assignedByUid: null | string;
checked: boolean;
childOrder: number;
completedAt: null | string;
content: string;
dayOrder: number;
deadline: | null
| {
date: string;
lang: string;
};
description: string;
due: | null
| {
date: string;
datetime?: null | string;
isRecurring: boolean;
lang?: null | string;
string: string;
timezone?: null | string;
};
duration: | null
| {
amount: number;
unit: "minute" | "day";
};
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: null | string;
priority: number;
projectId: string;
responsibleUid: null | string;
sectionId: null | string;
updatedAt: null | string;
url: string;
userId: string;
}>;
Creates a new task with the provided parameters.
Parameters
Parameter | Type | Description |
---|---|---|
args | AddTaskArgs | Task creation parameters such as content, due date, or priority. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<{
addedAt
: null
| string
;
addedByUid
: null
| string
;
assignedByUid
: null
| string
;
checked
: boolean
;
childOrder
: number
;
completedAt
: null
| string
;
content
: string
;
dayOrder
: number
;
deadline
: | null
| {
date
: string
;
lang
: string
;
};
description
: string
;
due
: | null
| {
date
: string
;
datetime?
: null
| string
;
isRecurring
: boolean
;
lang?
: null
| string
;
string
: string
;
timezone?
: null
| string
;
};
duration
: | null
| {
amount
: number
;
unit
: "minute"
| "day"
;
};
id
: string
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
labels
: string
[];
noteCount
: number
;
parentId
: null
| string
;
priority
: number
;
projectId
: string
;
responsibleUid
: null
| string
;
sectionId
: null
| string
;
updatedAt
: null
| string
;
url
: string
;
userId
: string
;
}>
A promise that resolves to the created task.
archiveProject()
archiveProject(id: string, requestId?: string): Promise<
| {
canAssignTasks: boolean;
childOrder: number;
color: string;
createdAt: null | string;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: null | string;
updatedAt: null | string;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: null | string;
defaultOrder: number;
description: string;
folderId: null | string;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: null | boolean;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: null | string;
status: string;
updatedAt: null | string;
url: string;
viewStyle: string;
workspaceId: string;
}>;
Archives a project by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the project to archive. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<
| {
canAssignTasks
: boolean
;
childOrder
: number
;
color
: string
;
createdAt
: null
| string
;
defaultOrder
: number
;
description
: string
;
id
: string
;
inboxProject
: boolean
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
isFavorite
: boolean
;
isFrozen
: boolean
;
isShared
: boolean
;
name
: string
;
parentId
: null
| string
;
updatedAt
: null
| string
;
url
: string
;
viewStyle
: string
;
}
| {
canAssignTasks
: boolean
;
childOrder
: number
;
collaboratorRoleDefault
: string
;
color
: string
;
createdAt
: null
| string
;
defaultOrder
: number
;
description
: string
;
folderId
: null
| string
;
id
: string
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
isFavorite
: boolean
;
isFrozen
: boolean
;
isInviteOnly
: null
| boolean
;
isLinkSharingEnabled
: boolean
;
isShared
: boolean
;
name
: string
;
role
: null
| string
;
status
: string
;
updatedAt
: null
| string
;
url
: string
;
viewStyle
: string
;
workspaceId
: string
;
}>
A promise that resolves to the updated project.
closeTask()
closeTask(id: string, requestId?: string): Promise<boolean>;
Closes (completes) a task by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the task to close. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<boolean
>
A promise that resolves to true
if successful.
deleteComment()
deleteComment(id: string, requestId?: string): Promise<boolean>;
Deletes a comment by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the comment to delete. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<boolean
>
A promise that resolves to true
if successful.
deleteLabel()
deleteLabel(id: string, requestId?: string): Promise<boolean>;
Deletes a label by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the label to delete. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<boolean
>
A promise that resolves to true
if successful.
deleteProject()
deleteProject(id: string, requestId?: string): Promise<boolean>;
Deletes a project by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the project to delete. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<boolean
>
A promise that resolves to true
if successful.
deleteSection()
deleteSection(id: string, requestId?: string): Promise<boolean>;
Deletes a section by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the section to delete. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<boolean
>
A promise that resolves to true
if successful.
deleteTask()
deleteTask(id: string, requestId?: string): Promise<boolean>;
Deletes a task by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the task to delete. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<boolean
>
A promise that resolves to true
if successful.
getArchivedProjects()
getArchivedProjects(args: GetArchivedProjectsArgs): Promise<GetArchivedProjectsResponse>;
Retrieves all archived projects with optional filters.
Parameters
Parameter | Type | Description |
---|---|---|
args | GetArchivedProjectsArgs | Optional filters for retrieving archived projects. |
Returns
Promise
<GetArchivedProjectsResponse
>
A promise that resolves to an array of archived projects.
getComment()
getComment(id: string): Promise<{
content: string;
fileAttachment: | null
| {
fileDuration?: null | number;
fileName?: null | string;
fileSize?: null | number;
fileType?: null | string;
fileUrl?: null | string;
image?: null | string;
imageHeight?: null | number;
imageWidth?: null | number;
resourceType: string;
title?: null | string;
uploadState?: null | "pending" | "completed";
url?: null | string;
};
id: string;
isDeleted: boolean;
postedAt: string;
postedUid: string;
projectId?: string;
reactions: null | Record<string, string[]>;
taskId: undefined | string;
uidsToNotify: null | string[];
}>;
Retrieves a specific comment by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the comment to retrieve. |
Returns
Promise
<{
content
: string
;
fileAttachment
: | null
| {
fileDuration?
: null
| number
;
fileName?
: null
| string
;
fileSize?
: null
| number
;
fileType?
: null
| string
;
fileUrl?
: null
| string
;
image?
: null
| string
;
imageHeight?
: null
| number
;
imageWidth?
: null
| number
;
resourceType
: string
;
title?
: null
| string
;
uploadState?
: null
| "pending"
| "completed"
;
url?
: null
| string
;
};
id
: string
;
isDeleted
: boolean
;
postedAt
: string
;
postedUid
: string
;
projectId?
: string
;
reactions
: null
| Record
<string
, string
[]>;
taskId
: undefined
| string
;
uidsToNotify
: null
| string
[];
}>
A promise that resolves to the requested comment.
getComments()
getComments(args:
| GetTaskCommentsArgs
| GetProjectCommentsArgs): Promise<GetCommentsResponse>;
Retrieves all comments associated with a task or project.
Parameters
Parameter | Type | Description |
---|---|---|
args | | GetTaskCommentsArgs | GetProjectCommentsArgs | Parameters for retrieving comments, such as task ID or project ID. |
Returns
Promise
<GetCommentsResponse
>
A promise that resolves to an array of comments.
getCompletedTasksByCompletionDate()
getCompletedTasksByCompletionDate(args: GetCompletedTasksByCompletionDateArgs): Promise<GetCompletedTasksResponse>;
Retrieves completed tasks by completion date.
Parameters
Parameter | Type | Description |
---|---|---|
args | GetCompletedTasksByCompletionDateArgs | Parameters for filtering, including required since, until. |
Returns
Promise
<GetCompletedTasksResponse
>
A promise that resolves to a paginated response of completed tasks.
getCompletedTasksByDueDate()
getCompletedTasksByDueDate(args: GetCompletedTasksByDueDateArgs): Promise<GetCompletedTasksResponse>;
Retrieves completed tasks by due date.
Parameters
Parameter | Type | Description |
---|---|---|
args | GetCompletedTasksByDueDateArgs | Parameters for filtering, including required since, until. |
Returns
Promise
<GetCompletedTasksResponse
>
A promise that resolves to a paginated response of completed tasks.
getLabel()
getLabel(id: string): Promise<{
color: string;
id: string;
isFavorite: boolean;
name: string;
order: null | number;
}>;
Retrieves a label by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the label. |
Returns
Promise
<{
color
: string
;
id
: string
;
isFavorite
: boolean
;
name
: string
;
order
: null
| number
;
}>
A promise that resolves to the requested label.
getLabels()
getLabels(args: GetLabelsArgs): Promise<GetLabelsResponse>;
Retrieves all labels.
Parameters
Parameter | Type | Description |
---|---|---|
args | GetLabelsArgs | Optional filter parameters. |
Returns
Promise
<GetLabelsResponse
>
A promise that resolves to an array of labels.
getProductivityStats()
getProductivityStats(): Promise<{
completedCount: number;
daysItems: {
date: string;
items: {
completed: number;
id: string;
}[];
totalCompleted: number;
}[];
goals: {
currentDailyStreak: {
count: number;
end: string;
start: string;
};
currentWeeklyStreak: {
count: number;
end: string;
start: string;
};
dailyGoal: number;
ignoreDays: number[];
karmaDisabled: number;
lastDailyStreak: {
count: number;
end: string;
start: string;
};
lastWeeklyStreak: {
count: number;
end: string;
start: string;
};
maxDailyStreak: {
count: number;
end: string;
start: string;
};
maxWeeklyStreak: {
count: number;
end: string;
start: string;
};
user: string;
userId: string;
vacationMode: number;
weeklyGoal: number;
};
karma: number;
karmaGraphData: {
date: string;
karmaAvg: number;
}[];
karmaLastUpdate: number;
karmaTrend: string;
karmaUpdateReasons: {
negativeKarma: number;
negativeKarmaReasons: any[];
newKarma: number;
positiveKarma: number;
positiveKarmaReasons: any[];
time: string;
}[];
projectColors: Record<string, string>;
weekItems: {
from: string;
items: {
completed: number;
id: string;
}[];
to: string;
totalCompleted: number;
}[];
}>;
Retrieves productivity stats for the authenticated user.
Returns
Promise
<{
completedCount
: number
;
daysItems
: {
date
: string
;
items
: {
completed
: number
;
id
: string
;
}[];
totalCompleted
: number
;
}[];
goals
: {
currentDailyStreak
: {
count
: number
;
end
: string
;
start
: string
;
};
currentWeeklyStreak
: {
count
: number
;
end
: string
;
start
: string
;
};
dailyGoal
: number
;
ignoreDays
: number
[];
karmaDisabled
: number
;
lastDailyStreak
: {
count
: number
;
end
: string
;
start
: string
;
};
lastWeeklyStreak
: {
count
: number
;
end
: string
;
start
: string
;
};
maxDailyStreak
: {
count
: number
;
end
: string
;
start
: string
;
};
maxWeeklyStreak
: {
count
: number
;
end
: string
;
start
: string
;
};
user
: string
;
userId
: string
;
vacationMode
: number
;
weeklyGoal
: number
;
};
karma
: number
;
karmaGraphData
: {
date
: string
;
karmaAvg
: number
;
}[];
karmaLastUpdate
: number
;
karmaTrend
: string
;
karmaUpdateReasons
: {
negativeKarma
: number
;
negativeKarmaReasons
: any
[];
newKarma
: number
;
positiveKarma
: number
;
positiveKarmaReasons
: any
[];
time
: string
;
}[];
projectColors
: Record
<string
, string
>;
weekItems
: {
from
: string
;
items
: {
completed
: number
;
id
: string
;
}[];
to
: string
;
totalCompleted
: number
;
}[];
}>
A promise that resolves to the productivity stats.
getProject()
getProject(id: string): Promise<
| {
canAssignTasks: boolean;
childOrder: number;
color: string;
createdAt: null | string;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: null | string;
updatedAt: null | string;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: null | string;
defaultOrder: number;
description: string;
folderId: null | string;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: null | boolean;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: null | string;
status: string;
updatedAt: null | string;
url: string;
viewStyle: string;
workspaceId: string;
}>;
Retrieves a project by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the project. |
Returns
Promise
<
| {
canAssignTasks
: boolean
;
childOrder
: number
;
color
: string
;
createdAt
: null
| string
;
defaultOrder
: number
;
description
: string
;
id
: string
;
inboxProject
: boolean
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
isFavorite
: boolean
;
isFrozen
: boolean
;
isShared
: boolean
;
name
: string
;
parentId
: null
| string
;
updatedAt
: null
| string
;
url
: string
;
viewStyle
: string
;
}
| {
canAssignTasks
: boolean
;
childOrder
: number
;
collaboratorRoleDefault
: string
;
color
: string
;
createdAt
: null
| string
;
defaultOrder
: number
;
description
: string
;
folderId
: null
| string
;
id
: string
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
isFavorite
: boolean
;
isFrozen
: boolean
;
isInviteOnly
: null
| boolean
;
isLinkSharingEnabled
: boolean
;
isShared
: boolean
;
name
: string
;
role
: null
| string
;
status
: string
;
updatedAt
: null
| string
;
url
: string
;
viewStyle
: string
;
workspaceId
: string
;
}>
A promise that resolves to the requested project.
getProjectCollaborators()
getProjectCollaborators(projectId: string, args: GetProjectCollaboratorsArgs): Promise<GetProjectCollaboratorsResponse>;
Retrieves a list of collaborators for a specific project.
Parameters
Parameter | Type | Description |
---|---|---|
projectId | string | The unique identifier of the project. |
args | GetProjectCollaboratorsArgs | Optional parameters to filter collaborators. |
Returns
Promise
<GetProjectCollaboratorsResponse
>
A promise that resolves to an array of collaborators for the project.
getProjects()
getProjects(args: GetProjectsArgs): Promise<GetProjectsResponse>;
Retrieves all projects with optional filters.
Parameters
Parameter | Type | Description |
---|---|---|
args | GetProjectsArgs | Optional filters for retrieving projects. |
Returns
Promise
<GetProjectsResponse
>
A promise that resolves to an array of projects.
getSection()
getSection(id: string): Promise<{
addedAt: string;
archivedAt: null | string;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
name: string;
projectId: string;
sectionOrder: number;
updatedAt: string;
url: string;
userId: string;
}>;
Retrieves a single section by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the section. |
Returns
Promise
<{
addedAt
: string
;
archivedAt
: null
| string
;
id
: string
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
name
: string
;
projectId
: string
;
sectionOrder
: number
;
updatedAt
: string
;
url
: string
;
userId
: string
;
}>
A promise that resolves to the requested section.
getSections()
getSections(args: GetSectionsArgs): Promise<GetSectionsResponse>;
Retrieves all sections within a specific project or matching criteria.
Parameters
Parameter | Type | Description |
---|---|---|
args | GetSectionsArgs | Filter parameters such as project ID. |
Returns
Promise
<GetSectionsResponse
>
A promise that resolves to an array of sections.
getSharedLabels()
getSharedLabels(args?: GetSharedLabelsArgs): Promise<GetSharedLabelsResponse>;
Retrieves a list of shared labels.
Parameters
Parameter | Type | Description |
---|---|---|
args? | GetSharedLabelsArgs | Optional parameters to filter shared labels. |
Returns
Promise
<GetSharedLabelsResponse
>
A promise that resolves to an array of shared labels.
getTask()
getTask(id: string): Promise<{
addedAt: null | string;
addedByUid: null | string;
assignedByUid: null | string;
checked: boolean;
childOrder: number;
completedAt: null | string;
content: string;
dayOrder: number;
deadline: | null
| {
date: string;
lang: string;
};
description: string;
due: | null
| {
date: string;
datetime?: null | string;
isRecurring: boolean;
lang?: null | string;
string: string;
timezone?: null | string;
};
duration: | null
| {
amount: number;
unit: "minute" | "day";
};
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: null | string;
priority: number;
projectId: string;
responsibleUid: null | string;
sectionId: null | string;
updatedAt: null | string;
url: string;
userId: string;
}>;
Retrieves a single active (non-completed) task by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the task. |
Returns
Promise
<{
addedAt
: null
| string
;
addedByUid
: null
| string
;
assignedByUid
: null
| string
;
checked
: boolean
;
childOrder
: number
;
completedAt
: null
| string
;
content
: string
;
dayOrder
: number
;
deadline
: | null
| {
date
: string
;
lang
: string
;
};
description
: string
;
due
: | null
| {
date
: string
;
datetime?
: null
| string
;
isRecurring
: boolean
;
lang?
: null
| string
;
string
: string
;
timezone?
: null
| string
;
};
duration
: | null
| {
amount
: number
;
unit
: "minute"
| "day"
;
};
id
: string
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
labels
: string
[];
noteCount
: number
;
parentId
: null
| string
;
priority
: number
;
projectId
: string
;
responsibleUid
: null
| string
;
sectionId
: null
| string
;
updatedAt
: null
| string
;
url
: string
;
userId
: string
;
}>
A promise that resolves to the requested task.
getTasks()
getTasks(args: GetTasksArgs): Promise<GetTasksResponse>;
Retrieves a list of active tasks filtered by specific parameters.
Parameters
Parameter | Type | Description |
---|---|---|
args | GetTasksArgs | Filter parameters such as project ID, label ID, or due date. |
Returns
Promise
<GetTasksResponse
>
A promise that resolves to an array of tasks.
getTasksByFilter()
getTasksByFilter(args: GetTasksByFilterArgs): Promise<GetTasksResponse>;
Retrieves tasks filtered by a filter string.
Parameters
Parameter | Type | Description |
---|---|---|
args | GetTasksByFilterArgs | Parameters for filtering tasks, including the query string and optional language. |
Returns
Promise
<GetTasksResponse
>
A promise that resolves to a paginated response of tasks.
getUser()
getUser(): Promise<{
avatarBig: null | string;
avatarMedium: null | string;
avatarS640: null | string;
avatarSmall: null | string;
businessAccountId: null | string;
completedCount: number;
completedToday: number;
dailyGoal: number;
dateFormat: number;
daysOff: number[];
email: string;
fullName: string;
id: string;
inboxProjectId: string;
isPremium: boolean;
karma: number;
karmaTrend: string;
lang: string;
nextWeek: number;
startDay: number;
startPage: string;
timeFormat: number;
tzInfo: {
gmtString: string;
hours: number;
isDst: number;
minutes: number;
timezone: string;
};
weekendStartDay: number;
weeklyGoal: number;
}>;
Retrieves information about the authenticated user.
Returns
Promise
<{
avatarBig
: null
| string
;
avatarMedium
: null
| string
;
avatarS640
: null
| string
;
avatarSmall
: null
| string
;
businessAccountId
: null
| string
;
completedCount
: number
;
completedToday
: number
;
dailyGoal
: number
;
dateFormat
: number
;
daysOff
: number
[];
email
: string
;
fullName
: string
;
id
: string
;
inboxProjectId
: string
;
isPremium
: boolean
;
karma
: number
;
karmaTrend
: string
;
lang
: string
;
nextWeek
: number
;
startDay
: number
;
startPage
: string
;
timeFormat
: number
;
tzInfo
: {
gmtString
: string
;
hours
: number
;
isDst
: number
;
minutes
: number
;
timezone
: string
;
};
weekendStartDay
: number
;
weeklyGoal
: number
;
}>
A promise that resolves to the current user's information.
moveTasks()
moveTasks(
ids: string[],
args: _RequireExactlyOne,
requestId?: string): Promise<{
addedAt: null | string;
addedByUid: null | string;
assignedByUid: null | string;
checked: boolean;
childOrder: number;
completedAt: null | string;
content: string;
dayOrder: number;
deadline: | null
| {
date: string;
lang: string;
};
description: string;
due: | null
| {
date: string;
datetime?: null | string;
isRecurring: boolean;
lang?: null | string;
string: string;
timezone?: null | string;
};
duration: | null
| {
amount: number;
unit: "minute" | "day";
};
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: null | string;
priority: number;
projectId: string;
responsibleUid: null | string;
sectionId: null | string;
updatedAt: null | string;
url: string;
userId: string;
}[]>;
Moves existing tasks by their ID to either a different parent/section/project.
Parameters
Parameter | Type | Description |
---|---|---|
ids | string [] | The unique identifier of the tasks to be moved. |
args | _RequireExactlyOne | The paramets that should contain only one of projectId, sectionId, or parentId |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<{
addedAt
: null
| string
;
addedByUid
: null
| string
;
assignedByUid
: null
| string
;
checked
: boolean
;
childOrder
: number
;
completedAt
: null
| string
;
content
: string
;
dayOrder
: number
;
deadline
: | null
| {
date
: string
;
lang
: string
;
};
description
: string
;
due
: | null
| {
date
: string
;
datetime?
: null
| string
;
isRecurring
: boolean
;
lang?
: null
| string
;
string
: string
;
timezone?
: null
| string
;
};
duration
: | null
| {
amount
: number
;
unit
: "minute"
| "day"
;
};
id
: string
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
labels
: string
[];
noteCount
: number
;
parentId
: null
| string
;
priority
: number
;
projectId
: string
;
responsibleUid
: null
| string
;
sectionId
: null
| string
;
updatedAt
: null
| string
;
url
: string
;
userId
: string
;
}[]>
- A promise that resolves to an array of the updated tasks.
quickAddTask()
quickAddTask(args: QuickAddTaskArgs): Promise<{
addedAt: null | string;
addedByUid: null | string;
assignedByUid: null | string;
checked: boolean;
childOrder: number;
completedAt: null | string;
content: string;
dayOrder: number;
deadline: | null
| {
date: string;
lang: string;
};
description: string;
due: | null
| {
date: string;
datetime?: null | string;
isRecurring: boolean;
lang?: null | string;
string: string;
timezone?: null | string;
};
duration: | null
| {
amount: number;
unit: "minute" | "day";
};
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: null | string;
priority: number;
projectId: string;
responsibleUid: null | string;
sectionId: null | string;
updatedAt: null | string;
url: string;
userId: string;
}>;
Quickly adds a task using natural language processing for due dates.
Parameters
Parameter | Type | Description |
---|---|---|
args | QuickAddTaskArgs | Quick add task parameters, including content and due date. |
Returns
Promise
<{
addedAt
: null
| string
;
addedByUid
: null
| string
;
assignedByUid
: null
| string
;
checked
: boolean
;
childOrder
: number
;
completedAt
: null
| string
;
content
: string
;
dayOrder
: number
;
deadline
: | null
| {
date
: string
;
lang
: string
;
};
description
: string
;
due
: | null
| {
date
: string
;
datetime?
: null
| string
;
isRecurring
: boolean
;
lang?
: null
| string
;
string
: string
;
timezone?
: null
| string
;
};
duration
: | null
| {
amount
: number
;
unit
: "minute"
| "day"
;
};
id
: string
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
labels
: string
[];
noteCount
: number
;
parentId
: null
| string
;
priority
: number
;
projectId
: string
;
responsibleUid
: null
| string
;
sectionId
: null
| string
;
updatedAt
: null
| string
;
url
: string
;
userId
: string
;
}>
A promise that resolves to the created task.
removeSharedLabel()
removeSharedLabel(args: RemoveSharedLabelArgs): Promise<boolean>;
Removes a shared label.
Parameters
Parameter | Type | Description |
---|---|---|
args | RemoveSharedLabelArgs | Parameters for removing the shared label. |
Returns
Promise
<boolean
>
A promise that resolves to true
if successful.
renameSharedLabel()
renameSharedLabel(args: RenameSharedLabelArgs): Promise<boolean>;
Renames an existing shared label.
Parameters
Parameter | Type | Description |
---|---|---|
args | RenameSharedLabelArgs | Parameters for renaming the shared label, including the current and new name. |
Returns
Promise
<boolean
>
A promise that resolves to true
if successful.
reopenTask()
reopenTask(id: string, requestId?: string): Promise<boolean>;
Reopens a previously closed (completed) task by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the task to reopen. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<boolean
>
A promise that resolves to true
if successful.
unarchiveProject()
unarchiveProject(id: string, requestId?: string): Promise<
| {
canAssignTasks: boolean;
childOrder: number;
color: string;
createdAt: null | string;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: null | string;
updatedAt: null | string;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: null | string;
defaultOrder: number;
description: string;
folderId: null | string;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: null | boolean;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: null | string;
status: string;
updatedAt: null | string;
url: string;
viewStyle: string;
workspaceId: string;
}>;
Unarchives a project by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the project to unarchive. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<
| {
canAssignTasks
: boolean
;
childOrder
: number
;
color
: string
;
createdAt
: null
| string
;
defaultOrder
: number
;
description
: string
;
id
: string
;
inboxProject
: boolean
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
isFavorite
: boolean
;
isFrozen
: boolean
;
isShared
: boolean
;
name
: string
;
parentId
: null
| string
;
updatedAt
: null
| string
;
url
: string
;
viewStyle
: string
;
}
| {
canAssignTasks
: boolean
;
childOrder
: number
;
collaboratorRoleDefault
: string
;
color
: string
;
createdAt
: null
| string
;
defaultOrder
: number
;
description
: string
;
folderId
: null
| string
;
id
: string
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
isFavorite
: boolean
;
isFrozen
: boolean
;
isInviteOnly
: null
| boolean
;
isLinkSharingEnabled
: boolean
;
isShared
: boolean
;
name
: string
;
role
: null
| string
;
status
: string
;
updatedAt
: null
| string
;
url
: string
;
viewStyle
: string
;
workspaceId
: string
;
}>
A promise that resolves to the updated project.
updateComment()
updateComment(
id: string,
args: UpdateCommentArgs,
requestId?: string): Promise<{
content: string;
fileAttachment: | null
| {
fileDuration?: null | number;
fileName?: null | string;
fileSize?: null | number;
fileType?: null | string;
fileUrl?: null | string;
image?: null | string;
imageHeight?: null | number;
imageWidth?: null | number;
resourceType: string;
title?: null | string;
uploadState?: null | "pending" | "completed";
url?: null | string;
};
id: string;
isDeleted: boolean;
postedAt: string;
postedUid: string;
projectId?: string;
reactions: null | Record<string, string[]>;
taskId: undefined | string;
uidsToNotify: null | string[];
}>;
Updates an existing comment by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the comment to update. |
args | UpdateCommentArgs | Update parameters such as new content. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<{
content
: string
;
fileAttachment
: | null
| {
fileDuration?
: null
| number
;
fileName?
: null
| string
;
fileSize?
: null
| number
;
fileType?
: null
| string
;
fileUrl?
: null
| string
;
image?
: null
| string
;
imageHeight?
: null
| number
;
imageWidth?
: null
| number
;
resourceType
: string
;
title?
: null
| string
;
uploadState?
: null
| "pending"
| "completed"
;
url?
: null
| string
;
};
id
: string
;
isDeleted
: boolean
;
postedAt
: string
;
postedUid
: string
;
projectId?
: string
;
reactions
: null
| Record
<string
, string
[]>;
taskId
: undefined
| string
;
uidsToNotify
: null
| string
[];
}>
A promise that resolves to the updated comment.
updateLabel()
updateLabel(
id: string,
args: UpdateLabelArgs,
requestId?: string): Promise<{
color: string;
id: string;
isFavorite: boolean;
name: string;
order: null | number;
}>;
Updates an existing label by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the label to update. |
args | UpdateLabelArgs | Update parameters such as name or color. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<{
color
: string
;
id
: string
;
isFavorite
: boolean
;
name
: string
;
order
: null
| number
;
}>
A promise that resolves to the updated label.
updateProject()
updateProject(
id: string,
args: UpdateProjectArgs,
requestId?: string): Promise<
| {
canAssignTasks: boolean;
childOrder: number;
color: string;
createdAt: null | string;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: null | string;
updatedAt: null | string;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: null | string;
defaultOrder: number;
description: string;
folderId: null | string;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: null | boolean;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: null | string;
status: string;
updatedAt: null | string;
url: string;
viewStyle: string;
workspaceId: string;
}>;
Updates an existing project by its ID with the provided parameters.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the project to update. |
args | UpdateProjectArgs | Update parameters such as name or color. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<
| {
canAssignTasks
: boolean
;
childOrder
: number
;
color
: string
;
createdAt
: null
| string
;
defaultOrder
: number
;
description
: string
;
id
: string
;
inboxProject
: boolean
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
isFavorite
: boolean
;
isFrozen
: boolean
;
isShared
: boolean
;
name
: string
;
parentId
: null
| string
;
updatedAt
: null
| string
;
url
: string
;
viewStyle
: string
;
}
| {
canAssignTasks
: boolean
;
childOrder
: number
;
collaboratorRoleDefault
: string
;
color
: string
;
createdAt
: null
| string
;
defaultOrder
: number
;
description
: string
;
folderId
: null
| string
;
id
: string
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
isFavorite
: boolean
;
isFrozen
: boolean
;
isInviteOnly
: null
| boolean
;
isLinkSharingEnabled
: boolean
;
isShared
: boolean
;
name
: string
;
role
: null
| string
;
status
: string
;
updatedAt
: null
| string
;
url
: string
;
viewStyle
: string
;
workspaceId
: string
;
}>
A promise that resolves to the updated project.
updateSection()
updateSection(
id: string,
args: UpdateSectionArgs,
requestId?: string): Promise<{
addedAt: string;
archivedAt: null | string;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
name: string;
projectId: string;
sectionOrder: number;
updatedAt: string;
url: string;
userId: string;
}>;
Updates a section by its ID with the provided parameters.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the section to update. |
args | UpdateSectionArgs | Update parameters such as name or project ID. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<{
addedAt
: string
;
archivedAt
: null
| string
;
id
: string
;
isArchived
: boolean
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
name
: string
;
projectId
: string
;
sectionOrder
: number
;
updatedAt
: string
;
url
: string
;
userId
: string
;
}>
A promise that resolves to the updated section.
updateTask()
updateTask(
id: string,
args: UpdateTaskArgs,
requestId?: string): Promise<{
addedAt: null | string;
addedByUid: null | string;
assignedByUid: null | string;
checked: boolean;
childOrder: number;
completedAt: null | string;
content: string;
dayOrder: number;
deadline: | null
| {
date: string;
lang: string;
};
description: string;
due: | null
| {
date: string;
datetime?: null | string;
isRecurring: boolean;
lang?: null | string;
string: string;
timezone?: null | string;
};
duration: | null
| {
amount: number;
unit: "minute" | "day";
};
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: null | string;
priority: number;
projectId: string;
responsibleUid: null | string;
sectionId: null | string;
updatedAt: null | string;
url: string;
userId: string;
}>;
Updates an existing task by its ID with the provided parameters.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique identifier of the task to update. |
args | UpdateTaskArgs | Update parameters such as content, priority, or due date. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise
<{
addedAt
: null
| string
;
addedByUid
: null
| string
;
assignedByUid
: null
| string
;
checked
: boolean
;
childOrder
: number
;
completedAt
: null
| string
;
content
: string
;
dayOrder
: number
;
deadline
: | null
| {
date
: string
;
lang
: string
;
};
description
: string
;
due
: | null
| {
date
: string
;
datetime?
: null
| string
;
isRecurring
: boolean
;
lang?
: null
| string
;
string
: string
;
timezone?
: null
| string
;
};
duration
: | null
| {
amount
: number
;
unit
: "minute"
| "day"
;
};
id
: string
;
isCollapsed
: boolean
;
isDeleted
: boolean
;
labels
: string
[];
noteCount
: number
;
parentId
: null
| string
;
priority
: number
;
projectId
: string
;
responsibleUid
: null
| string
;
sectionId
: null
| string
;
updatedAt
: null
| string
;
url
: string
;
userId
: string
;
}>
A promise that resolves to the updated task.