Leads and deals

List leads and deals

Returns one page of leads and deals, in board order unless `sort` says otherwise. By default the list holds the active deals only; use `recordSet` to see leads or archived records. Query parameters: - `recordSet`: `active` (default) for deals that are not archived, `unclaimed` for unassigned leads, `archived` for archived records, or `all` for everything. - `pipelineId`, `stageId`, `contactId`, `ownerId`: only records in that pipeline or stage, for that contact, or owned by that member. - `phase`: `LEAD` or `DEAL`. - `outcome`: `Open`, `Won` or `Lost`. - `tag`: a tag option id. Only records carrying that tag. - `search`: matches the title ignoring case, or the record number when the term is a whole number. - `page`: page number, starting at 1. Defaults to 1. - `pageSize`: records per page, 1 to 200. Defaults to 25. - `sort`: `rank` (default, board order), `createdAt`, `updatedAt`, `value` or `lastActivityAt`. - `order`: `asc` or `desc`. Defaults to `asc`, and to `desc` when sorting by `lastActivityAt`. - `chain`: `all` (default) for every record you can see, `own` to leave out records shared through your chain, or `chain` for only those. - `createdFrom`, `createdTo`: ISO 8601 date-times. Only records created within the range, both ends included. Leads and deals need the CRM add-on; without it every call returns 403.

GET
/crm/lead-deals

Returns one page of leads and deals, in board order unless sort says otherwise. By default the list holds the active deals only; use recordSet to see leads or archived records.

Query parameters:

  • recordSet: active (default) for deals that are not archived, unclaimed for unassigned leads, archived for archived records, or all for everything.
  • pipelineId, stageId, contactId, ownerId: only records in that pipeline or stage, for that contact, or owned by that member.
  • phase: LEAD or DEAL.
  • outcome: Open, Won or Lost.
  • tag: a tag option id. Only records carrying that tag.
  • search: matches the title ignoring case, or the record number when the term is a whole number.
  • page: page number, starting at 1. Defaults to 1.
  • pageSize: records per page, 1 to 200. Defaults to 25.
  • sort: rank (default, board order), createdAt, updatedAt, value or lastActivityAt.
  • order: asc or desc. Defaults to asc, and to desc when sorting by lastActivityAt.
  • chain: all (default) for every record you can see, own to leave out records shared through your chain, or chain for only those.
  • createdFrom, createdTo: ISO 8601 date-times. Only records created within the range, both ends included.

Leads and deals need the CRM add-on; without it every call returns 403.

Authorization

x-api-key
x-api-key<token>

Company API key, created under Settings > API Keys.

In: header

Query Parameters

pipelineId?string
stageId?string
contactId?string
phase?unknown

Value in

  • "DEAL"
  • "LEAD"
outcome?unknown

Value in

  • "Lost"
  • "Open"
  • "Won"
ownerId?string
tag?string

Filter to records carrying this system-Tags option (the saved-view tag criterion).

search?string

Free-text search matching the record number (exact when numeric) or a title substring.

page?number
Range1 <= value
pageSize?number
Range1 <= value <= 200
sort?unknown

lastActivityAt (FR-B3) sorts by the record's most-recent timeline entry.

Value in

  • "createdAt"
  • "lastActivityAt"
  • "rank"
  • "updatedAt"
  • "value"
order?unknown

Value in

  • "asc"
  • "desc"
recordSet?unknown

Which mutually-exclusive record set the board shows; defaults to active work.

Value in

  • "active"
  • "all"
  • "archived"
  • "unclaimed"
chain?unknown

Chain axis, same meaning as Incoming's: all (default) is the whole book, own drops the chain-shared rows, chain keeps only them.

Value in

  • "all"
  • "chain"
  • "own"
createdFrom?string

ISO instant; records created before it are excluded.

Formatdate-time
createdTo?string

ISO instant; records created after it are excluded.

Formatdate-time

Header Parameters

x-company-id?string

Optional with an API key or OAuth token: leave it out and the company the key or token belongs to is used. If sent, it must be that same company, otherwise the request is refused with 403 API_KEY_WRONG_COMPANY or OAUTH_WRONG_COMPANY.

Match^[0-9a-fA-F]{24}$

Response Body

application/json

curl -X GET "https://example.com/crm/lead-deals"
{  "data": [    {      "address": "string",      "archiveBatchId": "string",      "archivedAt": "2019-08-24T14:15:22Z",      "assignedCompanyAt": "2019-08-24T14:15:22Z",      "assignedCompanyId": "string",      "assignedMembershipId": "string",      "attribution": {        "firstTouch": {          "capturedAt": "string",          "fbclid": "string",          "gclid": "string",          "landingPage": "string",          "msclkid": "string",          "referrer": "string",          "ttclid": "string",          "utmCampaign": "string",          "utmContent": "string",          "utmMedium": "string",          "utmSource": "string",          "utmTerm": "string"        },        "lastTouch": {          "capturedAt": "string",          "fbclid": "string",          "gclid": "string",          "landingPage": "string",          "msclkid": "string",          "referrer": "string",          "ttclid": "string",          "utmCampaign": "string",          "utmContent": "string",          "utmMedium": "string",          "utmSource": "string",          "utmTerm": "string"        }      },      "closedAt": "2019-08-24T14:15:22Z",      "company": {        "id": "string",        "name": "string"      },      "companyEntityId": "string",      "companyId": "string",      "contact": {        "id": "string",        "name": "string"      },      "contactId": "string",      "createdAt": "2019-08-24T14:15:22Z",      "customFields": [        {          "fieldId": "string",          "iconName": "string",          "key": "string",          "label": "string",          "options": [            {              "colorHex": "string",              "id": "string",              "label": "string",              "order": 0            }          ],          "type": "Checkbox",          "values": [            "string"          ]        }      ],      "firstResponseAt": "2019-08-24T14:15:22Z",      "formIntakeNonce": "string",      "id": "string",      "isChainIntake": true,      "isExample": true,      "lastActivityActorId": "string",      "lastActivityAt": "2019-08-24T14:15:22Z",      "lastWorkActivityAt": "2019-08-24T14:15:22Z",      "location": {        "coordinates": [          0,          0        ],        "type": "Point"      },      "lostReason": "string",      "lostReasons": [        {          "companyId": "string",          "createdAt": "2019-08-24T14:15:22Z",          "id": "string",          "label": "string",          "order": 0,          "updatedAt": "2019-08-24T14:15:22Z"        }      ],      "nextActivity": {        "at": "2019-08-24T14:15:22Z",        "kind": "string",        "label": "string"      },      "nextActivityAt": "2019-08-24T14:15:22Z",      "nextActivityKind": "string",      "nextActivityLabel": "string",      "notes": "string",      "number": 0,      "offerBadge": {        "threads": [          {            "latestSentAt": "2019-08-24T14:15:22Z",            "number": 0,            "status": "ACCEPTED"          }        ]      },      "orderId": "string",      "outcome": "Lost",      "owner": {        "avatarRef": "string",        "companyUserId": "string",        "name": "string"      },      "ownerId": "string",      "phase": "DEAL",      "pipelineId": "string",      "rank": "string",      "rejectedAt": "2019-08-24T14:15:22Z",      "rejectedReason": "string",      "responseDeadlineAt": "2019-08-24T14:15:22Z",      "source": "Booking",      "sourceFormId": "string",      "stageId": "string",      "tagPalette": [        {          "colorHex": "string",          "id": "string",          "label": "string",          "order": 0        }      ],      "tags": [        {          "colorHex": "string",          "label": "string",          "optionId": "string"        }      ],      "title": "string",      "updatedAt": "2019-08-24T14:15:22Z",      "value": 0    }  ],  "page": 0,  "pageSize": 0,  "total": 0}