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

# Create a new task

> Creates a new task. The task will be assigned to the user associated with your API key.



## OpenAPI

````yaml /openapi.json post /tasks
openapi: 3.1.1
info:
  title: Heffl Public API (Legacy v1)
  version: 1.0.0
  description: >-
    Legacy Heffl REST API v1. Maintained for existing integrations. For new
    projects, use API v2 at https://docs.heffl.com/api-v2/introduction.
  contact:
    name: Heffl Support
    url: https://heffl.com/support
    email: support@heffl.com
servers:
  - url: https://api.heffl.com/api/v1
    description: Production API Server
security:
  - ApiKeyAuth: []
paths:
  /tasks:
    post:
      tags:
        - Tasks
      summary: Create a new task
      description: >-
        Creates a new task. The task will be assigned to the user associated
        with your API key.
      operationId: tasks.create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  description: Task title
                description:
                  type: string
                  description: Task description
                type:
                  enum:
                    - call
                    - todo
                    - meeting
                  default: todo
                  description: Task type
                status:
                  enum:
                    - OPEN
                    - IN_PROGRESS
                    - ON_HOLD
                    - COMPLETED
                    - CANCELLED
                  default: OPEN
                  description: Task status
                dueDate:
                  type: string
                  format: date-time
                  x-native-type: date
                  description: Due date for the task
                startDate:
                  type: string
                  format: date-time
                  x-native-type: date
                  description: Start date for the task
                priority:
                  enum:
                    - LOW
                    - MEDIUM
                    - HIGH
                  description: Task priority
                entity:
                  enum:
                    - leads
                    - deals
                    - clients
                  description: Entity type to associate the task with
                entityId:
                  type: string
                  description: Public ID of the entity to associate the task with
              required:
                - title
              additionalProperties: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Task public ID
                  number:
                    type: string
                    description: Auto-generated task number
                  title:
                    type: string
                    description: Task title
                  description:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Task description
                  status:
                    type: string
                    description: Task status
                  type:
                    type: string
                    description: Task type
                  priority:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Task priority
                  dueDate:
                    anyOf:
                      - type: string
                        format: date-time
                        x-native-type: date
                      - type: 'null'
                    description: Due date
                  startDate:
                    anyOf:
                      - type: string
                        format: date-time
                        x-native-type: date
                      - type: 'null'
                    description: Start date
                  createdAt:
                    type: string
                    format: date-time
                    x-native-type: date
                    description: When the task was created
                required:
                  - id
                  - number
                  - title
                  - status
                  - type
                  - createdAt
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Get yours at
        app.heffl.com/settings/developers

````