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

# Update Task

> Update an existing task.



## OpenAPI

````yaml PUT /task/updateTask/{taskId}
openapi: 3.0.1
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.teamcamp.app/v1.0/
security:
  - bearerAuth: []
paths:
  /task/updateTask/{taskId}:
    put:
      description: Update an existing task.
      parameters:
        - name: taskId
          in: path
          required: true
          description: The unique identifier of the task to update.
          schema:
            type: string
            minLength: 10
      requestBody:
        description: Fields to update in the task.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewTask'
        required: true
      responses:
        '200':
          description: Successful task update.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskUpdateResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      servers:
        - url: https://back.teamcamp.app/api/v1
components:
  schemas:
    NewTask:
      allOf:
        - required:
            - projectId
          type: object
          properties:
            projectId:
              description: The ID of the project to which the task belongs.
              type: string
            name:
              description: The Name of the task.
              type: string
            description:
              description: The Description of the task, if applicable.
              type: string
            priority:
              description: |-
                Priority of the task. Valid values are:
                0 = No Priority
                1 = Urgent
                2 = High
                3 = Medium
                4 = Low
              type: integer
              enum:
                - 0
                - 1
                - 2
                - 3
                - 4
            dueDate:
              description: The due date of the task, We expect yyyy-MM-dd.
              type: string
              format: date
            groupId:
              description: The ID of the task group.
              type: string
            taskUsers:
              description: An array of user IDs associated with the task [ Task Assignee ].
              type: array
              items:
                type: string
            files:
              description: >-
                An array of files associated with the task. Each file includes
                properties such as file type, href, name, and size.
              type: array
              items:
                type: object
                properties:
                  fileType:
                    description: The File Type of the file.
                    type: string
                  href:
                    description: The Href of the file.
                    type: string
                  name:
                    description: The Name of the file.
                    type: string
                  size:
                    description: The Size of the file (00.00 KB/MB/GB).
                    type: string
            estimateTime:
              description: Estimated time required for the task (hh), if applicable.
              type: integer
            milestoneId:
              description: The ID of the task's milestone, if applicable.
              type: integer
            statusId:
              description: The ID of the task status.
              type: string
    TaskUpdateResponse:
      type: object
      properties:
        _id:
          type: string
          description: Id of Task
        Name:
          type: string
          description: Name of the Task
        ProjectId:
          type: string
          description: ProjectId of the Task
        Subscribers:
          description: List of Subscribers who Subscribe the task.
          type: array
          items:
            type: string
        GroupId:
          type: string
          nullable: true
          description: The ID of the group.
        Labels:
          type: array
          description: LabelIds of the Task
          items:
            type: string
        TaskUsers:
          type: array
          description: Task users [ Task Assignee ] for this task
          items:
            $ref: '#/components/schemas/TaskUpdateUser'
        Files:
          type: array
          description: Files which are uploaded into this task
          items:
            $ref: '#/components/schemas/TaskUpdateFile'
        Comments:
          type: array
          description: Comments of the Task
          items:
            $ref: '#/components/schemas/TaskUpdateComment'
        CreatedBy:
          type: string
        CreatedTime:
          type: string
          format: date-time
        UpdatedBy:
          type: string
        UpdatedTime:
          type: string
          format: date-time
        Desc:
          type: string
          description: Rich text HTML
        StatusId:
          type: string
        Status:
          type: boolean
        TaskNumber:
          type: integer
        ParentTaskId:
          type: string
        Priority:
          type: integer
        DueDate:
          type: string
          format: date-time
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
    TaskUpdateUser:
      type: object
      properties:
        _id:
          type: string
        CreatedBy:
          type: string
        CreatedTime:
          type: string
          format: date-time
        UpdatedBy:
          type: string
        UpdatedTime:
          type: string
          format: date-time
      required:
        - _id
        - CreatedBy
        - CreatedTime
        - UpdatedBy
        - UpdatedTime
    TaskUpdateFile:
      type: object
      properties:
        file_type:
          type: string
        href:
          type: string
        size:
          type: string
        name:
          type: string
        uploadFileType:
          type: number
    TaskUpdateComment:
      type: object
      properties:
        _id:
          type: string
        IsGithub:
          type: boolean
          nullable: true
        Comment:
          type: string
          nullable: true
        Assignee:
          type: string
          nullable: true
        PreviousPriority:
          type: number
          nullable: true
        Priority:
          type: number
          nullable: true
        Type:
          type: number
        DueDate:
          type: string
          format: date-time
          nullable: true
        PreviousDueDate:
          type: string
          format: date-time
          nullable: true
        Group:
          type: string
          nullable: true
        PreviousGroup:
          type: string
          nullable: true
        CreatedBy:
          type: string
        CreatedTime:
          type: string
          format: date-time
        UpdatedBy:
          type: string
        UpdatedTime:
          type: string
          format: date-time
        Status:
          type: boolean
          nullable: true
        EstimateTime:
          type: number
          nullable: true
        IsArchived:
          type: boolean
          nullable: true
        Reactions:
          type: array
          items:
            $ref: '#/components/schemas/TaskUpdateReaction'
        Audio:
          type: object
          nullable: true
          properties:
            Url:
              type: string
            Duration:
              type: string
        Files:
          type: array
          items:
            $ref: '#/components/schemas/TaskUpdateFile'
        Reply:
          $ref: '#/components/schemas/TaskUpdateReply'
      required:
        - _id
        - Type
        - CreatedTime
        - CreatedBy
        - UpdatedBy
        - UpdatedTime
    TaskUpdateReaction:
      type: object
      properties:
        ReactionType:
          type: string
        UserId:
          type: string
        _id:
          type: string
    TaskUpdateReply:
      type: object
      properties:
        id:
          type: string
        CreatedTime:
          type: string
          format: date-time
        message:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/TaskUpdateFile'
        Sender_id:
          type: string
  securitySchemes:
    bearerAuth:
      type: apiKey
      name: apiKey
      in: header

````