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

# Assign collaborators to a task

> Sets the list of collaborators assigned to a task. The operation is a **sync** — the array provided represents the desired final state. Users present in the array but not yet assigned will be added; users currently assigned but absent from the array will be removed.



## OpenAPI

````yaml /api-reference/openapi.json post /tasks/{task_id}/collaborators
openapi: 3.1.0
info:
  title: COR API
  description: >-
    The COR API lets you integrate with projectcor.com applications using simple
    HTTP methods, in either XML or JSON formats, making this an ideal API for
    developing integrations with other softwares, external clients or mobile
    applications
  version: 1.0.0
servers:
  - url: https://api.projectcor.com/v1
    description: Production server
security:
  - bearerAuth: []
paths:
  /tasks/{task_id}/collaborators:
    post:
      tags:
        - Tasks
      summary: Assign collaborators to a task
      description: >-
        Sets the list of collaborators assigned to a task. The operation is a
        **sync** — the array provided represents the desired final state. Users
        present in the array but not yet assigned will be added; users currently
        assigned but absent from the array will be removed.
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: integer
          description: The ID of the task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskCollaboratorsInput'
      responses:
        '200':
          description: Returns the updated array of collaborators
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TaskCollaborator'
        '400':
          description: Invalid task ID or invalid users array
        '417':
          description: >-
            Validation error (task not found in company, or one or more user IDs
            are invalid)
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    message:
                      type: string
                      example: exists validation failed on task_id
components:
  schemas:
    TaskCollaboratorsInput:
      type: object
      required:
        - collaborators
      properties:
        collaborators:
          type: array
          items:
            type: integer
          description: >-
            Array of user IDs that should be assigned to the task. Pass an empty
            array [] to remove all collaborators.
        reasignEstimate:
          type: boolean
          default: false
          description: >-
            If true, redistributes the estimated hours evenly among the new
            collaborators.
    TaskCollaborator:
      type: object
      properties:
        id:
          type: integer
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
          format: email
        picture:
          type: string
        user_position_id:
          type: integer
          nullable: true
        role_id:
          type: integer
        userPosition:
          type: object
          nullable: true
          properties:
            id:
              type: integer
            name:
              type: string
        pivot:
          type: object
          properties:
            user_id:
              type: integer
            task_log_id:
              type: integer
            created_at:
              type: string
            estimated_by_user:
              type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````