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.
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,unclaimedfor unassigned leads,archivedfor archived records, orallfor everything.pipelineId,stageId,contactId,ownerId: only records in that pipeline or stage, for that contact, or owned by that member.phase:LEADorDEAL.outcome:Open,WonorLost.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,valueorlastActivityAt.order:ascordesc. Defaults toasc, and todescwhen sorting bylastActivityAt.chain:all(default) for every record you can see,ownto leave out records shared through your chain, orchainfor 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 Company API key, created under Settings > API Keys.
In: header
Query Parameters
Value in
- "DEAL"
- "LEAD"
Value in
- "Lost"
- "Open"
- "Won"
Filter to records carrying this system-Tags option (the saved-view tag criterion).
Free-text search matching the record number (exact when numeric) or a title substring.
1 <= value1 <= value <= 200lastActivityAt (FR-B3) sorts by the record's most-recent timeline entry.
Value in
- "createdAt"
- "lastActivityAt"
- "rank"
- "updatedAt"
- "value"
Value in
- "asc"
- "desc"
Which mutually-exclusive record set the board shows; defaults to active work.
Value in
- "active"
- "all"
- "archived"
- "unclaimed"
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"
ISO instant; records created before it are excluded.
date-timeISO instant; records created after it are excluded.
date-timeHeader Parameters
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.
^[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}Get a lead or deal GET
Returns the record with its tags, custom field values, owner, next step and linked order, plus the tag options and lost reasons you can pick from. Archived records are returned too. An id from another company returns 404.
Move a lead or deal to a stage PATCH
Moves the record to another stage in its pipeline, or to a new position in its stage. Pass the record's `updatedAt` as `lastSeenUpdatedAt` to get 409 instead of overwriting a change someone else made since you read it. A stage from another pipeline returns 400.