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
acceptWorkspaceInvitation()
acceptWorkspaceInvitation(args: WorkspaceInvitationActionArgs, requestId?: string): Promise<{
id: string;
inviterId: string;
isExistingUser: boolean;
role: "ADMIN" | "MEMBER" | "GUEST";
userEmail: string;
workspaceId: string;
}>;
Accepts a workspace invitation.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | WorkspaceInvitationActionArgs | Arguments including invite code. |
requestId? | string | Optional request ID for idempotency. |
Returns
Promise<{
id: string;
inviterId: string;
isExistingUser: boolean;
role: "ADMIN" | "MEMBER" | "GUEST";
userEmail: string;
workspaceId: string;
}>
The accepted invitation.
addComment()
addComment(args: AddCommentArgs, requestId?: string): Promise<{
content: string;
fileAttachment: | {
fileDuration?: number | null;
fileName?: string | null;
fileSize?: number | null;
fileType?: string | null;
fileUrl?: string | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
resourceType: string;
title?: string | null;
uploadState?: "pending" | "completed" | null;
url?: string | null;
}
| null;
id: string;
isDeleted: boolean;
postedAt: string;
postedUid: string;
projectId?: string;
reactions: Record<string, string[]> | null;
taskId: string | undefined;
uidsToNotify: string[] | null;
}>;
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: | {
fileDuration?: number | null;
fileName?: string | null;
fileSize?: number | null;
fileType?: string | null;
fileUrl?: string | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
resourceType: string;
title?: string | null;
uploadState?: "pending" | "completed" | null;
url?: string | null;
}
| null;
id: string;
isDeleted: boolean;
postedAt: string;
postedUid: string;
projectId?: string;
reactions: Record<string, string[]> | null;
taskId: string | undefined;
uidsToNotify: string[] | null;
}>
A promise that resolves to the created comment.
addLabel()
addLabel(args: AddLabelArgs, requestId?: string): Promise<{
color: string;
id: string;
isFavorite: boolean;
name: string;
order: number | null;
}>;
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: number | null;
}>
A promise that resolves to the created label.
addProject()
addProject(args: AddProjectArgs, requestId?: string): Promise<
| {
canAssignTasks: boolean;
childOrder: number;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: string | null;
updatedAt: string | null;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
folderId: string | null;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: boolean | null;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: string | null;
status: string;
updatedAt: string | null;
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: string | null;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: string | null;
updatedAt: string | null;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
folderId: string | null;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: boolean | null;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: string | null;
status: string;
updatedAt: string | null;
url: string;
viewStyle: string;
workspaceId: string;
}>
A promise that resolves to the created project.
addSection()
addSection(args: AddSectionArgs, requestId?: string): Promise<{
addedAt: string;
archivedAt: string | null;
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: string | null;
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: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
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: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
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: string | null;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: string | null;
updatedAt: string | null;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
folderId: string | null;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: boolean | null;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: string | null;
status: string;
updatedAt: string | null;
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: string | null;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: string | null;
updatedAt: string | null;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
folderId: string | null;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: boolean | null;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: string | null;
status: string;
updatedAt: string | null;
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.
deleteUpload()
deleteUpload(args: DeleteUploadArgs, requestId?: string): Promise<boolean>;
Deletes an uploaded file by its URL.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | DeleteUploadArgs | The file URL to delete. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise<boolean>
A promise that resolves to true if deletion was successful.
Example
await api.deleteUpload({
fileUrl: 'https://cdn.todoist.com/...'
})
deleteWorkspaceInvitation()
deleteWorkspaceInvitation(args: DeleteWorkspaceInvitationArgs, requestId?: string): Promise<{
id: string;
inviterId: string;
isExistingUser: boolean;
role: "ADMIN" | "MEMBER" | "GUEST";
userEmail: string;
workspaceId: string;
}>;
Deletes a workspace invitation (admin only).
Parameters
| Parameter | Type | Description |
|---|---|---|
args | DeleteWorkspaceInvitationArgs | Arguments including workspace ID and user email. |
requestId? | string | Optional request ID for idempotency. |
Returns
Promise<{
id: string;
inviterId: string;
isExistingUser: boolean;
role: "ADMIN" | "MEMBER" | "GUEST";
userEmail: string;
workspaceId: string;
}>
The deleted invitation.
getActivityLogs()
getActivityLogs(args: GetActivityLogsArgs): Promise<GetActivityLogsResponse>;
Retrieves activity logs with optional filters.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | GetActivityLogsArgs | Optional filter parameters for activity logs. |
Returns
Promise<GetActivityLogsResponse>
A promise that resolves to a paginated response of activity events.
getAllWorkspaceInvitations()
getAllWorkspaceInvitations(args: {
workspaceId?: number;
}, requestId?: string): Promise<AllWorkspaceInvitationsResponse>;
Gets all workspace invitations (admin only).
Parameters
| Parameter | Type | Description |
|---|---|---|
args | { workspaceId?: number; } | - |
args.workspaceId? | number | - |
requestId? | string | Optional request ID for idempotency. |
Returns
Promise<AllWorkspaceInvitationsResponse>
Array of email addresses with pending invitations.
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: | {
fileDuration?: number | null;
fileName?: string | null;
fileSize?: number | null;
fileType?: string | null;
fileUrl?: string | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
resourceType: string;
title?: string | null;
uploadState?: "pending" | "completed" | null;
url?: string | null;
}
| null;
id: string;
isDeleted: boolean;
postedAt: string;
postedUid: string;
projectId?: string;
reactions: Record<string, string[]> | null;
taskId: string | undefined;
uidsToNotify: string[] | null;
}>;
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: | {
fileDuration?: number | null;
fileName?: string | null;
fileSize?: number | null;
fileType?: string | null;
fileUrl?: string | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
resourceType: string;
title?: string | null;
uploadState?: "pending" | "completed" | null;
url?: string | null;
}
| null;
id: string;
isDeleted: boolean;
postedAt: string;
postedUid: string;
projectId?: string;
reactions: Record<string, string[]> | null;
taskId: string | undefined;
uidsToNotify: string[] | null;
}>
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: number | null;
}>;
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: number | null;
}>
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: string | null;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: string | null;
updatedAt: string | null;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
folderId: string | null;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: boolean | null;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: string | null;
status: string;
updatedAt: string | null;
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: string | null;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: string | null;
updatedAt: string | null;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
folderId: string | null;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: boolean | null;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: string | null;
status: string;
updatedAt: string | null;
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: string | null;
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: string | null;
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: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
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: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
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?: string | null;
avatarMedium?: string | null;
avatarS640?: string | null;
avatarSmall?: string | null;
businessAccountId: string | null;
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?: string | null;
avatarMedium?: string | null;
avatarS640?: string | null;
avatarSmall?: string | null;
businessAccountId: string | null;
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.
getWorkspaceActiveProjects()
getWorkspaceActiveProjects(args: GetWorkspaceProjectsArgs, requestId?: string): Promise<GetProjectsResponse>;
Gets active projects in a workspace with pagination.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | GetWorkspaceProjectsArgs | Arguments including workspace ID, cursor, and limit. |
requestId? | string | Optional request ID for idempotency. |
Returns
Promise<GetProjectsResponse>
Paginated list of active workspace projects.
getWorkspaceArchivedProjects()
getWorkspaceArchivedProjects(args: GetWorkspaceProjectsArgs, requestId?: string): Promise<GetProjectsResponse>;
Gets archived projects in a workspace with pagination.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | GetWorkspaceProjectsArgs | Arguments including workspace ID, cursor, and limit. |
requestId? | string | Optional request ID for idempotency. |
Returns
Promise<GetProjectsResponse>
Paginated list of archived workspace projects.
getWorkspaceInvitations()
getWorkspaceInvitations(args: GetWorkspaceInvitationsArgs, requestId?: string): Promise<WorkspaceInvitationsResponse>;
Gets pending invitations for a workspace.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | GetWorkspaceInvitationsArgs | Arguments including workspace ID. |
requestId? | string | Optional request ID for idempotency. |
Returns
Promise<WorkspaceInvitationsResponse>
Array of email addresses with pending invitations.
getWorkspacePlanDetails()
getWorkspacePlanDetails(args: GetWorkspacePlanDetailsArgs, requestId?: string): Promise<{
cancelAtPeriodEnd: boolean;
currentActiveProjects: number;
currentMemberCount: number;
currentPlan: "Business" | "Starter";
currentPlanStatus: "Active" | "Downgraded" | "Cancelled" | "NeverSubscribed";
downgradeAt: string | null;
hasBillingPortal: boolean;
hasBillingPortalSwitchToAnnual: boolean;
hasTrialed: boolean;
isTrialing: boolean;
maximumActiveProjects: number;
planPrice: | {
amount: string | number;
currency: string;
interval?: string;
}
| null;
priceList: {
amount?: number;
currency?: string;
formatted?: string;
interval?: string;
}[];
trialEndsAt: string | null;
workspaceId: number;
}>;
Gets workspace plan and billing details.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | GetWorkspacePlanDetailsArgs | Arguments including workspace ID. |
requestId? | string | Optional request ID for idempotency. |
Returns
Promise<{
cancelAtPeriodEnd: boolean;
currentActiveProjects: number;
currentMemberCount: number;
currentPlan: "Business" | "Starter";
currentPlanStatus: "Active" | "Downgraded" | "Cancelled" | "NeverSubscribed";
downgradeAt: string | null;
hasBillingPortal: boolean;
hasBillingPortalSwitchToAnnual: boolean;
hasTrialed: boolean;
isTrialing: boolean;
maximumActiveProjects: number;
planPrice: | {
amount: string | number;
currency: string;
interval?: string;
}
| null;
priceList: {
amount?: number;
currency?: string;
formatted?: string;
interval?: string;
}[];
trialEndsAt: string | null;
workspaceId: number;
}>
Workspace plan details.
getWorkspaceUsers()
getWorkspaceUsers(args: GetWorkspaceUsersArgs, requestId?: string): Promise<GetWorkspaceUsersResponse>;
Gets workspace users with pagination.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | GetWorkspaceUsersArgs | Arguments including optional workspace ID, cursor, and limit. |
requestId? | string | Optional request ID for idempotency. |
Returns
Promise<GetWorkspaceUsersResponse>
Paginated list of workspace users.
joinWorkspace()
joinWorkspace(args: JoinWorkspaceArgs, requestId?: string): Promise<{
custom_sorting_applied: boolean;
project_sort_preference: string;
role: "ADMIN" | "MEMBER" | "GUEST";
user_id: string;
workspace_id: string;
}>;
Joins a workspace via invitation link or domain auto-join.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | JoinWorkspaceArgs | Arguments including invite code or workspace ID. |
requestId? | string | Optional request ID for idempotency. |
Returns
Promise<{
custom_sorting_applied: boolean;
project_sort_preference: string;
role: "ADMIN" | "MEMBER" | "GUEST";
user_id: string;
workspace_id: string;
}>
Workspace user information.
moveTask()
moveTask(
id: string,
args: _RequireExactlyOne,
requestId?: string): Promise<{
addedAt: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
url: string;
userId: string;
}>;
Moves a task by its ID to either a different parent/section/project.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the task to be moved. |
args | _RequireExactlyOne | The parameters that should contain exactly one of projectId, sectionId, or parentId |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise<{
addedAt: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
url: string;
userId: string;
}>
A promise that resolves to the updated task.
moveTasks()
moveTasks(
ids: string[],
args: _RequireExactlyOne,
requestId?: string): Promise<{
addedAt: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
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: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
url: string;
userId: string;
}[]>
- A promise that resolves to an array of the updated tasks.
Deprecated
Use moveTask for single task operations. This method uses the Sync API and may be removed in a future version.
quickAddTask()
quickAddTask(args: QuickAddTaskArgs): Promise<{
addedAt: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
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: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
url: string;
userId: string;
}>
A promise that resolves to the created task.
rejectWorkspaceInvitation()
rejectWorkspaceInvitation(args: WorkspaceInvitationActionArgs, requestId?: string): Promise<{
id: string;
inviterId: string;
isExistingUser: boolean;
role: "ADMIN" | "MEMBER" | "GUEST";
userEmail: string;
workspaceId: string;
}>;
Rejects a workspace invitation.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | WorkspaceInvitationActionArgs | Arguments including invite code. |
requestId? | string | Optional request ID for idempotency. |
Returns
Promise<{
id: string;
inviterId: string;
isExistingUser: boolean;
role: "ADMIN" | "MEMBER" | "GUEST";
userEmail: string;
workspaceId: string;
}>
The rejected invitation.
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.
searchCompletedTasks()
searchCompletedTasks(args: SearchCompletedTasksArgs): Promise<GetCompletedTasksResponse>;
Searches completed tasks by query string.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | SearchCompletedTasksArgs | Parameters for searching, including the query string. |
Returns
Promise<GetCompletedTasksResponse>
A promise that resolves to a paginated response of completed tasks.
unarchiveProject()
unarchiveProject(id: string, requestId?: string): Promise<
| {
canAssignTasks: boolean;
childOrder: number;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: string | null;
updatedAt: string | null;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
folderId: string | null;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: boolean | null;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: string | null;
status: string;
updatedAt: string | null;
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: string | null;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: string | null;
updatedAt: string | null;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
folderId: string | null;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: boolean | null;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: string | null;
status: string;
updatedAt: string | null;
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: | {
fileDuration?: number | null;
fileName?: string | null;
fileSize?: number | null;
fileType?: string | null;
fileUrl?: string | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
resourceType: string;
title?: string | null;
uploadState?: "pending" | "completed" | null;
url?: string | null;
}
| null;
id: string;
isDeleted: boolean;
postedAt: string;
postedUid: string;
projectId?: string;
reactions: Record<string, string[]> | null;
taskId: string | undefined;
uidsToNotify: string[] | null;
}>;
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: | {
fileDuration?: number | null;
fileName?: string | null;
fileSize?: number | null;
fileType?: string | null;
fileUrl?: string | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
resourceType: string;
title?: string | null;
uploadState?: "pending" | "completed" | null;
url?: string | null;
}
| null;
id: string;
isDeleted: boolean;
postedAt: string;
postedUid: string;
projectId?: string;
reactions: Record<string, string[]> | null;
taskId: string | undefined;
uidsToNotify: string[] | null;
}>
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: number | null;
}>;
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: number | null;
}>
A promise that resolves to the updated label.
updateProject()
updateProject(
id: string,
args: UpdateProjectArgs,
requestId?: string): Promise<
| {
canAssignTasks: boolean;
childOrder: number;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: string | null;
updatedAt: string | null;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
folderId: string | null;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: boolean | null;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: string | null;
status: string;
updatedAt: string | null;
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: string | null;
defaultOrder: number;
description: string;
id: string;
inboxProject: boolean;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isShared: boolean;
name: string;
parentId: string | null;
updatedAt: string | null;
url: string;
viewStyle: string;
}
| {
canAssignTasks: boolean;
childOrder: number;
collaboratorRoleDefault: string;
color: string;
createdAt: string | null;
defaultOrder: number;
description: string;
folderId: string | null;
id: string;
isArchived: boolean;
isCollapsed: boolean;
isDeleted: boolean;
isFavorite: boolean;
isFrozen: boolean;
isInviteOnly: boolean | null;
isLinkSharingEnabled: boolean;
isShared: boolean;
name: string;
role: string | null;
status: string;
updatedAt: string | null;
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: string | null;
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: string | null;
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: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
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: string | null;
addedByUid: string | null;
assignedByUid: string | null;
checked: boolean;
childOrder: number;
completedAt: string | null;
content: string;
dayOrder: number;
deadline: | {
date: string;
lang: string;
}
| null;
description: string;
due: | {
date: string;
datetime?: string | null;
isRecurring: boolean;
lang?: string | null;
string: string;
timezone?: string | null;
}
| null;
duration: | {
amount: number;
unit: "minute" | "day";
}
| null;
id: string;
isCollapsed: boolean;
isDeleted: boolean;
labels: string[];
noteCount: number;
parentId: string | null;
priority: number;
projectId: string;
responsibleUid: string | null;
sectionId: string | null;
updatedAt: string | null;
url: string;
userId: string;
}>
A promise that resolves to the updated task.
uploadFile()
uploadFile(args: UploadFileArgs, requestId?: string): Promise<{
fileDuration?: number | null;
fileName?: string | null;
fileSize?: number | null;
fileType?: string | null;
fileUrl?: string | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
resourceType: string;
title?: string | null;
uploadState?: "pending" | "completed" | null;
url?: string | null;
}>;
Uploads a file and returns attachment metadata. This creates an upload record that can be referenced in tasks or comments.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | UploadFileArgs | Upload parameters including file content, filename, and optional project ID. |
requestId? | string | Optional custom identifier for the request. |
Returns
Promise<{
fileDuration?: number | null;
fileName?: string | null;
fileSize?: number | null;
fileType?: string | null;
fileUrl?: string | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
resourceType: string;
title?: string | null;
uploadState?: "pending" | "completed" | null;
url?: string | null;
}>
A promise that resolves to the uploaded file's attachment metadata.
Example
// Upload from a file path
const upload = await api.uploadFile({
file: '/path/to/document.pdf',
projectId: '12345'
})
// Upload from a Buffer
const buffer = fs.readFileSync('/path/to/document.pdf')
const upload = await api.uploadFile({
file: buffer,
fileName: 'document.pdf', // Required for Buffer/Stream
projectId: '12345'
})
// Use the returned fileUrl in a comment
await api.addComment({
content: 'See attached document',
taskId: '67890',
attachment: {
fileUrl: upload.fileUrl,
fileName: upload.fileName,
fileType: upload.fileType,
resourceType: upload.resourceType
}
})
uploadWorkspaceLogo()
uploadWorkspaceLogo(args: WorkspaceLogoArgs, requestId?: string): Promise<WorkspaceLogoResponse>;
Uploads or updates a workspace logo.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | WorkspaceLogoArgs | Arguments including workspace ID, file, and options. |
requestId? | string | Optional request ID for idempotency. |
Returns
Promise<WorkspaceLogoResponse>
Logo information or null if deleted.