{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/onplana-com/json-schema/onplana-com-task-schema.json",
  "title": "Task",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/onplana-com-openapi.json#/components/schemas/Task",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "TODO",
        "IN_PROGRESS",
        "REVIEW",
        "DONE",
        "BLOCKED"
      ]
    },
    "priority": {
      "type": "string",
      "enum": [
        "LOW",
        "MEDIUM",
        "HIGH",
        "CRITICAL"
      ]
    },
    "projectId": {
      "type": "string",
      "format": "uuid"
    },
    "assigneeId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "dueDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "estimatedHours": {
      "type": [
        "number",
        "null"
      ]
    },
    "progress": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
    },
    "originalDurationMinutes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Planned duration in working minutes; a day is the project calendar hoursPerDay x 60 (default 480)"
    },
    "remainingDurationMinutes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Working minutes left; 0 when DONE"
    },
    "actualStart": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "Day work began (YYYY-MM-DD)"
    },
    "isManual": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "For a task with subtasks: true keeps its own dates, false takes its start and due dates from its subtasks, null follows the project's parentDatesFromSubtasks. Read only while the server switch parent_date_rollup_enabled is on."
    },
    "datesFromSubtasks": {
      "type": "boolean",
      "description": "True when this task's start and due dates come from its subtasks right now (it has subtasks, is not a milestone or held by a live Planner sync, and its isManual or its project's default says so); a change to its dates, durations or constraint is then refused with PARENT_DATES_FROM_SUBTASKS. False whenever the server switch parent_date_rollup_enabled is off. On GET /tasks, /tasks/mine, /tasks/delegated-to-agents and /projects/{id}/tasks; the same flag the MCP task tools return."
    },
    "optimisticDurationMinutes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Three-point estimate, best case, in working minutes. At most the task's duration (the remaining duration once started) when written; used by schedule risk runs. Null: the run's default range applies"
    },
    "pessimisticDurationMinutes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Three-point estimate, worst case, in working minutes. At least the task's duration (the remaining duration once started) when written"
    },
    "collaborators": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TaskCollaborator"
      },
      "description": "People working on the task besides its one assignee, oldest first (at most 20). Present on task reads that load them; change them with PUT /tasks/{id}/collaborators."
    },
    "myRole": {
      "type": "string",
      "enum": [
        "collaborator"
      ],
      "description": "GET /tasks/mine only: present on a row the caller collaborates on but does not hold. Such a row also carries `assignee`; a row the caller holds carries neither."
    },
    "assignee": {
      "type": [
        "object",
        "null"
      ],
      "description": "GET /tasks/mine only, beside myRole: who holds the task",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  },
  "required": [
    "id",
    "title",
    "status",
    "priority",
    "projectId",
    "progress"
  ],
  "$defs": {
    "TaskCollaborator": {
      "type": "object",
      "description": "A person working on a task besides its assignee. Always a member of the task's project. Collaborating counts as owning the task for editing it, but not for deleting, reassigning, moving it or changing who collaborates (anyone may remove themselves).",
      "properties": {
        "id": {
          "type": "string",
          "description": "User id"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "avatar": {
          "type": [
            "string",
            "null"
          ]
        },
        "isAgentPersona": {
          "type": "boolean",
          "description": "An AI agent member of the organization"
        }
      },
      "required": [
        "id",
        "name",
        "avatar",
        "isAgentPersona"
      ]
    }
  }
}