Deals
Returns all active deals in the Pipedrive account, including their values, ownership, pipeline stage, and associated activity and contact counts.
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 | = |
| OwnerId | = |
| PersonId | = |
| OrgId | = |
| StageId | = |
| PipelineId | = |
| Status | = |
| FilterId | = |
| UpdateTime | =,<,<=,>,>= |
For example, the following queries are processed server-side:
SELECT * FROM Deals WHERE Id = 14
SELECT * FROM Deals WHERE StageId = 1
SELECT * FROM Deals WHERE Status = 'Open'
SELECT * FROM Deals WHERE FilterId = 1
INSERT
Execute INSERT by specifying the following columns. You can also insert any columns that are not required.
For example:
INSERT INTO Deals (Title, Currency, StageId, LabelIds) VALUES ('title', 'USD', 1, '[76, 86]')
UPDATE
Execute UPDATE by specifying the Id in the WHERE clause. All columns that are not read-only can be updated.
For example:
UPDATE Deals SET Title = 'test' WHERE Id = 2
DELETE
Execute DELETE by specifying the Id in the WHERE clause.
For example:
DELETE FROM Deals WHERE Id = 105
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | Integer | True |
The unique identifier of the deal. | |
| Title | String | False |
The title or name of the deal. | |
| CreatorUserId | Integer | True |
The unique identifier of the user who created the deal. | |
| OwnerId | Integer | False |
The unique identifier of the user who owns the deal. | |
| Value | Double | False |
The monetary value of the deal. | |
| PersonId | Integer | False |
The unique identifier of the person associated with the deal. | |
| OrgId | Integer | False |
The unique identifier of the organization associated with the deal. | |
| StageId | Integer | False |
The unique identifier of the pipeline stage the deal is currently in. | |
| PipelineId | Integer | False |
The unique identifier of the pipeline the deal belongs to. | |
| Currency | String | False |
The currency code for the deal value, such as USD or EUR. | |
| AddTime | Datetime | False |
The date and time at which the deal was created. | |
| UpdateTime | Datetime | True |
The date and time at which the deal was last updated. | |
| StageChangeTime | Datetime | True |
The date and time at which the deal last moved to a different pipeline stage. | |
| Status | String | False |
The current status of the deal. The allowed values are open, won, lost, deleted. | |
| IsDeleted | Boolean | False |
Indicates whether the deal has been deleted. | |
| Probability | Integer | False |
The probability percentage that the deal will be won, expressed as a value between 0 and 100. | |
| LostReason | String | False |
The reason recorded when the deal was marked as lost. | |
| VisibleTo | Integer | False |
The visibility setting for the deal, controlling which users can see it. | |
| CloseTime | Datetime | False |
The date and time at which the deal was closed as won or lost. | |
| WonTime | Datetime | False |
The date and time at which the deal was marked as won. | |
| LostTime | Datetime | False |
The date and time at which the deal was marked as lost. | |
| LocalWonDate | Date | True |
The date on which the deal was won, expressed in the user's local timezone. | |
| LocalLostDate | Date | True |
The date on which the deal was lost, expressed in the user's local timezone. | |
| LocalCloseDate | Date | True |
The date on which the deal was closed, expressed in the user's local timezone. | |
| ExpectedCloseDate | Date | False |
The date on which the deal is expected to close. | |
| LabelIds | String | False |
A JSON aggregate containing the unique identifiers of labels applied to the deal. | |
| Origin | String | True |
The source channel through which the deal was created, such as web, API, or import. | |
| OriginId | String | True |
The unique identifier of the originating record in the source channel. | |
| Channel | Integer | True |
The numeric code representing the marketing or acquisition channel associated with the deal. | |
| ChannelId | String | True |
The unique identifier of the marketing or acquisition channel associated with the deal. | |
| Acv | Integer | True |
The Annual Contract Value (ACV) associated with the deal. | |
| Arr | Integer | True |
The Annual Recurring Revenue (ARR) associated with the deal. | |
| Mrr | Integer | True |
The Monthly Recurring Revenue (MRR) associated with the deal. | |
| NextActivityId | Integer | True |
The unique identifier of the next scheduled activity for the deal. | |
| LastActivityId | Integer | True |
The unique identifier of the most recently completed activity for the deal. | |
| FirstWonTime | Datetime | True |
The date and time at which the deal was first marked as won. | |
| ProductsCount | Integer | True |
The total number of products attached to the deal. | |
| FilesCount | Integer | True |
The total number of files attached to the deal. | |
| NotesCount | Integer | True |
The total number of notes associated with the deal. | |
| FollowersCount | Integer | True |
The total number of users following the deal. | |
| EmailMessagesCount | Integer | True |
The total number of email messages associated with the deal. | |
| ActivitiesCount | Integer | True |
The total number of activities associated with the deal. | |
| DoneActivitiesCount | Integer | True |
The total number of completed activities associated with the deal. | |
| UndoneActivitiesCount | Integer | True |
The total number of incomplete activities associated with the deal. | |
| ParticipantsCount | Integer | True |
The total number of participants associated with the deal. | |
| LastIncomingMailTime | Datetime | True |
The date and time of the most recent incoming email message associated with the deal. | |
| LastOutgoingMailTime | Datetime | True |
The date and time of the most recent outgoing email message associated with the deal. | |
| CustomFields | String | True |
A JSON aggregate containing any custom field values defined for the deal. | |
| ArchiveTime | Datetime | False |
The date and time at which the deal was archived. | |
| IsArchived | Boolean | False |
Indicates whether the deal is currently 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 |
| FilterId | Integer |
Filter Id. |