> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.writesonic.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get task detail

> Get one task with full detail (attachments and labels are always included).

Pass `include` to also fetch the task's timeline, relations, and/or approvals.
`timeline_cursor` and `timeline_kind` apply only when the timeline is included.



## OpenAPI

````yaml https://mcp.agent.writesonic.com/openapi.json get /api/v1/business/tasks/{task_id}
openapi: 3.1.0
info:
  title: hq-backend — Business API
  description: Public business tool endpoints (API-key auth).
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/business/tasks/{task_id}:
    get:
      tags:
        - business
      summary: Get task detail
      description: >-
        Get one task with full detail (attachments and labels are always
        included).


        Pass `include` to also fetch the task's timeline, relations, and/or
        approvals.

        `timeline_cursor` and `timeline_kind` apply only when the timeline is
        included.
      operationId: get_task_api_v1_business_tasks__task_id__get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Task to fetch.
            title: Task Id
        - name: timeline_cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Pagination cursor for the task timeline (from a prior response's
              next_cursor).
            title: Timeline Cursor
        - name: timeline_kind
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/TimelineKind'
            description: >-
              Filter the task timeline to one kind:
              all/comment/activity/approval/workflow.
            default: all
        - name: x-project-id
          in: header
          required: true
          schema:
            type: string
            format: uuid
            description: Project ID for tenant scoping
            title: X-Project-Id
          description: Project ID for tenant scoping
        - name: X-Workspace-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Overrides the key's workspace
            title: X-Workspace-Id
          description: Overrides the key's workspace
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: User API key
            title: X-Api-Key
          description: User API key
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - type: array
                  uniqueItems: true
                  items:
                    $ref: '#/components/schemas/TaskInclude'
                - type: 'null'
              description: 'Extra sections to fetch: timeline, relations, and/or approvals.'
              title: Include
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskWithIncludes'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TimelineKind:
      type: string
      enum:
        - all
        - comment
        - activity
        - approval
        - workflow
        - ask_question
      title: TimelineKind
    TaskInclude:
      type: string
      enum:
        - timeline
        - relations
        - attachments
        - approvals
      title: TaskInclude
    TaskWithIncludes:
      properties:
        task:
          $ref: '#/components/schemas/TaskDetail'
        timeline:
          anyOf:
            - $ref: '#/components/schemas/TimelineResponse'
            - type: 'null'
        relations:
          anyOf:
            - items:
                $ref: '#/components/schemas/RelationResponse'
              type: array
            - type: 'null'
          title: Relations
        approvals:
          anyOf:
            - items:
                $ref: '#/components/schemas/ApprovalRead'
              type: array
            - type: 'null'
          title: Approvals
      type: object
      required:
        - task
      title: TaskWithIncludes
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskDetail:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        identifier:
          type: string
          title: Identifier
        title:
          type: string
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        status:
          $ref: '#/components/schemas/TaskStatus'
        priority:
          $ref: '#/components/schemas/TaskPriority'
        creator_type:
          $ref: '#/components/schemas/ActorType'
        creator_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Creator Id
        assignee_type:
          $ref: '#/components/schemas/ActorType'
        assignee_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assignee Id
        parent_task_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Task Id
        page_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Page Id
        schedule_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Schedule Id
        due_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Due Date
        sort_order:
          type: number
          title: Sort Order
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        comment_count:
          type: integer
          title: Comment Count
        last_comment_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Comment At
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        labels:
          items:
            $ref: '#/components/schemas/LabelResponse'
          type: array
          title: Labels
        thread:
          anyOf:
            - $ref: '#/components/schemas/ThreadRef'
            - type: 'null'
        subtask_count:
          $ref: '#/components/schemas/SubtaskCount'
        relation_count:
          type: integer
          title: Relation Count
          default: 0
        attachment_count:
          type: integer
          title: Attachment Count
          default: 0
        attachments:
          items:
            $ref: '#/components/schemas/AttachmentResponse'
          type: array
          title: Attachments
        hierarchy:
          items:
            $ref: '#/components/schemas/TaskHierarchyItem'
          type: array
          title: Hierarchy
        last_comment:
          anyOf:
            - $ref: '#/components/schemas/CommentPreview'
            - type: 'null'
      type: object
      required:
        - id
        - project_id
        - identifier
        - title
        - description
        - status
        - priority
        - creator_type
        - creator_id
        - assignee_type
        - assignee_id
        - parent_task_id
        - page_id
        - schedule_id
        - due_date
        - sort_order
        - started_at
        - completed_at
        - comment_count
        - last_comment_at
        - created_at
        - updated_at
      title: TaskDetail
    TimelineResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/TimelineItem'
          type: array
          title: Items
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
        has_more:
          type: boolean
          title: Has More
        participants:
          items:
            $ref: '#/components/schemas/Participant'
          type: array
          title: Participants
      type: object
      required:
        - items
        - next_cursor
        - has_more
        - participants
      title: TimelineResponse
    RelationResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        source_task_id:
          type: string
          format: uuid
          title: Source Task Id
        target_task_id:
          type: string
          format: uuid
          title: Target Task Id
        relation_type:
          $ref: '#/components/schemas/TaskRelationType'
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - source_task_id
        - target_task_id
        - relation_type
        - created_at
      title: RelationResponse
    ApprovalRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        task_id:
          type: string
          format: uuid
          title: Task Id
        agent_id:
          type: string
          format: uuid
          title: Agent Id
        run_id:
          type: string
          format: uuid
          title: Run Id
        tool_name:
          type: string
          title: Tool Name
        body:
          additionalProperties: true
          type: object
          title: Body
        status:
          $ref: '#/components/schemas/ApprovalStatus'
        reviewer_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Reviewer User Id
        reviewed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Reviewed At
        feedback_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Feedback Text
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - task_id
        - agent_id
        - run_id
        - tool_name
        - body
        - status
        - reviewer_user_id
        - reviewed_at
        - feedback_text
        - created_at
      title: ApprovalRead
      description: Single approval row response. agent_id hydrated via agent_runs JOIN.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TaskStatus:
      type: string
      enum:
        - backlog
        - todo
        - in_progress
        - pending_human_approval
        - in_review
        - done
        - cancelled
      title: TaskStatus
    TaskPriority:
      type: string
      enum:
        - urgent
        - high
        - medium
        - low
        - none
      title: TaskPriority
    ActorType:
      type: string
      enum:
        - human
        - ai_agent
        - system
      title: ActorType
    LabelResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        color:
          type: string
          title: Color
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - project_id
        - name
        - color
        - created_at
      title: LabelResponse
    ThreadRef:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        contact:
          $ref: '#/components/schemas/ThreadContact'
        cc_emails:
          items:
            type: string
          type: array
          title: Cc Emails
          default: []
      type: object
      required:
        - id
        - contact
      title: ThreadRef
      description: 'A conversation in one line: where to open it, and who is on it.'
    SubtaskCount:
      properties:
        total:
          type: integer
          title: Total
          default: 0
        completed:
          type: integer
          title: Completed
          default: 0
      type: object
      title: SubtaskCount
    AttachmentResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        task_id:
          type: string
          format: uuid
          title: Task Id
        filename:
          type: string
          title: Filename
        content_type:
          type: string
          title: Content Type
        size_bytes:
          type: integer
          title: Size Bytes
        uploader_type:
          $ref: '#/components/schemas/ActorType'
        uploader_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Uploader Id
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - task_id
        - filename
        - content_type
        - size_bytes
        - uploader_type
        - uploader_id
        - created_at
      title: AttachmentResponse
    TaskHierarchyItem:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        identifier:
          type: string
          title: Identifier
        title:
          type: string
          title: Title
      type: object
      required:
        - id
        - identifier
        - title
      title: TaskHierarchyItem
    CommentPreview:
      properties:
        author_type:
          $ref: '#/components/schemas/ActorType'
        author_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Id
        body:
          type: string
          title: Body
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - author_type
        - author_id
        - body
        - created_at
      title: CommentPreview
    TimelineItem:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        actor_type:
          $ref: '#/components/schemas/ActorType'
        actor_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Actor Id
        payload:
          oneOf:
            - $ref: '#/components/schemas/ActivityPayload'
            - $ref: '#/components/schemas/CommentPayload'
            - $ref: '#/components/schemas/ApprovalPayload'
            - $ref: '#/components/schemas/WorkflowPayload'
            - $ref: '#/components/schemas/QuestionPayload'
          title: Payload
          discriminator:
            propertyName: kind
            mapping:
              activity:
                $ref: '#/components/schemas/ActivityPayload'
              approval:
                $ref: '#/components/schemas/ApprovalPayload'
              ask_question:
                $ref: '#/components/schemas/QuestionPayload'
              comment:
                $ref: '#/components/schemas/CommentPayload'
              workflow:
                $ref: '#/components/schemas/WorkflowPayload'
      type: object
      required:
        - id
        - created_at
        - actor_type
        - actor_id
        - payload
      title: TimelineItem
    Participant:
      properties:
        actor_type:
          $ref: '#/components/schemas/ActorType'
        actor_id:
          type: string
          title: Actor Id
      type: object
      required:
        - actor_type
        - actor_id
      title: Participant
    TaskRelationType:
      type: string
      enum:
        - depends_on
        - relates_to
        - duplicates
      title: TaskRelationType
    ApprovalStatus:
      type: string
      enum:
        - pending_approval
        - approve
        - reject
        - edit
        - expired
      title: ApprovalStatus
    ThreadContact:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
      type: object
      required:
        - name
        - email
      title: ThreadContact
    ActivityPayload:
      properties:
        kind:
          type: string
          const: activity
          title: Kind
          default: activity
        action:
          $ref: '#/components/schemas/ActivityAction'
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
        old_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Old Value
        new_value:
          anyOf:
            - type: string
            - type: 'null'
          title: New Value
      type: object
      required:
        - action
        - field
        - old_value
        - new_value
      title: ActivityPayload
    CommentPayload:
      properties:
        kind:
          type: string
          const: comment
          title: Kind
          default: comment
        body:
          type: string
          title: Body
        edited_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Edited At
        rollup_source:
          anyOf:
            - $ref: '#/components/schemas/RollupSource'
            - type: 'null'
        attachments:
          items:
            $ref: '#/components/schemas/CommentAttachment'
          type: array
          title: Attachments
      type: object
      required:
        - body
        - edited_at
        - attachments
      title: CommentPayload
    ApprovalPayload:
      properties:
        kind:
          type: string
          const: approval
          title: Kind
          default: approval
        tool_name:
          type: string
          title: Tool Name
        body:
          additionalProperties: true
          type: object
          title: Body
        status:
          $ref: '#/components/schemas/ApprovalStatus'
        feedback_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Feedback Text
        reviewed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Reviewed At
        reviewer_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Reviewer User Id
        run_id:
          type: string
          format: uuid
          title: Run Id
      type: object
      required:
        - tool_name
        - body
        - status
        - feedback_text
        - reviewed_at
        - reviewer_user_id
        - run_id
      title: ApprovalPayload
    WorkflowPayload:
      properties:
        kind:
          type: string
          const: workflow
          title: Kind
          default: workflow
        workflow_id:
          type: string
          format: uuid
          title: Workflow Id
        workflow_run_id:
          type: string
          format: uuid
          title: Workflow Run Id
        interrupt_status:
          $ref: '#/components/schemas/AgentInterruptStatus'
      type: object
      required:
        - workflow_id
        - workflow_run_id
        - interrupt_status
      title: WorkflowPayload
    QuestionPayload:
      properties:
        kind:
          type: string
          const: ask_question
          title: Kind
          default: ask_question
        body:
          $ref: '#/components/schemas/QuestionBody'
        answer:
          anyOf:
            - items:
                $ref: '#/components/schemas/AnswerItem'
              type: array
            - type: 'null'
          title: Answer
        status:
          $ref: '#/components/schemas/QuestionStatus'
        answered_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Answered At
        answered_by_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Answered By User Id
        run_id:
          type: string
          format: uuid
          title: Run Id
      type: object
      required:
        - body
        - answer
        - status
        - answered_at
        - answered_by_user_id
        - run_id
      title: QuestionPayload
    ActivityAction:
      type: string
      enum:
        - created
        - deleted
        - status_changed
        - assigned
        - unassigned
        - label_added
        - label_removed
        - relation_added
        - relation_removed
        - title_changed
        - attachment_added
        - attachment_removed
        - subtask_added
        - subtask_removed
      title: ActivityAction
    RollupSource:
      properties:
        task_id:
          type: string
          format: uuid
          title: Task Id
      type: object
      required:
        - task_id
      title: RollupSource
    CommentAttachment:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        filename:
          type: string
          title: Filename
        content_type:
          type: string
          title: Content Type
        size_bytes:
          type: integer
          title: Size Bytes
        uploader_type:
          $ref: '#/components/schemas/ActorType'
        uploader_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Uploader Id
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - filename
        - content_type
        - size_bytes
        - uploader_type
        - uploader_id
        - created_at
      title: CommentAttachment
    AgentInterruptStatus:
      type: string
      enum:
        - pending
        - resolved
        - expired
        - timed_out
      title: AgentInterruptStatus
    QuestionBody:
      properties:
        questions:
          items:
            $ref: '#/components/schemas/QuestionItem'
          type: array
          title: Questions
          description: The questions asked in this call, in display order.
      type: object
      required:
        - questions
      title: QuestionBody
      description: >-
        The `body` of an ask_question item: the batch of questions the agent
        asked in one call.
    AnswerItem:
      properties:
        answer_text:
          type: string
          maxLength: 4000
          minLength: 1
          title: Answer Text
          description: >-
            The submitted answer. For a picked option this equals that option's
            `label`; for a free-typed answer it is the user's own text.
        is_custom:
          type: boolean
          title: Is Custom
          description: >-
            `true` when the user typed their own answer; `false` when
            `answer_text` matches one of the question's option labels.
      type: object
      required:
        - answer_text
        - is_custom
      title: AnswerItem
      description: >-
        One answer, positionally aligned to the question at the same index in
        `body.questions`.
    QuestionStatus:
      type: string
      enum:
        - pending_answer
        - answered
        - auto_answered
        - expired
        - declined
      title: QuestionStatus
    QuestionItem:
      properties:
        question:
          type: string
          title: Question
          description: The question text to show the user.
        options:
          items:
            $ref: '#/components/schemas/QuestionOption'
          type: array
          title: Options
          description: >-
            Suggested answers to render as pickable choices; may be empty. The
            user can always type a custom answer regardless of what is listed
            here.
      type: object
      required:
        - question
      title: QuestionItem
      description: >-
        One question in the batch, positionally aligned to the answer at the
        same index in `answer`.
    QuestionOption:
      properties:
        label:
          type: string
          title: Label
          description: >-
            The pickable answer, shown as the option's heading. When the user
            picks this option, this exact string comes back as the matching
            answer's `answer_text` with `is_custom=false`.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: >-
            Optional display-only sub-text under the label explaining the option
            or its trade-off; `null` when the label already speaks for itself.
      type: object
      required:
        - label
      title: QuestionOption
      description: >-
        One suggested answer shown under a question. The user may pick it or
        type their own instead.

````