Tasks
Hierarchical project tasks, root projects, templates, and versioned task data.
tasks.listRootsInferred outputList root tasks (projects) for the organization.
{
status?: "active" | "draft" | "baseline" | "contracted" | "archived" | undefined;
search?: string | undefined;
limit?: number | undefined;
offset?: number | undefined;
contactId?: string | undefined;
projectType?: "admin" | "client" | "template" | undefined;
taskType?: "admin" | "project" | "template" | undefined;
}PaginatedResult<RootTaskResult>tasks.listRootsByContactInferred outputList root tasks (projects) for a specific contact/client.
{
contactId: string;
limit?: number | undefined;
offset?: number | undefined;
}PaginatedResult<RootTaskResult>tasks.createRootInferred outputCreate a new root task (project).
{
name: string;
code?: string | undefined;
description?: string | undefined;
tags?: Array<string> | undefined;
startDate?: string | undefined;
endDate?: string | undefined;
segments?: Array<{
start: string;
end: string;
}> | undefined;
contactId?: string | undefined;
projectType?: "admin" | "client" | "template" | undefined;
taskTypeId?: string | null | undefined;
isBillableRoot?: boolean | undefined;
isPerpetual?: boolean | undefined;
templateCategory?: string | undefined;
templateDescription?: string | undefined;
taskType?: "admin" | "project" | "template" | undefined;
}CreatedRootTaskResulttasks.createFromTemplateInferred outputCreate a new project from a template. If no templateId is provided, uses the organization's default template. If no default template exists, creates a blank project.
{
name: string;
code?: string | undefined;
description?: string | undefined;
tags?: Array<string> | undefined;
startDate?: string | undefined;
endDate?: string | undefined;
contactId?: string | undefined;
templateId?: string | undefined;
}CreatedRootTaskResulttasks.saveAsTemplateInferred outputSave an existing project as a template. Copies task hierarchy and pool-level allocations, converting dates to epoch offsets.
{
name: string;
projectId: string;
templateCategory?: string | undefined;
templateDescription?: string | undefined;
}CreatedRootTaskResulttasks.listInferred outputList all tasks (for selectors like time entry).
{
search?: string | undefined;
limit?: number | undefined;
offset?: number | undefined;
projectId?: string | undefined;
}PaginatedResult<unknown>tasks.listChildrenInferred outputList child tasks of a parent.
{
parentTaskId: string;
search?: string | undefined;
limit?: number | undefined;
offset?: number | undefined;
}{
data: Array<unknown>;
limit: number;
offset: number;
}tasks.getDescendantsInferred outputGet all descendant task IDs and names for a task. Uses a recursive CTE for efficient hierarchy traversal. Used by the property panel to resolve child financials without the schedule store.
{
taskId: string;
}Array<{
id: string;
name: string;
parentTaskId: string;
}>tasks.getByIdInferred outputGet a single task by ID with active version.
{
id: string;
}{
id: string;
code: string | null;
organizationId: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
tags: Array<string> | null;
contactId: string | null;
parentTaskId: string | null;
ownerResourceId: string | null;
projectType: "admin" | "client" | "template" | null;
taskTypeId: string | null;
isBillableRoot: boolean | null;
isPerpetual: boolean | null;
templateCategory: string | null;
templateDescription: string | null;
activeVersionId: string | null;
comparisonBaselineId: string | null;
} | nulltasks.getByCodeInferred outputGet a root task (project) by code with active version.
{
code: string;
}RootTaskResult | nulltasks.createChildInferred outputCreate a child task within an existing version.
{
versionId: string;
name: string;
parentTaskId: string;
id?: string | undefined;
description?: string | undefined;
startDate?: string | undefined;
endDate?: string | undefined;
segments?: Array<{
start: string;
end: string;
}> | undefined;
taskTypeId?: string | null | undefined;
position?: number | undefined;
taskType?: "admin" | "task" | "stage" | "project" | "phase" | "template" | undefined;
}CreatedChildTaskResulttasks.updateInferred outputUpdate a task (shell and/or active version).
{
id: string;
code?: string | undefined;
status?: "pending" | "completed" | "cancelled" | "in_progress" | "blocked" | undefined;
name?: string | undefined;
description?: string | null | undefined;
tags?: Array<string> | undefined;
startDate?: string | null | undefined;
endDate?: string | null | undefined;
segments?: Array<{
start: string;
end: string;
}> | undefined;
contactId?: string | null | undefined;
ownerResourceId?: string | null | undefined;
projectType?: "admin" | "client" | "template" | undefined;
color?: string | null | undefined;
taskTypeId?: string | null | undefined;
isBillableRoot?: boolean | undefined;
isPerpetual?: boolean | undefined;
templateCategory?: string | null | undefined;
templateDescription?: string | null | undefined;
position?: number | undefined;
targetProfitOverride?: string | null | undefined;
}({
id: string;
code: string | null;
organizationId: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
tags: Array<string> | null;
contactId: string | null;
parentTaskId: string | null;
ownerResourceId: string | null;
projectType: "admin" | "client" | "template" | null;
taskTypeId: string | null;
isBillableRoot: boolean | null;
isPerpetual: boolean | null;
templateCategory: string | null;
templateDescription: string | null;
activeVersionId: string | null;
comparisonBaselineId: string | null;
} & {
activeVersion: {
id: string;
path: string | null;
status: string | null;
organizationId: string;
taskId: string;
versionId: string;
name: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
description: string | null;
tags: Array<string> | null;
startDate: string | null;
endDate: string | null;
segments: Array<{
start: string;
end: string;
}> | null;
isBillable: boolean | null;
parentTaskId: string | null;
color: string | null;
totalHours: string | null;
depth: number | null;
position: number | null;
durationDays: number | null;
totalRevenue: string | null;
totalExpenses: string | null;
totalProfit: string | null;
effectiveContactId: string | null;
effectiveOwnerResourceId: string | null;
effectiveCode: string | null;
effectiveBillingRootTaskId: string | null;
targetProfitOverride: string | null;
} | null;
}) | nulltasks.deleteInferred outputSoft delete a task.
{
id: string;
}{
success: boolean;
error: string;
} | {
success: boolean;
error?: undefined;
}