Pipedrive REST client for NodeJS

Pipedrive client for NodeJS based apps

Pipedrive is a sales pipeline software that gets you organized. It's a powerful sales CRM with effortless sales pipeline management. See www.pipedrive.com for details.

This is the official Pipedrive API wrapper-client for NodeJS based apps, distributed by Pipedrive Inc freely under the MIT licence. It provides you with basic functionality for operating with objects such as Deals, Persons, Organizations, Products and much more, without having to worry about the underlying networking stack and actual HTTPS requests.


npm install pipedrive


With a pre-set API token:

var Pipedrive = require('pipedrive');
var pipedrive = new Pipedrive.Client('YOUR_API_TOKEN_HERE');

A simple "Hello world" that lists some deals

Here's a quick example that will list some deals from your Pipedrive account:

var Pipedrive = require('pipedrive');
var pipedrive = new Pipedrive.Client('YOUR_API_TOKEN_HERE');
pipedrive.Deals.getAll({}, function(errdeals) {
    if (err) throw err;
    for (var i = 0; i < deals.length; i++) {
        console.log(deals[i].title + ' (worth ' + deals[i].value + ' ' + deals[i].currency + ')');

Supported objects

  • Activities
  • ActivityTypes
  • Authorizations
  • Currencies
  • Deals
  • DealFields
  • Files
  • Filters
  • Notes
  • Organizations
  • OrganizationFields
  • Persons
  • PersonFields
  • Pipelines
  • Products
  • ProductFields
  • SearchResults
  • Stages
  • Users

Authorization against email and password

Fetches the possible API tokens for the given user against email and password, passing error, data, additionalData to the callback function. You can use the API tokens returned by this method to instantiate the API client by issuing var pipedrive = new Pipedrive.Client('API_TOKEN_HERE').

Supported operations for object collections

Add an object. Returns error, data to the callback where data contains the id property of the newly created item.

Get specific object. Returns error, object

Update an object. Returns error in case of an error to the callback.

Get all objects, optionally passing additional parameters (such as filter_id in case of deals, persons and organizations). Returns error, objects to the callback function where objects is a collection (array) of objects.

Delete an object with a specifc ID. Returns error in case of an error to the callback.

Delete multiple objects using an array of IDs. Returns error in case of an error to the callback.

Merge two objects of the same kind. Returns error in case of an error to the callback. Merge is only supported for the following objects:

  • Persons
  • Organizations
  • Users

Supported operations for each object

Returns the value of [fieldName] of the object.

Sets a new value of [fieldName] of the object. Returns {object}.

Updates the state of the {object} in Pipedrive via the API. Returns {object}.

Deletes the {object} in Pipedrive via the API. Returns error in case of an error to the callback.

Merges the {object} with another object of the same kind with the ID given as withId. Returns error in case of error to the callback. Merge is only supported for the following objects:

  • Persons
  • Organizations
  • Users

Operations with nested objects

To add a product to a deal, simply invoke the addProduct method on a deal object.

pipedrive.Deals.get(1, function(errdeal) {
    if (err) throw err;
    deal.addProduct({ product_id: 1, quantity: 5, discount: 20 }, function(addErraddData) {
        if (addErr) throw addErr;
        console.log('Product 1 was added to deal 1', addData);

To add multiple products with a single request, make the first argument of deal's addProduct method (as shown above) an array, e.g. [{ product_id: 1, quantity: 5, discount: 0 }, { product_id: 1, quantity: 2, discount: 20 }]. This will add two product rows to a deal — one with a quantity of 5 and with no discount, the latter will add a separate row for the same product but with a quantity of 2 and no discount.

pipedrive.Deals.get(deal_id, function(errdeal) {
    if (err) throw err;
    deal.getProducts(function(productsErrattachedProducts) {
        if (productsErr) throw productsErr;
        attachedProducts.forEach(function(attachedProduct) {
            deal.deleteProduct({ id: attachedProduct.id }, function(removeErrremoveSuccess) {
                if (!removeErr) console.log('Removed product ' + attachedProduct.product_id + ' from deal 1');

There is an additional method to perform the SearchResults/field search. This can be used for field-value searches.

The following example searches for deals that match the condition where org_id=123

    term: "123",
    exact_match: true,
    field_key: "org_id",
    field_type: "dealField",
    return_item_ids: true
}), callback);
  • term — the string you are searching for from field values
  • exact_match (optional, default false) — whether the term you supply is the entire and exact match you are looking for (if set to false, partial results are also considered a match)
  • field_key — name of the field you are searching from
  • field_type — type of the field you are searching from (supported types: dealField, personField, organizationField, productField)
  • return_item_ids (optional, default false) — if set to true, individual items that have the matching term in the given field are given; if set to false, the different distinct values that match your search term across all different values in the gievn field are given. Usually you would want this to be set to true. However, for searching across autocomplete_text type fields (such as lost_reason of dealFields), you might want to show different values that pre-exist already.
  • start (optional, default 0) – results pagination start
  • limit (optional, default 100) — results pagination limit

You can request all entries for an valid object using getAll(object, callback)

pipedrive.getAll('Organizatons', function (errcollection) {
    // collection contains all Organizations 
pipedrive.getAll('Persons', function (errcollection) {
    // collection contains all Persons 


var Pipedrive = require('pipedrive');
var pipedrive = new Pipedrive.Client('PUT_YOUR_API_TOKEN_HERE');
pipedrive.Filters.getAll({ type: 'deals' }, function(filtersListErrfiltersList) {
    if (filtersList.length > 0) {
        pipedrive.Deals.getAll({ filter_id: filtersList[0].get('id'), start: 0, limit: 15 }, function(dealsListErrdealsList) {
            dealsList.forEach(function(deal) {
                console.log(deal.get('title') + ' (worth ' + deal.get('value') + ' ' + deal.get('currency') + ')');

Actions not supported

  • Adding followers to organizations/persons/users

API Documentation

The Pipedrive REST API documentation can be found at https://developers.pipedrive.com/v1


This Pipedrive API client is distributed under the MIT licence.