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

> Updates an existing deal. Only provided fields will be updated.



## OpenAPI

````yaml /openapi.json patch /deals/{id}
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:
  /deals/{id}:
    patch:
      tags:
        - Deals
      summary: Update a deal
      description: Updates an existing deal. Only provided fields will be updated.
      operationId: deals.update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: Deal public ID
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: Deal title
                price:
                  type: number
                  description: Deal value/price
                stageId:
                  type: string
                  description: Pipeline stage public ID
                status:
                  enum:
                    - ACTIVE
                    - WON
                    - LOST
                  description: Deal status (ACTIVE, WON, LOST)
                priority:
                  enum:
                    - LOW
                    - MEDIUM
                    - HIGH
                  description: Deal priority
                sourceId:
                  type: string
                  description: Deal source public ID
                expectedCloseDate:
                  type: string
                  format: date-time
                  x-native-type: date
                  description: Expected close date
              required: []
              additionalProperties: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Deal public ID
                  number:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Auto-generated deal number
                  title:
                    type: string
                    description: Deal title
                  price:
                    anyOf:
                      - type: number
                      - type: 'null'
                    description: Deal price/value
                  status:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Deal status
                  priority:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Deal priority
                  expectedCloseDate:
                    anyOf:
                      - type: string
                        format: date-time
                        x-native-type: date
                      - type: 'null'
                    description: Expected close date
                  clientId:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Client public ID
                  pipelineId:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Pipeline public ID
                  stageId:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Pipeline stage public ID
                  sourceId:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Deal source public ID
                  leadId:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Lead public ID
                  createdAt:
                    type: string
                    format: date-time
                    x-native-type: date
                    description: When the deal was created
                  customFields:
                    anyOf:
                      - type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      - type: 'null'
                    description: Custom field values
                required:
                  - id
                  - title
                  - 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

````