Leads
Returns all leads in the Pipedrive account, including their associated person, organization, labels, and value details.
Table-Specific Information
SELECT
The provider uses the Pipedrive API to process WHERE clause conditions built with the following columns and operators. The rest of the filter is executed client-side within the provider.
| Column | Supported Operators |
| Id | = |
| SearchByEmail | = |
| OwnerId | = |
| PersonId | = |
| OrganizationId | = |
For example, the following queries are processed server-side:
SELECT * FROM Leads
SELECT * FROM Leads WHERE Id = 'a300ea00-5d6c-11ec-9270-93cbb0be1eed'
SELECT * FROM Leads WHERE SearchByEmail = 'all'
INSERT
Execute INSERT by specifying the Title column. You can also insert any columns that are not required.
For example:
INSERT INTO Leads (Title, Personid, Visibleto, ExpectedCloseDate) VALUES ('CData123', 1, 1, '2022-01-01')
UPDATE
Execute UPDATE by specifying the Id in the WHERE clause. All columns that are not read-only can be updated.
For example:
UPDATE Leads SET Title = 'CdataIndia' WHERE Id = 'bf1bb1e0-6e13-11ec-b981-a127469657bd'
DELETE
Execute DELETE by specifying the Id in the WHERE clause.
For example:
DELETE FROM Leads WHERE Id = 'bf1bb1e0-6e13-11ec-b981-a127469657bd'
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | String | True |
The lead ID. | |
| Addtime | Datetime | True |
The time the lead was added. | |
| CcEmail | String | True |
The BCC email address associated with this lead, used to automatically log emails sent to it. | |
| CreatorId | Integer | True |
The ID of the lead's creator. | |
| ExpectedCloseDate | Date | False |
The date that the Deal to be created from this lead is expected to close. | |
| Isarchived | Boolean | False |
A flag indicating whether or not this lead is archived. | |
| Labelids | String | False |
The IDs of the lead labels that will be associated with this Lead. | |
| NextactivityId | Integer | True |
The ID of the next scheduled activity linked to this lead. | |
| OrganizationId | String | False |
The ID of an organization to which this lead will be linked. | |
| OwnerId | Integer | False |
The ID of the user who will be the owner of the created lead. | |
| PersonId | Integer | False |
The ID of a person to whom this lead will be linked. | |
| Sourcename | String | True |
The name of the source for this lead. | |
| Title | String | False |
The lead name. | |
| Updatetime | Datetime | True |
The most recent time that this lead has been updated. | |
| Amount | Integer | False |
The potential value of the lead. | |
| Currency | String | False |
The ISO 4217 currency code for the lead's monetary value. | |
| Visibleto | String | False |
The visibility level of the lead, controlling which users can see it. Accepted values: 1 (owner only), 3 (owner's visibility group), 5 (owner's and sub-groups), 7 (entire company). The allowed values are 1, 3, 5, 7. | |
| Wasseen | Boolean | False |
A flag indicating whether the lead was seen by someone in the Pipedrive UI. | |
| OriginId | String | False |
An optional ID to further distinguish the origin of the lead. | |
| Channel | Integer | False |
The ID of the Marketing channel that was the source of this lead. | |
| ChannelId | String | False |
An optional ID to further distinguish the Marketing channel. | |
| ArchiveTime | Datetime | True |
The time this lead was archived. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer more granular control over the data returned from the data source.
| Name | Type | Description |
| ArchivedStatus | Integer |
The archived status of the lead, to be used for filtering. If not provided, All is used (retrieves an unfiltered list). The allowed values are archived, not_archived, all. The default value is all. |