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

# Update Task

> Update an existing task.

Only provided fields are updated. Returns the updated task.

Returns:
    Updated task.

Raises:
    NotFoundError: If task not found.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json patch /agents/tasks/{task_id}
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /agents/tasks/{task_id}:
    patch:
      tags:
        - tasks
      summary: Update Task
      description: |-
        Update an existing task.

        Only provided fields are updated. Returns the updated task.

        Returns:
            Updated task.

        Raises:
            NotFoundError: If task not found.
      operationId: tasks-update_task
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TaskUpdate:
      properties:
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        priority:
          anyOf:
            - type: integer
              maximum: 4
              minimum: 1
            - type: 'null'
          title: Priority
        assigned_to_type_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assigned To Type Id
        assigned_to_instance_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assigned To Instance Id
        assigned_to_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assigned To User Id
        correlation_bucket_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Correlation Bucket Id
        source:
          anyOf:
            - $ref: '#/components/schemas/TaskSource'
            - type: 'null'
      type: object
      title: TaskUpdate
      description: >-
        Request body for updating a task. All fields optional.


        Status changes are not allowed here — use the transition endpoint
        instead.


        Attributes:
            title: Short description of the task.
            description: Detailed description.
            priority: Priority level (1=urgent, 2=high, 3=normal, 4=low).
            assigned_to_type_id: Agent type to assign.
            assigned_to_instance_id: Agent instance to assign.
            assigned_to_user_id: User to assign.
            correlation_bucket_id: Correlation bucket for related events.
            source: How this task was created.
    Task:
      properties:
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        title:
          type: string
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        status:
          $ref: '#/components/schemas/TaskStatus'
          default: backlog
        priority:
          type: integer
          maximum: 4
          minimum: 1
          title: Priority
          default: 3
        assigned_to_type_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assigned To Type Id
        assigned_to_instance_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assigned To Instance Id
        assigned_to_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assigned To User Id
        correlation_bucket_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Correlation Bucket Id
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        source:
          $ref: '#/components/schemas/TaskSource'
          default: manual
      type: object
      required:
        - title
      title: Task
      description: >-
        An agent task representing a unit of work.


        Tasks live inside each organization's SurrealDB namespace — the

        namespace is the organization boundary, so no per-record

        ``organization_id`` field is carried on the row.


        Subtask relationships are modeled as ``has_subtask`` graph edges in

        SurrealDB rather than a flat parent reference. Use
        ``TaskStorageService``

        graph traversal methods to find parents and children.


        Attributes:
            id: SurrealDB record ID (populated by database).
            title: Short description of the task.
            description: Detailed description.
            status: Current task status.
            priority: Priority level (1=urgent, 2=high, 3=normal, 4=low).
            assigned_to_type_id: Agent type assigned to this task.
            assigned_to_instance_id: Agent instance working on this task.
            assigned_to_user_id: User assigned to this task.
            correlation_bucket_id: Correlation bucket for related events.
            created_by: User ID of the creator.
            source: How this task was created.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskSource:
      type: string
      enum:
        - triage
        - conversation
        - manual
      title: TaskSource
      description: Origin of an agent task.
    TaskStatus:
      type: string
      enum:
        - backlog
        - assigned
        - running
        - review
        - done
      title: TaskStatus
      description: Status of an agent task on the board.
    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

````