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

# Update Task by ID

> Update mutable fields for a task by its unique ID.



## OpenAPI

````yaml https://agentex.dev-sgp.scale.com/openapi.json put /tasks/{task_id}
openapi: 3.1.0
info:
  title: Agentex API
  version: 0.1.0
servers: []
security: []
paths:
  /tasks/{task_id}:
    put:
      tags:
        - Tasks
      summary: Update Task by ID
      description: Update mutable fields for a task by its unique ID.
      operationId: update_task_tasks__task_id__put
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTaskRequest'
      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:
    UpdateTaskRequest:
      properties:
        task_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: If provided, replaces task_metadata with this value
        merge_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: >-
            Optional shallow-merge patch applied to the task's params column.
            Top-level keys overwrite; pass full nested objects to change
            subfields.
      type: object
      title: UpdateTaskRequest
    Task:
      properties:
        id:
          type: string
          title: Unique Task ID
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Unique name of the task
        status:
          anyOf:
            - $ref: '#/components/schemas/TaskStatus'
            - type: 'null'
          title: The current status of the task
        status_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: The reason for the current task status
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The timestamp when the task was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The timestamp when the task was last updated
        cleaned_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: >-
            The timestamp when the task's content was cleaned for retention
            compliance; null when active
        params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task parameters
        task_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task metadata
      type: object
      required:
        - id
      title: Task
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskStatus:
      type: string
      enum:
        - CANCELED
        - COMPLETED
        - FAILED
        - RUNNING
        - TERMINATED
        - TIMED_OUT
        - DELETED
      title: TaskStatus
    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

````