Monument

Tasks

Hierarchical project tasks, root projects, templates, and versioned task data.

externalpermissionstable13 procedures
querytasks.listRootsInferred output

List root tasks (projects) for the organization.

Input
{
  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;
}
Output
PaginatedResult<RootTaskResult>
querytasks.listRootsByContactInferred output

List root tasks (projects) for a specific contact/client.

Input
{
  contactId: string;
  limit?: number | undefined;
  offset?: number | undefined;
}
Output
PaginatedResult<RootTaskResult>
mutationtasks.createRootInferred output

Create a new root task (project).

Input
{
  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;
}
Output
CreatedRootTaskResult
mutationtasks.createFromTemplateInferred output

Create 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.

Input
{
  name: string;
  code?: string | undefined;
  description?: string | undefined;
  tags?: Array<string> | undefined;
  startDate?: string | undefined;
  endDate?: string | undefined;
  contactId?: string | undefined;
  templateId?: string | undefined;
}
Output
CreatedRootTaskResult
mutationtasks.saveAsTemplateInferred output

Save an existing project as a template. Copies task hierarchy and pool-level allocations, converting dates to epoch offsets.

Input
{
  name: string;
  projectId: string;
  templateCategory?: string | undefined;
  templateDescription?: string | undefined;
}
Output
CreatedRootTaskResult
querytasks.listInferred output

List all tasks (for selectors like time entry).

Input
{
  search?: string | undefined;
  limit?: number | undefined;
  offset?: number | undefined;
  projectId?: string | undefined;
}
Output
PaginatedResult<unknown>
querytasks.listChildrenInferred output

List child tasks of a parent.

Input
{
  parentTaskId: string;
  search?: string | undefined;
  limit?: number | undefined;
  offset?: number | undefined;
}
Output
{
  data: Array<unknown>;
  limit: number;
  offset: number;
}
querytasks.getDescendantsInferred output

Get 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.

Input
{
  taskId: string;
}
Output
Array<{
  id: string;
  name: string;
  parentTaskId: string;
}>
querytasks.getByIdInferred output

Get a single task by ID with active version.

Input
{
  id: string;
}
Output
{
  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;
} | null
querytasks.getByCodeInferred output

Get a root task (project) by code with active version.

Input
{
  code: string;
}
Output
RootTaskResult | null
mutationtasks.createChildInferred output

Create a child task within an existing version.

Input
{
  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;
}
Output
CreatedChildTaskResult
mutationtasks.updateInferred output

Update a task (shell and/or active version).

Input
{
  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;
}
Output
({
  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;
}) | null
mutationtasks.deleteInferred output

Soft delete a task.

Input
{
  id: string;
}
Output
{
  success: boolean;
  error: string;
} | {
  success: boolean;
  error?: undefined;
}