Leads and deals

Get a lead or deal

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.

GET
/crm/lead-deals/{id}

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.

Authorization

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

Company API key, created under Settings > API Keys.

In: header

Path Parameters

id*string

The lead or deal id.

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/string"
{  "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",  "companyEntityId": "string",  "companyId": "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,  "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}

Create a lead or deal POST

Creates a lead, or a deal when `phase` is `DEAL`, at the top of its stage. Without `pipelineId` it goes to your default pipeline, and without `stageId` to the pipeline's first stage. A stage from another pipeline or an owner who is not a member of your company returns 400; a pipeline, contact or company you cannot see returns 404.

List leads and deals GET

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.