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

# Get a Deal

The richest read in this API — a single RPC (`rpc_get_deal_detail`) assembles the deal plus everything the deal-detail page and every AI generator on this router need, in one round trip.

### Auth

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

### The deal object

Most deals endpoints return or embed this `deals` table row shape. Rather than repeat it on every page, here it is once — other pages link back to this section.

| Field                                                      | Type                                               | Notes                                                                                                                                  |
| ---------------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                                                       | `string` (uuid)                                    | Primary key.                                                                                                                           |
| `org_id`                                                   | `string` (uuid)                                    | Owning organization.                                                                                                                   |
| `name`                                                     | `string`                                           | Deal name.                                                                                                                             |
| `account_id`                                               | `string \| null`                                   | Linked account (company).                                                                                                              |
| `owner_id`                                                 | `string \| null`                                   | Logto user id of the deal owner.                                                                                                       |
| `stage_id`                                                 | `string \| null`                                   | Current pipeline stage.                                                                                                                |
| `value`                                                    | `number \| null`                                   | Deal value in `currency`.                                                                                                              |
| `currency`                                                 | `string`                                           | ISO 4217 code, default `USD`.                                                                                                          |
| `close_date`                                               | `string \| null`                                   | Rep-entered expected close date (`YYYY-MM-DD`) — optional, never AI-derived.                                                           |
| `claimed_close_date`                                       | `string \| null`                                   | Snapshot of a previously claimed close date (forecast bookkeeping).                                                                    |
| `won_at` / `lost_at`                                       | `string \| null`                                   | Timestamps set when the deal closes into a Won/Lost stage.                                                                             |
| `lost_reason`                                              | `string \| null`                                   | Free-text loss reason.                                                                                                                 |
| `health_score`                                             | `integer \| null`                                  | Denormalized copy of the latest health snapshot's score (0–100).                                                                       |
| `health_last_computed_at`                                  | `string \| null`                                   | Timestamp of the last health computation.                                                                                              |
| `forecast_confidence`                                      | `string \| null`                                   | One of the sales-forecast categories (`commit`, `best_case`, `upside`, `pipeline`, `closed`, `omitted`) — not a high/medium/low scale. |
| `engagement_velocity`                                      | `string \| null`                                   | Free-text/enum velocity signal.                                                                                                        |
| `last_activity_at`                                         | `string \| null`                                   | Timestamp of the most recent linked activity.                                                                                          |
| `tags`                                                     | `string[]`                                         | Tag names (see [Tags](/concepts/tags)); not foreign keys.                                                                              |
| `custom_fields`                                            | `object`                                           | Arbitrary org-defined key/value data.                                                                                                  |
| `created_by` / `created_at` / `updated_at`                 |                                                    | Standard audit columns.                                                                                                                |
| `parent_deal_id`                                           | `string \| null`                                   | Parent deal, for renewal/expansion deals.                                                                                              |
| `source`                                                   | `string \| null`                                   | Free-text origin.                                                                                                                      |
| `actual_close`                                             | `string \| null`                                   | Actual close date.                                                                                                                     |
| `close_reason` / `close_notes`                             | `string \| null`                                   | Recorded when closing.                                                                                                                 |
| `champion_id`                                              | `string \| null`                                   | Contact id of the internal champion.                                                                                                   |
| `notes`                                                    | `string \| null`                                   | Free-text notes.                                                                                                                       |
| `win_probability`                                          | `integer \| null`                                  | 0–100.                                                                                                                                 |
| `latest_brief`                                             | `object \| null`                                   | Cached copy of the most recent AI deal brief — see [Generate a Deal Brief](/api-reference/deals/generate-brief).                       |
| `archived_at`                                              | `string \| null`                                   | Soft-delete timestamp; [List Deals](/api-reference/deals/list-deals) always excludes archived rows.                                    |
| `competitors_detected_at` / `competitors_detection_source` |                                                    | Set by competitor detection — see [Detect Competitors](/api-reference/deals/detect-competitors).                                       |
| `geo_scope`                                                | `"local" \| "regional" \| "international" \| null` | Deal's geographic scope.                                                                                                               |

### Response

All [deal object](#the-deal-object) fields, plus:

| Field                      | Type             | Description                                                                                                                                                                                                                                     |
| -------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `account`                  | `object \| null` | `{id, name, domain, industry, size_range}`.                                                                                                                                                                                                     |
| `stage`                    | `object \| null` | `{id, name, color, position, pct_width, is_won, is_lost, is_closed, probability, is_hidden}` — the current stage.                                                                                                                               |
| `stages`                   | array            | Every **visible** stage ordered by `position`, *plus* the deal's current stage even if it happens to be hidden.                                                                                                                                 |
| `contacts`                 | array            | Every linked contact: `{contact_id, id, first_name, last_name, name, title, email, role, is_champion, last_touch, last_activity_date}`. `last_touch`/`last_activity_date` are identical (max activity timestamp for that contact on this deal). |
| `health`                   | `object \| null` | Latest health snapshot: `{score, trend, data_points, snapshot_at, factors: [{factor_name, name, score, max_score, status, evidence}]}`, or `null` if never computed. See [Refresh Health Score](/api-reference/deals/refresh-health).           |
| `brief`                    | `object \| null` | The deal's `latest_brief` column if set, else the most recent `deal_briefs` row reshaped to `{id, summary_text, summary, risks, opportunities, strategy_text, strategy, model_used, generated_at}`.                                             |
| `tasks`                    | array            | **Open (incomplete) tasks only**: `{id, text, due_date, priority, assignee_id, source, is_completed, created_at}`, ordered by priority then due date.                                                                                           |
| `competitors`              | array            | `{id, name, competitor_name, threat_level, notes}` — from `deal_competitors`.                                                                                                                                                                   |
| `latest_competitive_brief` | `object \| null` | `{id, payload, generated_at, source}` — the newest competitive-intelligence brief, if any.                                                                                                                                                      |
| `activities`               | array            | The 20 most recent activities: `{id, type, summary, subject, body, direction, occurred_at, created_at, owner_id, contact_id, contact_name}`.                                                                                                    |

### Errors

| Status | Cause                             |
| ------ | --------------------------------- |
| `404`  | No deal with that id in this org. |


## OpenAPI

````yaml GET /deals/{deal_id}
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/{deal_id}:
    get:
      tags:
        - Deals
      summary: Get Deal Detail
      operationId: get_deal_detail_deals__deal_id__get
      parameters:
        - name: deal_id
          in: path
          required: true
          schema:
            type: string
            description: The deal's id.
            title: Deal Id
          description: The deal's id.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    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

````