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

# Create deal

> Create a new deal with optional owner, plan, value, funnel, stage, tags, status, closed reason, closed reason detail, and source. Automatically creates activity and deal transition records.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /deals
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /deals:
    post:
      tags:
        - deals
      summary: Create deal
      description: >-
        Create a new deal with optional owner, plan, value, funnel, stage, tags,
        status, closed reason, closed reason detail, and source. Automatically
        creates activity and deal transition records.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
        description: Deal creation data (name and client required)
        required: true
      responses:
        '200':
          description: >-
            Created deal, with a warning when it saved but its stage's project
            didn't launch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_deals.dealWithWarning'
        '400':
          description: Bad request - invalid request body, client ID, or funnel ID
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '403':
          description: Forbidden - no permission to create deals for client
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_deals.dealWithWarning:
      type: object
      properties:
        _id:
          type: string
        client:
          type: string
        close_date:
          type: string
        close_probability:
          description: Override values
          type: number
        closed_at:
          description: >-
            Set when the deal status changes to Won/Lost/Abandoned; cleared when
            reopened
          type: string
        closed_reason:
          description: >-
            Deal status is one of: "Open", "Won", "Lost", "Abandoned"

            Set when the deal is Lost or Abandoned; cleared when reopened or
            marked Won
          type: string
        closed_reason_detail:
          type: string
        created_at:
          type: string
        deleted_at:
          type: string
        ein:
          type: string
        funnel:
          type: string
        last_activity:
          type: string
        n_messages:
          type: integer
        n_tasks:
          type: integer
        name:
          type: string
        owner:
          type: string
        plan:
          type: string
        plan_number:
          type: string
        proposal_count:
          type: integer
        proposals:
          type: array
          items:
            $ref: '#/components/schemas/types.LinkedProposalSummary'
        pulse:
          description: For returning
          type: integer
        source:
          type: string
        stage:
          type: string
        status:
          type: string
        tags:
          type: array
          items:
            type: string
        team:
          type: string
        unread:
          type: boolean
        value:
          type: number
        warning:
          description: >-
            Set when the deal saved but its stage's project didn't launch
            (ENG-9765).
          type: string
    types.LinkedProposalSummary:
      type: object
      properties:
        _id:
          type: string
        created_at:
          type: string
        name:
          type: string
        plan_type:
          type: string
        progress:
          type: number
        status:
          type: string
        updated_at:
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.