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

# Create a Deal

The deal's `owner_id` is always the calling user (`token.sub`) — there's no way to set a different owner at creation via this endpoint.

Omit `stage_id` and the deal is created with **no stage** (`stage_id: null`) — there's no fallback to the org's first stage. An unstaged deal still shows up in [List Deals](/api-reference/deals/list-deals), but not in any column of the [board](/api-reference/deals/deals-board), which is assembled per stage. Pass `stage_id`, or set it later with [Update a Deal](/api-reference/deals/update-deal).

Five body fields are **accepted but not persisted** by this endpoint — the handler forwards only `name`, `account_id`, `value`, `stage_id`, `close_date`, `currency`, `geo_scope` and the owner, so the rest are silently dropped:

| Field            | How to set it instead                                                  |
| ---------------- | ---------------------------------------------------------------------- |
| `source`         | [Update a Deal](/api-reference/deals/update-deal)                      |
| `champion_id`    | [Update a Deal](/api-reference/deals/update-deal)                      |
| `notes`          | [Update a Deal](/api-reference/deals/update-deal)                      |
| `competitors`    | [Detect Competitors](/api-reference/deals/detect-competitors)          |
| `parent_deal_id` | No API path today — `PATCH /deals/{deal_id}` doesn't accept it either. |

### Auth

Requires a CRM manage [scope](/authentication#scopes) and an active organization on the token. Any `*:manage` scope qualifies — in practice `contacts:manage`, `deals:manage`, `companies:manage`, or `activities:manage`.

### Side effects

* Emits a `deal_created` notification event (best-effort, via the org's Temporal actor workflow).
* Records a `deal_created` product-analytics event.

### Response

`201` with `{"id": "<new deal id>"}` — **not** the full deal row. Call [Get a Deal](/api-reference/deals/get-deal) to fetch it.


## OpenAPI

````yaml POST /deals
openapi: 3.1.0
info:
  title: anycrm-api
  version: 0.0.1
servers: []
security: []
tags:
  - name: Customer Intelligence
    description: >-
      Company research and ICP-fit scoring — create a research run, track its
      progress, and read back scored companies as leads.
  - name: Outreach
    description: >-
      The cold-email management console — domains, mailboxes, and campaigns — as
      a thin control plane over the SalesForge stack.
  - name: AnyCard
    description: >-
      Authenticated CRUD for AnyCard, the org's digital business-card /
      lead-capture product.
  - name: AnyCard Events
    description: >-
      Event-attribution analytics for AnyCard — which captured leads converted,
      broken down by source, owner, and deal.
  - name: AnyCard Share Links
    description: >-
      Unauthenticated endpoints reached by anyone who scans a QR code or opens a
      shared AnyCard link.
  - name: AI
    description: >-
      A streaming (SSE) AI chat endpoint with account-commit actions it can take
      on the caller's behalf.
  - name: Analytics Assistant
    description: >-
      The natural-language analytics assistant — a guarded text-to-SQL loop
      (SSE) that answers ad-hoc questions over the org's CRM data as a
      least-privilege, read-only database role.
  - name: Account Readiness
    description: >-
      Account Readiness Profiles — AI-scored signals on whether an account is
      ready for outreach or expansion, computed via a Temporal workflow.
  - name: Integrations
    description: >-
      Pipedream Connect — issuing connect tokens and managing the org's
      connected third-party accounts.
  - name: Feedback
    description: >-
      User-submitted platform feedback (bug reports, feature requests) — global,
      not scoped to one organization.
  - name: Public Media
    description: >-
      Unauthenticated image reads for publicly-embeddable assets (card photos,
      inline email images) — allowlisted by key shape; everything else in the
      storage bucket stays private.
  - name: Service Health
    description: Service liveness.
paths:
  /deals:
    post:
      tags:
        - Deals
      summary: Create Deal
      operationId: create_deal_deals_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DealCreateBody'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    DealCreateBody:
      properties:
        name:
          type: string
          minLength: 1
          title: Name
          description: Deal name.
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
          description: Account (company) to link the deal to.
        value:
          anyOf:
            - type: number
            - type: 'null'
          title: Value
          description: Deal value in `currency`.
        stage_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Stage Id
          description: >-
            Initial pipeline stage. Omit it and the deal is created with no
            stage (`stage_id: null`) — there is no fallback to the org's first
            stage — so it won't appear in any board column until a stage is set.
        close_date:
          anyOf:
            - type: string
            - type: 'null'
          title: Close Date
          description: Expected close date, `YYYY-MM-DD`.
        currency:
          type: string
          title: Currency
          description: ISO 4217 currency code for `value`.
          default: USD
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
          description: >-
            Free-text origin of the deal (e.g. `inbound`, `referral`). Accepted
            but not persisted by this endpoint — the create handler never passes
            it through; set it with PATCH /deals/{deal_id} after creating the
            deal.
        champion_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Champion Id
          description: >-
            Contact id of the internal champion. Accepted but not persisted by
            this endpoint — the create handler never passes it through; set it
            with PATCH /deals/{deal_id} after creating the deal.
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: >-
            Free-text notes. Accepted but not persisted by this endpoint — the
            create handler never passes it through; set it with PATCH
            /deals/{deal_id} after creating the deal.
        parent_deal_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Deal Id
          description: >-
            Parent deal id, for renewal/expansion deals linked to a prior one.
            Accepted but not persisted by this endpoint — the create handler
            never passes it through, and PATCH /deals/{deal_id} does not accept
            it either, so there is currently no way to set it through the API.
        competitors:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Competitors
          description: >-
            Accepted but not persisted by this endpoint — the create handler
            never passes it through; use POST
            /deals/{deal_id}/competitors/detect instead.
        geo_scope:
          anyOf:
            - type: string
              enum:
                - local
                - regional
                - international
            - type: 'null'
          title: Geo Scope
          description: Deal's geographic scope.
      type: object
      required:
        - name
      title: DealCreateBody
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````