> ## 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.

# Create Task

> Create a new task in the Project

<Note>
  Creates a new task within the project specified by the provided `projectId`.
  Upon successful creation of the task, notifications are sent to the users
  listed in the `taskUsers`.
</Note>


## OpenAPI

````yaml POST /task
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:
    post:
      description: Create a new task in the Project
      requestBody:
        description: Task to add to the project
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewTask'
        required: true
      responses:
        '200':
          description: task response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getTask'
        '400':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
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
    getTask:
      allOf:
        - $ref: '#/components/schemas/getTasks'
        - type: object
          properties:
            projectId:
              description: The ID of the project.
              type: string
            groupId:
              description: The ID of the group.
              type: string
            group:
              description: The Group of the task.
              type: string
            description:
              description: Description of the task.
              type: string
            status:
              description: The Status of the task.
              type: boolean
            subscribers:
              description: List of Subscribers who Subscribe the task.
              type: array
              items:
                type: string
            dueDate:
              description: The due date of the project.
              type: string
            priority:
              description: Select priority of the task.
              type: string
            estimateTime:
              description: Estimated time required for the task (hh).
              type: integer
            milestoneId:
              description: The ID of the task milestone.
              type: integer
            taskUsers:
              description: List of task users.
              type: array
              items:
                $ref: '#/components/schemas/TaskUsers'
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
    getTasks:
      required:
        - name
      type: object
      properties:
        taskId:
          description: The ID of the task
          type: string
        taskName:
          description: The Name of the task
          type: string
    TaskUsers:
      allOf:
        - type: object
          properties:
            taskUserId:
              description: The ID of the task user.
              type: string
  securitySchemes:
    bearerAuth:
      type: apiKey
      name: apiKey
      in: header

````