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

# Create task

> Create a new task



## OpenAPI

````yaml post /v1/customers/{customer_id}/tasks
openapi: 3.0.0
info:
  title: Tasks API
  version: 1.0.0
  description: API for managing tasks and assignments
servers: []
security:
  - bearerAuth: []
tags:
  - name: Tasks
    description: Task management operations
  - name: Task Actions
    description: Task action operations
  - name: Task Assignees
    description: Task assignee operations
paths:
  /v1/customers/{customer_id}/tasks:
    post:
      tags:
        - Tasks
      summary: Create task
      description: Create a new task
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaskRequest'
      responses:
        '201':
          description: Task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/CustomerNotFoundError'
components:
  schemas:
    CreateTaskRequest:
      type: object
      required:
        - title
        - category
        - description
        - weight
      properties:
        title:
          type: string
        category:
          type: string
          enum:
            - sign
            - approve
            - update
            - delete
        description:
          type: string
        is_urgent:
          type: boolean
          default: false
        objects:
          type: array
          items:
            $ref: '#/components/schemas/TaskObject'
        assignees:
          type: array
          items:
            type: string
            format: uuid
        weight:
          type: number
          minimum: 0
          maximum: 1
        metadata:
          type: object
          additionalProperties: true
    Task:
      type: object
      properties:
        id:
          type: string
          format: uuid
        title:
          type: string
        category:
          type: string
          enum:
            - sign
            - approve
            - update
            - delete
        description:
          type: string
        is_urgent:
          type: boolean
        status:
          type: string
          enum:
            - pending
            - in_progress
            - completed
            - canceled
            - declined
        weight:
          type: number
        performed_weight:
          type: number
        customer_id:
          type: string
          format: uuid
        assignees:
          type: array
          items:
            $ref: '#/components/schemas/Assignee'
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
          format: uuid
        metadata:
          type: object
          properties:
            logs:
              type: array
              items:
                type: object
            actions:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
          additionalProperties: true
    TaskObject:
      type: object
      required:
        - type
        - content
      properties:
        type:
          type: string
          enum:
            - document
            - invoice
            - account
        content:
          type: string
    Assignee:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        task_id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - pending
            - in_progress
            - completed
            - declined
        weight:
          type: number
        task_completed:
          type: boolean
        assigned_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
  responses:
    ValidationError:
      description: Invalid input data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: tasks.invalid_task_data
            message: Invalid task data provided
    CustomerNotFoundError:
      description: Customer not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: tasks.customer_not_found
            message: Customer not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````