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

> Creates a new deal in your CRM pipeline.



## OpenAPI

````yaml /openapi.json post /deals
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:
    post:
      tags:
        - Deals
      summary: Create a new deal
      description: Creates a new deal in your CRM pipeline.
      operationId: deals.create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  description: Deal title
                pipelineId:
                  type: string
                  description: Pipeline public ID
                stageId:
                  type: string
                  description: Pipeline stage public ID
                clientId:
                  type: string
                  description: Client public ID (required)
                leadId:
                  type: string
                  description: Lead public ID
                sourceId:
                  type: string
                  description: Deal source public ID
                price:
                  type: number
                  description: Deal value/price
                expectedCloseDate:
                  type: string
                  format: date-time
                  x-native-type: date
                  description: Expected close date
                priority:
                  enum:
                    - LOW
                    - MEDIUM
                    - HIGH
                  description: Deal priority
              required:
                - title
                - pipelineId
                - stageId
                - clientId
              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

````