---
title: "List Deals"
method: GET
path: "/deals"
tags: ["Deals"]
---

# List Deals

`GET /deals`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/deals`
- Auth: HTTP bearer

List all deals org-wide with optional filters and pagination.

## Query parameters

- `page` integer: Page number
- `limit` integer: Items per page
- `stage_id` string, nullable: Filter by stage ID
- `pipeline_id` string, nullable: Filter by pipeline ID
- `search` string, nullable: Search by deal name
- `owner_id` string, nullable: Filter by owner ID
- `owner_email` string, nullable: Filter by owner email
- `outcome` 'won' | 'lost' | 'open', nullable: Filter by deal outcome. A deal is won, lost, or open - exactly one. Prefer this over is_closed_won: the boolean's false branch means 'not won', which returns open AND unclassified deals alongside lost ones, and is the wrong cohort for closed-lost re-engagement.
- `is_closed_won` boolean, nullable: LEGACY - prefer outcome=. Retained for backwards compatibility with existing consumers. true means won; false means NOT won (open, lost and unclassified deals), which is rarely what a caller intends.
- `last_activity_before` string, date-time, nullable: Only deals last touched before this timestamp
- `stale_before` string, date-time, nullable: Deals last touched before this timestamp OR never touched at all. Union of last_activity_before and the no-activity cohort - use this for 'my stale deals' (last_activity_before alone excludes deals with no recorded activity, since NULL is never earlier-than).
- `has_activity` boolean, nullable: Filter by whether the deal has recorded activity
- `has_contact` boolean, nullable: Filter by whether the deal has a route to any contact. false returns the orphaned-deal cohort: no cb_deal_contacts row AND no live primary contact (a primary_contact_id pointing at a soft-deleted or merged-away contact counts as no route). Same definition the Data Quality panel counts, so the two can never disagree.
- `close_after` string, date-time, nullable: Only deals whose close_date is on/after this timestamp (inclusive lower bound). Pair with close_before for a period window, and with outcome=won for 'deals we closed-won in this period'. A period count needs BOTH a lower bound and the outcome join: close_before alone sums the entire deal history into every period. Deals with a NULL close_date are excluded (a deal with no close date is not closing in any window). A naive timestamp is treated as UTC.
- `close_before` string, date-time, nullable: Only deals whose close_date is strictly before this timestamp (exclusive upper bound). The window is half-open [close_after, close_before) so adjacent periods never double-count a deal that closes exactly on a boundary. A naive timestamp is treated as UTC (the close_date column is timestamp without time zone).

## Headers

- `Authorization` string, nullable
- `X-Target-Org-Id` string, nullable

## Response `200`

Successful Response

- ApiResponseListDealResponse
  - `data` DealResponse[], required
    - `revision` integer, nullable: CRM revision after a conditional update
    - `id` string, nullable
    - `name` string, nullable
    - `description` string, nullable
    - `amount` number, nullable
    - `currency` string, nullable
    - `stage_id` string, nullable
    - `stage_name` string, nullable
    - `pipeline_id` string, nullable
    - `pipeline_name` string, nullable
    - `company_id` unknown
    - `owner_id` string, nullable
    - `owner_name` string, nullable
    - `owner_email` string, nullable
    - `last_activity_at` string, nullable
    - `close_date` string, nullable
    - `created_at` string, nullable
    - `updated_at` string, nullable
    - `closed_lost_reason` string, nullable
    - `contact_count` integer
    - `primary_contact` ContactBrief: Lightweight contact summary embedded in deal responses. `id` is the canonical `mashup_contact_id` (BigInt), matching how contacts are addressed everywhere else in the public API (g8_search_contacts, g8_lookup_person, etc.). `role` is the contact's role within THIS deal (champion / decision_maker / influencer / blocker / coach / end_user) and is null when no role was set.
      - `id` integer, required
      - `name` string, nullable
      - `email` string, nullable
      - `title` string, nullable
      - `role` string, nullable
    - `contacts` ContactBrief[], nullable
      - `id` integer, required
      - `name` string, nullable
      - `email` string, nullable
      - `title` string, nullable
      - `role` string, nullable
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/2e7cfa0ca921?raw)
