All URIs are relative to https://api.pipedrive.com/v1
Method | HTTP request | Description |
---|---|---|
addLead | POST /leads | Add a lead |
addLeadLabel | POST /leadLabels | Add a lead label |
deleteLead | DELETE /leads/{id} | Delete a lead |
deleteLeadLabel | DELETE /leadLabels/{id} | Delete a lead label |
getLead | GET /leads/{id} | Get one lead |
getLeadLabels | GET /leadLabels | Get all lead labels |
getLeadSources | GET /leadSources | Get all lead sources |
getLeads | GET /leads | Get all leads |
updateLead | PATCH /leads/{id} | Update a lead |
updateLeadLabel | PATCH /leadLabels/{id} | Update a lead label |
OneLeadResponse200 addLead(opts)
Add a lead
Creates a Lead. A Lead always has to be linked to a Person or an Organization or both. All Leads created through the Public Pipedrive API will have a Lead Source `API` assigned. If a Lead contains custom fields, the fields' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field's value hasn't been set for the Lead, it won't appear in the response. Please note that Leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from Deals. See an example of updating custom fields’ values in <a href=\" https://pipedrive.readme.io/docs/updating-custom-field-value \" target=\"_blank\" rel=\"noopener noreferrer\">this tutorial</a>.
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.LeadsApi();
let opts = {
'addLeadRequest': new Pipedrive.AddLeadRequest() // AddLeadRequest |
};
apiInstance.addLead(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
addLeadRequest | AddLeadRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
AddOrUpdateLeadLabelResponse200 addLeadLabel(opts)
Add a lead label
Creates a Lead Label
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.LeadsApi();
let opts = {
'addLeadLabelRequest': new Pipedrive.AddLeadLabelRequest() // AddLeadLabelRequest |
};
apiInstance.addLeadLabel(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
addLeadLabelRequest | AddLeadLabelRequest | [optional] |
AddOrUpdateLeadLabelResponse200
- Content-Type: application/json
- Accept: application/json
LeadIdResponse200 deleteLead(id)
Delete a lead
Deletes a specific Lead
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.LeadsApi();
let id = null; // String | The ID of the Lead
apiInstance.deleteLead(id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the Lead |
- Content-Type: Not defined
- Accept: application/json
LeadIdResponse200 deleteLeadLabel(id)
Delete a lead label
Deletes a specific Lead Label
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.LeadsApi();
let id = null; // String | The ID of the Lead Label
apiInstance.deleteLeadLabel(id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the Lead Label |
- Content-Type: Not defined
- Accept: application/json
OneLeadResponse200 getLead(id)
Get one lead
Returns details of a specific Lead. If a Lead contains custom fields, the fields' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field's value hasn't been set for the Lead, it won't appear in the response. Please note that Leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from Deals.
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.LeadsApi();
let id = null; // String | The ID of the Lead
apiInstance.getLead(id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the Lead |
- Content-Type: Not defined
- Accept: application/json
GetLeadLabelsResponse200 getLeadLabels()
Get all lead labels
Returns details of all Lead Labels. This endpoint does not support pagination and all Labels are always returned.
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.LeadsApi();
apiInstance.getLeadLabels().then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
GetLeadSourcesResponse200 getLeadSources()
Get all lead sources
Returns all Lead Sources. Please note that the list of Lead Sources is fixed, it cannot be modified. All Leads created through the Public Pipedrive API will have a Lead Source `API` assigned.
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.LeadsApi();
apiInstance.getLeadSources().then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
GetLeadsResponse200 getLeads(opts)
Get all leads
Returns multiple Leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a Lead contains custom fields, the fields' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field's value hasn't been set for the Lead, it won't appear in the response. Please note that Leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from Deals.
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.LeadsApi();
let opts = {
'limit': 100, // Number | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned.
'start': 0, // Number | For pagination, the position that represents the first result for the page
'archivedStatus': "archivedStatus_example" // String | Filtering based on archived status of a Lead. If not provided, `All` is used.
};
apiInstance.getLeads(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
limit | Number | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. | [optional] |
start | Number | For pagination, the position that represents the first result for the page | [optional] |
archivedStatus | String | Filtering based on archived status of a Lead. If not provided, `All` is used. | [optional] |
- Content-Type: Not defined
- Accept: application/json
OneLeadResponse200 updateLead(id, opts)
Update a lead
Updates one or more properties of a Lead. Only properties included in the request will be updated. Send `null` to unset a property (applicable for example for `value`, `person_id` or `organization_id`). If a Lead contains custom fields, the fields' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field's value hasn't been set for the Lead, it won't appear in the response. Please note that Leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from Deals. See an example of updating custom fields’ values in <a href=\" https://pipedrive.readme.io/docs/updating-custom-field-value \" target=\"_blank\" rel=\"noopener noreferrer\">this tutorial</a>.
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.LeadsApi();
let id = null; // String | The ID of the Lead
let opts = {
'updateLeadRequest': new Pipedrive.UpdateLeadRequest() // UpdateLeadRequest |
};
apiInstance.updateLead(id, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the Lead | |
updateLeadRequest | UpdateLeadRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
AddOrUpdateLeadLabelResponse200 updateLeadLabel(id, opts)
Update a lead label
Updates one or more properties of a Lead Label. Only properties included in the request will be updated.
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.LeadsApi();
let id = null; // String | The ID of the Lead Label
let opts = {
'updateLeadLabelRequest': new Pipedrive.UpdateLeadLabelRequest() // UpdateLeadLabelRequest |
};
apiInstance.updateLeadLabel(id, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the Lead Label | |
updateLeadLabelRequest | UpdateLeadLabelRequest | [optional] |
AddOrUpdateLeadLabelResponse200
- Content-Type: application/json
- Accept: application/json