Skip to content

Latest commit

 

History

History
1816 lines (1272 loc) · 66.4 KB

DealsApi.md

File metadata and controls

1816 lines (1272 loc) · 66.4 KB

Pipedrive.DealsApi

All URIs are relative to https://api.pipedrive.com/v1

Method HTTP request Description
addDeal POST /deals Add a deal
addDealFollower POST /deals/{id}/followers Add a follower to a deal
addDealParticipant POST /deals/{id}/participants Add a participant to a deal
addDealProduct POST /deals/{id}/products Add a product to a deal
deleteDeal DELETE /deals/{id} Delete a deal
deleteDealFollower DELETE /deals/{id}/followers/{follower_id} Delete a follower from a deal
deleteDealParticipant DELETE /deals/{id}/participants/{deal_participant_id} Delete a participant from a deal
deleteDealProduct DELETE /deals/{id}/products/{product_attachment_id} Delete an attached product from a deal
deleteDeals DELETE /deals Delete multiple deals in bulk
duplicateDeal POST /deals/{id}/duplicate Duplicate deal
getDeal GET /deals/{id} Get details of a deal
getDealActivities GET /deals/{id}/activities List activities associated with a deal
getDealChangelog GET /deals/{id}/changelog List updates about deal field values
getDealFiles GET /deals/{id}/files List files attached to a deal
getDealFollowers GET /deals/{id}/followers List followers of a deal
getDealMailMessages GET /deals/{id}/mailMessages List mail messages associated with a deal
getDealParticipants GET /deals/{id}/participants List participants of a deal
getDealParticipantsChangelog GET /deals/{id}/participantsChangelog List updates about participants of a deal
getDealPersons GET /deals/{id}/persons List all persons associated with a deal
getDealProducts GET /deals/{id}/products List products attached to a deal
getDealUpdates GET /deals/{id}/flow List updates about a deal
getDealUsers GET /deals/{id}/permittedUsers List permitted users
getDeals GET /deals Get all deals
getDealsCollection GET /deals/collection Get all deals (BETA)
getDealsSummary GET /deals/summary Get deals summary
getDealsTimeline GET /deals/timeline Get deals timeline
mergeDeals PUT /deals/{id}/merge Merge two deals
searchDeals GET /deals/search Search deals
updateDeal PUT /deals/{id} Update a deal
updateDealProduct PUT /deals/{id}/products/{product_attachment_id} Update the product attached to a deal

addDeal

GetAddedDeal addDeal(opts)

Add a deal

Adds a new deal. All deals created through the Pipedrive API will have a `origin` set to `API`. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the dealFields and look for `key` values. For more information, see the tutorial for <a href=&quot;https://pipedrive.readme.io/docs/creating-a-deal\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>adding a deal</a>.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let opts = Pipedrive.NewDeal.constructFromObject({
  // Properties that you want to update
});
apiInstance.addDeal(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
NewDeal NewDeal [optional]

Return type

GetAddedDeal

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

addDealFollower

AddedDealFollower addDealFollower(id, opts)

Add a follower to a deal

Adds a follower to a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
let opts = Pipedrive.AddDealFollowerRequest.constructFromObject({
  // Properties that you want to update
});
apiInstance.addDealFollower(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
AddDealFollowerRequest AddDealFollowerRequest [optional]

Return type

AddedDealFollower

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

addDealParticipant

PostDealParticipants addDealParticipant(id, opts)

Add a participant to a deal

Adds a participant to a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
let opts = Pipedrive.AddDealParticipantRequest.constructFromObject({
  // Properties that you want to update
});
apiInstance.addDealParticipant(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
AddDealParticipantRequest AddDealParticipantRequest [optional]

Return type

PostDealParticipants

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

addDealProduct

GetAddProductAttachmentDetails addDealProduct(id, opts)

Add a product to a deal

Adds a product to a deal, creating a new item called a deal-product.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
let opts = Pipedrive.NewDealProduct.constructFromObject({
  // Properties that you want to update
});
apiInstance.addDealProduct(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
NewDealProduct NewDealProduct [optional]

Return type

GetAddProductAttachmentDetails

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteDeal

DeleteDeal deleteDeal(id)

Delete a deal

Marks a deal as deleted. After 30 days, the deal will be permanently deleted.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
apiInstance.deleteDeal(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal

Return type

DeleteDeal

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

deleteDealFollower

DeleteDealFollower deleteDealFollower(id, followerId)

Delete a follower from a deal

Deletes a follower from a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
let followerId = 56; // Number | The ID of the follower
apiInstance.deleteDealFollower(id, followerId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
follower_id Number The ID of the follower

Return type

DeleteDealFollower

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

deleteDealParticipant

DeleteDealParticipant deleteDealParticipant(id, dealParticipantId)

Delete a participant from a deal

Deletes a participant from a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
let dealParticipantId = 56; // Number | The ID of the participant of the deal
apiInstance.deleteDealParticipant(id, dealParticipantId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
deal_participant_id Number The ID of the participant of the deal

Return type

DeleteDealParticipant

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

deleteDealProduct

DeleteDealProduct deleteDealProduct(id, productAttachmentId)

Delete an attached product from a deal

Deletes a product attachment from a deal, using the `product_attachment_id` Not possible to delete the attached product if the deal has installments associated and the product is the last one enabled

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
let productAttachmentId = 56; // Number | The product attachment ID
apiInstance.deleteDealProduct(id, productAttachmentId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
product_attachment_id Number The product attachment ID

Return type

DeleteDealProduct

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

deleteDeals

DeleteMultipleDeals deleteDeals(ids)

Delete multiple deals in bulk

Marks multiple deals as deleted. After 30 days, the deals will be permanently deleted.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let ids = "ids_example"; // String | The comma-separated IDs that will be deleted
apiInstance.deleteDeals(ids).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
ids String The comma-separated IDs that will be deleted

Return type

DeleteMultipleDeals

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

duplicateDeal

GetDuplicatedDeal duplicateDeal(id)

Duplicate deal

Duplicates a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
apiInstance.duplicateDeal(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal

Return type

GetDuplicatedDeal

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDeal

GetDeal getDeal(id)

Get details of a deal

Returns the details of a specific deal. Note that this also returns some additional fields which are not present when asking for all deals – such as deal age and stay in pipeline stages. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the `key` value of dealFields. For more information, see the tutorial for <a href=&quot;https://pipedrive.readme.io/docs/getting-details-of-a-deal\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>getting details of a deal</a>.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
apiInstance.getDeal(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal

Return type

GetDeal

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealActivities

DealListActivitiesResponse getDealActivities(id, opts)

List activities associated with a deal

Lists activities associated with a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56, // Number | Items shown per page
  'done': new Pipedrive.NumberBoolean(), // NumberBoolean | Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities.
  'exclude': "exclude_example" // String | A comma-separated string of activity IDs to exclude from result
};
apiInstance.getDealActivities(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]
done NumberBoolean Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. [optional]
exclude String A comma-separated string of activity IDs to exclude from result [optional]

Return type

DealListActivitiesResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealChangelog

ChangelogResponse getDealChangelog(id, opts)

List updates about deal field values

Lists updates about field values of a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'cursor': "cursor_example", // String | For pagination, the marker (an opaque string value) representing the first item on the next page
  'limit': 56 // Number | Items shown per page
};
apiInstance.getDealChangelog(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
cursor String For pagination, the marker (an opaque string value) representing the first item on the next page [optional]
limit Number Items shown per page [optional]

Return type

ChangelogResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealFiles

ListFilesResponse getDealFiles(id, opts)

List files attached to a deal

Lists files associated with a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56, // Number | Items shown per page
  'sort': "sort_example" // String | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`.
};
apiInstance.getDealFiles(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]
sort String The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. [optional]

Return type

ListFilesResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealFollowers

ListFollowersResponse getDealFollowers(id)

List followers of a deal

Lists the followers of a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
apiInstance.getDealFollowers(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal

Return type

ListFollowersResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealMailMessages

ListMailMessagesResponse getDealMailMessages(id, opts)

List mail messages associated with a deal

Lists mail messages associated with a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56 // Number | Items shown per page
};
apiInstance.getDealMailMessages(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]

Return type

ListMailMessagesResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealParticipants

DealParticipants getDealParticipants(id, opts)

List participants of a deal

Lists the participants associated with a deal.<br>If a company uses the Campaigns product, then this endpoint will also return the `data.marketing_status` field.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56 // Number | Items shown per page
};
apiInstance.getDealParticipants(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]

Return type

DealParticipants

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealParticipantsChangelog

ParticipantsChangelog getDealParticipantsChangelog(id, opts)

List updates about participants of a deal

List updates about participants of a deal. This is a cursor-paginated endpoint. For more information, please refer to our documentation on <a href=&quot;https://pipedrive.readme.io/docs/core-api-concepts-pagination\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>pagination</a>.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'limit': 56, // Number | Items shown per page
  'cursor': "cursor_example" // String | For pagination, the marker (an opaque string value) representing the first item on the next page
};
apiInstance.getDealParticipantsChangelog(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
limit Number Items shown per page [optional]
cursor String For pagination, the marker (an opaque string value) representing the first item on the next page [optional]

Return type

ParticipantsChangelog

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealPersons

ListPersonsResponse getDealPersons(id, opts)

List all persons associated with a deal

Lists all persons associated with a deal, regardless of whether the person is the primary contact of the deal, or added as a participant.<br>If a company uses the Campaigns product, then this endpoint will also return the `data.marketing_status` field.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56 // Number | Items shown per page
};
apiInstance.getDealPersons(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]

Return type

ListPersonsResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealProducts

ListProductsResponse getDealProducts(id, opts)

List products attached to a deal

Lists products attached to a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56, // Number | Items shown per page
  'includeProductData': new Pipedrive.NumberBoolean() // NumberBoolean | Whether to fetch product data along with each attached product (1) or not (0, default)
};
apiInstance.getDealProducts(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]
include_product_data NumberBoolean Whether to fetch product data along with each attached product (1) or not (0, default) [optional]

Return type

ListProductsResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealUpdates

DealFlowResponse getDealUpdates(id, opts)

List updates about a deal

Lists updates about a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56, // Number | Items shown per page
  'allChanges': "allChanges_example", // String | Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates.
  'items': "items_example" // String | A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change).
};
apiInstance.getDealUpdates(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]
all_changes String Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. [optional]
items String A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). [optional]

Return type

DealFlowResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealUsers

ListPermittedUsersResponse getDealUsers(id)

List permitted users

Lists the users permitted to access a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
apiInstance.getDealUsers(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal

Return type

ListPermittedUsersResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDeals

GetDeals getDeals(opts)

Get all deals

Returns all deals. For more information, see the tutorial for <a href=&quot;https://pipedrive.readme.io/docs/getting-all-deals\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>getting all deals</a>.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'userId': 56, // Number | If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied.
  'filterId': 56, // Number | The ID of the filter to use
  'stageId': 56, // Number | If supplied, only deals within the given stage will be returned
  'status': "'all_not_deleted'", // String | Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included.
  'start': 0, // Number | Pagination start
  'limit': 56, // Number | Items shown per page
  'sort': "sort_example", // String | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys).
  'ownedByYou': new Pipedrive.NumberBoolean() // NumberBoolean | When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied.
};
apiInstance.getDeals(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
user_id Number If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. [optional]
filter_id Number The ID of the filter to use [optional]
stage_id Number If supplied, only deals within the given stage will be returned [optional]
status String Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. [optional] [default to 'all_not_deleted']
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]
sort String The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). [optional]
owned_by_you NumberBoolean When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. [optional]

Return type

GetDeals

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealsCollection

GetDealsCollection getDealsCollection(opts)

Get all deals (BETA)

Returns all deals. This is a cursor-paginated endpoint that is currently in BETA. For more information, please refer to our documentation on <a href=&quot;https://pipedrive.readme.io/docs/core-api-concepts-pagination\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>pagination</a>. Please note that only global admins (those with global permissions) can access these endpoints. Users with regular permissions will receive a 403 response. Read more about global permissions <a href=&quot;https://support.pipedrive.com/en/article/global-user-management\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>here</a>.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'cursor': "cursor_example", // String | For pagination, the marker (an opaque string value) representing the first item on the next page
  'limit': 100, // Number | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
  'since': "since_example", // String | The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field.
  'until': "until_example", // String | The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field.
  'userId': 56, // Number | If supplied, only deals matching the given user will be returned
  'stageId': 56, // Number | If supplied, only deals within the given stage will be returned
  'status': "status_example" // String | Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included.
};
apiInstance.getDealsCollection(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
cursor String For pagination, the marker (an opaque string value) representing the first item on the next page [optional]
limit Number For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. [optional]
since String The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. [optional]
until String The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. [optional]
user_id Number If supplied, only deals matching the given user will be returned [optional]
stage_id Number If supplied, only deals within the given stage will be returned [optional]
status String Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. [optional]

Return type

GetDealsCollection

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealsSummary

GetDealsSummary getDealsSummary(opts)

Get deals summary

Returns a summary of all the deals.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'status': "status_example", // String | Only fetch deals with a specific status. open = Open, won = Won, lost = Lost.
  'filterId': 56, // Number | <code>user_id</code> will not be considered. Only deals matching the given filter will be returned.
  'userId': 56, // Number | Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`.
  'stageId': 56 // Number | Only deals within the given stage will be returned
};
apiInstance.getDealsSummary(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
status String Only fetch deals with a specific status. open = Open, won = Won, lost = Lost. [optional]
filter_id Number <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. [optional]
user_id Number Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. [optional]
stage_id Number Only deals within the given stage will be returned [optional]

Return type

GetDealsSummary

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDealsTimeline

GetDealsTimeline getDealsTimeline(startDate, interval, amount, fieldKey, opts)

Get deals timeline

Returns open and won deals, grouped by a defined interval of time set in a date-type dealField (`field_key`) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given `field_key`.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let startDate = new Date("2013-10-20"); // Date | The date when the first interval starts. Format: YYYY-MM-DD.
let interval = "interval_example"; // String | The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table>
let amount = 56; // Number | The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months).
let fieldKey = "fieldKey_example"; // String | The date field key which deals will be retrieved from
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'userId': 56, // Number | If supplied, only deals matching the given user will be returned
  'pipelineId': 56, // Number | If supplied, only deals matching the given pipeline will be returned
  'filterId': 56, // Number | If supplied, only deals matching the given filter will be returned
  'excludeDeals': new Pipedrive.NumberBoolean(), // NumberBoolean | Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned.
  'totalsConvertCurrency': "totalsConvertCurrency_example" // String | The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used.
};
apiInstance.getDealsTimeline(startDate, interval, amount, fieldKey, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
start_date Date The date when the first interval starts. Format: YYYY-MM-DD.
interval String The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table>
amount Number The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months).
field_key String The date field key which deals will be retrieved from
user_id Number If supplied, only deals matching the given user will be returned [optional]
pipeline_id Number If supplied, only deals matching the given pipeline will be returned [optional]
filter_id Number If supplied, only deals matching the given filter will be returned [optional]
exclude_deals NumberBoolean Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. [optional]
totals_convert_currency String The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. [optional]

Return type

GetDealsTimeline

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

mergeDeals

GetMergedDeal mergeDeals(id, opts)

Merge two deals

Merges a deal with another deal. For more information, see the tutorial for <a href=&quot;https://pipedrive.readme.io/docs/merging-two-deals\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>merging two deals</a>.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
let opts = Pipedrive.MergeDealsRequest.constructFromObject({
  // Properties that you want to update
});
apiInstance.mergeDeals(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
MergeDealsRequest MergeDealsRequest [optional]

Return type

GetMergedDeal

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

searchDeals

DealSearchResponse searchDeals(term, opts)

Search deals

Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of <a href=&quot;https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\&quot;&gt;/v1/itemSearch&lt;/a> with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let term = "term_example"; // String | The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded.
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'fields': "fields_example", // String | A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.
  'exactMatch': true, // Boolean | When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive.
  'personId': 56, // Number | Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000.
  'organizationId': 56, // Number | Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000.
  'status': "status_example", // String | Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000.
  'includeFields': "includeFields_example", // String | Supports including optional fields in the results which are not provided by default
  'start': 0, // Number | Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter.
  'limit': 56 // Number | Items shown per page
};
apiInstance.searchDeals(term, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
term String The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded.
fields String A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>here</a>. [optional]
exact_match Boolean When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. [optional]
person_id Number Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. [optional]
organization_id Number Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. [optional]
status String Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. [optional]
include_fields String Supports including optional fields in the results which are not provided by default [optional]
start Number Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. [optional] [default to 0]
limit Number Items shown per page [optional]

Return type

DealSearchResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

updateDeal

GetAddedDeal updateDeal(id, opts)

Update a deal

Updates the properties of a deal. For more information, see the tutorial for <a href=&quot;https://pipedrive.readme.io/docs/updating-a-deal\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>updating a deal</a>.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
let opts = Pipedrive.UpdateDealRequest.constructFromObject({
  // Properties that you want to update
});
apiInstance.updateDeal(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
UpdateDealRequest UpdateDealRequest [optional]

Return type

GetAddedDeal

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateDealProduct

GetProductAttachmentDetails updateDealProduct(id, productAttachmentId, opts)

Update the product attached to a deal

Updates the details of the product that has been attached to a deal.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
let productAttachmentId = 56; // Number | The ID of the deal-product (the ID of the product attached to the deal)
let opts = Pipedrive.UpdateDealProduct.constructFromObject({
  // Properties that you want to update
});
apiInstance.updateDealProduct(id, productAttachmentId, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the deal
product_attachment_id Number The ID of the deal-product (the ID of the product attached to the deal)
UpdateDealProduct UpdateDealProduct [optional]

Return type

GetProductAttachmentDetails

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json