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

# Update a task

> Updates an existing task. Only provided fields will be updated. Custom field values use `cf_*` keys — see the [Custom fields](/api-v2/custom-fields) guide.



## OpenAPI

````yaml /openapi.v2.json patch /tasks/{id}
openapi: 3.1.1
info:
  title: Heffl API v2 (Beta)
  version: 2.0.0
  description: >-
    Heffl REST API v2 (beta) — resource-oriented endpoints with consistent
    response envelopes. Endpoints, schemas, and behavior may change until GA.
    See Agent workflows and ID prefixes guides for automation.
  contact:
    name: Heffl Support
    url: https://heffl.com/support
    email: support@heffl.com
servers:
  - url: https://api.heffl.com/api/v2
    description: Production API Server
security:
  - ApiKeyAuth: []
paths:
  /tasks/{id}:
    patch:
      tags:
        - Objects
      summary: Update a task
      description: >-
        Updates an existing task. Only provided fields will be updated. Custom
        field values use `cf_*` keys — see the [Custom
        fields](/api-v2/custom-fields) guide.
      operationId: objects.tasks.update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Task ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskUpdateInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '400':
          description: Validation error or bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '403':
          description: Insufficient permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
components:
  schemas:
    TaskUpdateInput:
      type: object
      properties:
        title:
          type: string
          description: Task title
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Task description
        status:
          type: string
          enum:
            - OPEN
            - IN_PROGRESS
            - ON_HOLD
            - COMPLETED
            - CANCELLED
          description: Task status
        type:
          type: string
          enum:
            - call
            - todo
            - meeting
          description: Task type
        priority:
          anyOf:
            - type: string
              enum:
                - LOW
                - MEDIUM
                - HIGH
            - type: 'null'
          description: Task priority
        startDate:
          type: string
          format: date-time
          description: Start date
        dueDate:
          type: string
          format: date-time
          description: Due date
        showTime:
          type: boolean
          description: Whether to show time on the due date
        durationMinutes:
          type: number
          minimum: 0
          description: Duration in minutes
        assigneeIds:
          type: array
          items:
            type: string
          description: Assignee user IDs
        tagIds:
          type: array
          items:
            type: string
          description: Tag IDs
        entity:
          type: string
          enum:
            - projects
            - leads
            - deals
          description: Entity type to link the task to
        entityId:
          anyOf:
            - type: string
            - type: 'null'
          description: Entity ID to link the task to (required when entity is provided)
      additionalProperties:
        description: >-
          Custom field values using cf_* keys. Only documented fields and cf_*
          keys are accepted.
    Task:
      type: object
      properties:
        id:
          type: string
          description: Task 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
          enum:
            - OPEN
            - IN_PROGRESS
            - ON_HOLD
            - COMPLETED
            - CANCELLED
          description: Task status
        type:
          type: string
          enum:
            - call
            - todo
            - meeting
          description: Task type
        priority:
          anyOf:
            - type: string
              enum:
                - LOW
                - MEDIUM
                - HIGH
            - type: 'null'
          description: Task priority
        dueDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Due date
        startDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Start date
        showTime:
          type: boolean
          description: Whether to show time on the due date
        durationMinutes:
          anyOf:
            - type: number
            - type: 'null'
          description: Duration in minutes
        completedOn:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: When the task was completed
        entity:
          anyOf:
            - type: string
              enum:
                - projects
                - leads
                - deals
            - type: 'null'
          description: Linked entity type
        entityId:
          anyOf:
            - type: string
            - type: 'null'
          description: Linked entity ID
        projectId:
          anyOf:
            - type: string
            - type: 'null'
          description: Linked project ID
        leadId:
          anyOf:
            - type: string
            - type: 'null'
          description: Linked lead ID
        dealId:
          anyOf:
            - type: string
            - type: 'null'
          description: Linked deal ID
        clientId:
          anyOf:
            - type: string
            - type: 'null'
          description: Linked client ID
        contactId:
          anyOf:
            - type: string
            - type: 'null'
          description: Linked contact ID
        assigneeIds:
          type: array
          items:
            type: string
          description: Assignee user IDs
        tagIds:
          type: array
          items:
            type: string
          description: Tag IDs
        createdById:
          anyOf:
            - type: string
            - type: 'null'
          description: Creator user ID
        createdByName:
          anyOf:
            - type: string
            - type: 'null'
          description: Creator name
        createdAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: When the task was created
        updatedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: When the task was last updated
      required:
        - id
        - number
        - title
        - status
        - type
        - showTime
        - assigneeIds
        - tagIds
      additionalProperties:
        description: >-
          Custom field values as top-level cf_* keys (for example
          cf_follow_up_type). There is no customFields wrapper.
    V2ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Get yours at
        app.heffl.com/settings/developers

````