Skip to content

Latest commit

 

History

History
492 lines (345 loc) · 17.8 KB

PipelinesApi.md

File metadata and controls

492 lines (345 loc) · 17.8 KB

Pipedrive.PipelinesApi

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

Method HTTP request Description
addPipeline POST /pipelines Add a new pipeline
deletePipeline DELETE /pipelines/{id} Delete a pipeline
getPipeline GET /pipelines/{id} Get one pipeline
getPipelineConversionStatistics GET /pipelines/{id}/conversion_statistics Get deals conversion rates in pipeline
getPipelineDeals GET /pipelines/{id}/deals Get deals in a pipeline
getPipelineMovementStatistics GET /pipelines/{id}/movement_statistics Get deals movements in pipeline
getPipelines GET /pipelines Get all pipelines
updatePipeline PUT /pipelines/{id} Edit a pipeline

addPipeline

AddNewPipeline addPipeline(opts)

Add a new pipeline

Adds a new pipeline

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.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 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.PipelinesApi();
let opts = {
  'name': "name_example", // String | The name of the Pipeline
  'dealProbability': new Pipedrive.NumberBoolean(), // NumberBoolean | Whether Deal probability is disabled or enabled for this Pipeline
  'orderNr': 56, // Number | Defines the order of Pipelines. First order (order_nr=0) is the default Pipeline.
  'active': new Pipedrive.NumberBoolean() // NumberBoolean | Whether this Pipeline will be made inactive (hidden) or active
};
apiInstance.addPipeline(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
name String The name of the Pipeline [optional]
dealProbability NumberBoolean Whether Deal probability is disabled or enabled for this Pipeline [optional]
orderNr Number Defines the order of Pipelines. First order (order_nr=0) is the default Pipeline. [optional]
active NumberBoolean Whether this Pipeline will be made inactive (hidden) or active [optional]

Return type

AddNewPipeline

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

deletePipeline

DeletePipelineResponse200 deletePipeline(id)

Delete a pipeline

Marks a pipeline as deleted.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.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 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

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

Parameters

Name Type Description Notes
id Number ID of the pipeline

Return type

DeletePipelineResponse200

Authorization

api_key, oauth2

HTTP request headers

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

getPipeline

GetOnePipeline getPipeline(id, opts)

Get one pipeline

Returns data about a specific pipeline. Also returns the summary of the deals in this pipeline across its stages.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.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 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.PipelinesApi();
let id = 56; // Number | ID of the pipeline
let opts = {
  'totalsConvertCurrency': "totalsConvertCurrency_example" // String | 3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned in deals_summary which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used.
};
apiInstance.getPipeline(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the pipeline
totalsConvertCurrency String 3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned in deals_summary which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used. [optional]

Return type

GetOnePipeline

Authorization

api_key, oauth2

HTTP request headers

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

getPipelineConversionStatistics

GetDealsConversionRatesInPipeline getPipelineConversionStatistics(id, startDate, endDate, opts)

Get deals conversion rates in pipeline

Returns all stage-to-stage conversion and pipeline-to-close rates for given time period.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.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 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.PipelinesApi();
let id = 56; // Number | ID of the pipeline
let startDate = new Date("2013-10-20"); // Date | Start of the period. Date in format of YYYY-MM-DD.
let endDate = new Date("2013-10-20"); // Date | End of the period. Date in format of YYYY-MM-DD.
let opts = {
  'userId': 56 // Number | ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used.
};
apiInstance.getPipelineConversionStatistics(id, startDate, endDate, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the pipeline
startDate Date Start of the period. Date in format of YYYY-MM-DD.
endDate Date End of the period. Date in format of YYYY-MM-DD.
userId Number ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. [optional]

Return type

GetDealsConversionRatesInPipeline

Authorization

api_key, oauth2

HTTP request headers

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

getPipelineDeals

GetStageDeals getPipelineDeals(id, opts)

Get deals in a pipeline

Lists deals in a specific pipeline across all its stages

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.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 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.PipelinesApi();
let id = 56; // Number | ID of the pipeline
let opts = {
  'filterId': 56, // Number | If supplied, only deals matching the given filter will be returned.
  'userId': 56, // Number | If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned.
  'everyone': new Pipedrive.NumberBoolean(), // NumberBoolean | If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned.
  'stageId': 56, // Number | If supplied, only deals within the given stage will be returned.
  'start': 0, // Number | Pagination start
  'limit': 56, // Number | Items shown per page
  'getSummary': new Pipedrive.NumberBoolean(), // NumberBoolean | Whether to include summary of the pipeline in the additional_data or not.
  'totalsConvertCurrency': "totalsConvertCurrency_example" // String | 3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned inside deals_summary inside additional_data which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used. Only works when get_summary parameter flag is enabled.
};
apiInstance.getPipelineDeals(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the pipeline
filterId Number If supplied, only deals matching the given filter will be returned. [optional]
userId Number If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. [optional]
everyone NumberBoolean If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned. [optional]
stageId Number If supplied, only deals within the given stage will be returned. [optional]
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]
getSummary NumberBoolean Whether to include summary of the pipeline in the additional_data or not. [optional]
totalsConvertCurrency String 3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned inside deals_summary inside additional_data which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used. Only works when get_summary parameter flag is enabled. [optional]

Return type

GetStageDeals

Authorization

api_key, oauth2

HTTP request headers

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

getPipelineMovementStatistics

GetDealsMovementsInPipeline getPipelineMovementStatistics(id, startDate, endDate, opts)

Get deals movements in pipeline

Returns statistics for deals movements for given time period.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.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 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.PipelinesApi();
let id = 56; // Number | ID of the pipeline
let startDate = new Date("2013-10-20"); // Date | Start of the period. Date in format of YYYY-MM-DD.
let endDate = new Date("2013-10-20"); // Date | End of the period. Date in format of YYYY-MM-DD.
let opts = {
  'userId': 56 // Number | ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used.
};
apiInstance.getPipelineMovementStatistics(id, startDate, endDate, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the pipeline
startDate Date Start of the period. Date in format of YYYY-MM-DD.
endDate Date End of the period. Date in format of YYYY-MM-DD.
userId Number ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. [optional]

Return type

GetDealsMovementsInPipeline

Authorization

api_key, oauth2

HTTP request headers

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

getPipelines

GetAllPipelines getPipelines()

Get all pipelines

Returns data about all pipelines

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.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 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.PipelinesApi();
apiInstance.getPipelines().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

GetAllPipelines

Authorization

api_key, oauth2

HTTP request headers

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

updatePipeline

EditPipeline updatePipeline(id, opts)

Edit a pipeline

Updates pipeline properties

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.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 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.PipelinesApi();
let id = 56; // Number | ID of the pipeline
let opts = {
  'name': "name_example", // String | The name of the Pipeline
  'dealProbability': new Pipedrive.NumberBoolean(), // NumberBoolean | Whether Deal probability is disabled or enabled for this Pipeline
  'orderNr': 56, // Number | Defines the order of Pipelines. First order (order_nr=0) is the default Pipeline.
  'active': new Pipedrive.NumberBoolean() // NumberBoolean | Whether this Pipeline will be made inactive (hidden) or active
};
apiInstance.updatePipeline(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the pipeline
name String The name of the Pipeline [optional]
dealProbability NumberBoolean Whether Deal probability is disabled or enabled for this Pipeline [optional]
orderNr Number Defines the order of Pipelines. First order (order_nr=0) is the default Pipeline. [optional]
active NumberBoolean Whether this Pipeline will be made inactive (hidden) or active [optional]

Return type

EditPipeline

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json