Skip to content

Latest commit

 

History

History
1247 lines (865 loc) · 40.7 KB

PersonsApi.md

File metadata and controls

1247 lines (865 loc) · 40.7 KB

Pipedrive.PersonsApi

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

Method HTTP request Description
addPerson POST /persons Add a person
addPersonFollower POST /persons/{id}/followers Add a follower to a person
addPersonPicture POST /persons/{id}/picture Add person picture
deletePerson DELETE /persons/{id} Delete a person
deletePersonFollower DELETE /persons/{id}/followers/{follower_id} Deletes a follower from a person.
deletePersonPicture DELETE /persons/{id}/picture Delete person picture
deletePersons DELETE /persons Delete multiple persons in bulk
findPersonByName GET /persons/find Find persons by name
getPerson GET /persons/{id} Get details of a person
getPersonActivities GET /persons/{id}/activities List activities associated with a person
getPersonDeals GET /persons/{id}/deals List deals associated with a person
getPersonFiles GET /persons/{id}/files List files attached to a person
getPersonFollowers GET /persons/{id}/followers List followers of a person
getPersonMailMessages GET /persons/{id}/mailMessages List mail messages associated with a person
getPersonProducts GET /persons/{id}/products List products associated with a person
getPersonUpdates GET /persons/{id}/flow List updates about a person
getPersonUsers GET /persons/{id}/permittedUsers List permitted users
getPersons GET /persons Get all persons
mergePersons PUT /persons/{id}/merge Merge two persons
searchPersons GET /persons/search Search persons
updatePerson PUT /persons/{id} Update a person

addPerson

AddPersonResponse addPerson(opts)

Add a person

Adds a new person. 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 personFields and look for 'key' values.

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.PersonsApi();
let opts = {
  'newPerson': new Pipedrive.NewPerson() // NewPerson | 
};
apiInstance.addPerson(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
newPerson NewPerson [optional]

Return type

AddPersonResponse

Authorization

api_key, oauth2

HTTP request headers

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

addPersonFollower

AddFollowerToPersonResponse addPersonFollower(id, userId)

Add a follower to a person

Adds a follower to a person.

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.PersonsApi();
let id = 56; // Number | ID of a person
let userId = 56; // Number | ID of the user
apiInstance.addPersonFollower(id, userId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of a person
userId Number ID of the user

Return type

AddFollowerToPersonResponse

Authorization

api_key, oauth2

HTTP request headers

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

addPersonPicture

AddPersonPictureResponse addPersonPicture(id, file, opts)

Add person picture

Add a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares.

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.PersonsApi();
let id = 56; // Number | ID of a person
let file = "/path/to/file"; // File | One image supplied in the multipart/form-data encoding.
let opts = {
  'cropX': 56, // Number | X coordinate to where start cropping form (in pixels)
  'cropY': 56, // Number | Y coordinate to where start cropping form (in pixels)
  'cropWidth': 56, // Number | Width of cropping area (in pixels)
  'cropHeight': 56 // Number | Height of cropping area (in pixels)
};
apiInstance.addPersonPicture(id, file, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of a person
file File One image supplied in the multipart/form-data encoding.
cropX Number X coordinate to where start cropping form (in pixels) [optional]
cropY Number Y coordinate to where start cropping form (in pixels) [optional]
cropWidth Number Width of cropping area (in pixels) [optional]
cropHeight Number Height of cropping area (in pixels) [optional]

Return type

AddPersonPictureResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

deletePerson

DeletePersonResponse deletePerson(id)

Delete a person

Marks a person 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.PersonsApi();
let id = 56; // Number | ID of a person
apiInstance.deletePerson(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of a person

Return type

DeletePersonResponse

Authorization

api_key, oauth2

HTTP request headers

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

deletePersonFollower

DeletePersonResponse deletePersonFollower(id, followerId)

Deletes a follower from a person.

Delete a follower from a person

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';

let apiInstance = new Pipedrive.PersonsApi();
let id = 56; // Number | ID of a person
let followerId = 56; // Number | ID of the follower
apiInstance.deletePersonFollower(id, followerId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of a person
followerId Number ID of the follower

Return type

DeletePersonResponse

Authorization

api_key

HTTP request headers

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

deletePersonPicture

DeletePersonResponse deletePersonPicture(id)

Delete person picture

Delete person picture

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.PersonsApi();
let id = 56; // Number | ID of a person
apiInstance.deletePersonPicture(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of a person

Return type

DeletePersonResponse

Authorization

api_key, oauth2

HTTP request headers

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

deletePersons

DeletePersonsInBulkResponse deletePersons(opts)

Delete multiple persons in bulk

Marks multiple persons 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.PersonsApi();
let opts = {
  'ids': "ids_example" // String | Comma-separated IDs that will be deleted
};
apiInstance.deletePersons(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
ids String Comma-separated IDs that will be deleted [optional]

Return type

DeletePersonsInBulkResponse

Authorization

api_key, oauth2

HTTP request headers

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

findPersonByName

Object findPersonByName(term, opts)

Find persons by name

<strong>This endpoint is deprecated. Please use <a href=&quot;https://developers.pipedrive.com/docs/api/v1/#!/Persons/get_persons_search\&quot;&gt;/v1/persons/search&lt;/a> or <a href=&quot;https://developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch\&quot;&gt;/v1/itemSearch&lt;/a> instead</strong>. <br> Searches all persons by their name.

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.PersonsApi();
let term = "term_example"; // String | Search term to look for
let opts = {
  'orgId': 56, // Number | ID of the organization person is associated with.
  'start': 0, // Number | Pagination start
  'limit': 56, // Number | Items shown per page
  'searchByEmail': new Pipedrive.NumberBoolean() // NumberBoolean | When enabled, term will only be matched against email addresses of people. Default: false
};
apiInstance.findPersonByName(term, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
term String Search term to look for
orgId Number ID of the organization person is associated with. [optional]
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]
searchByEmail NumberBoolean When enabled, term will only be matched against email addresses of people. Default: false [optional]

Return type

Object

Authorization

api_key, oauth2

HTTP request headers

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

getPerson

GetPersonDetailsResponse getPerson(id)

Get details of a person

Returns details of a person. Note that this also returns some additional fields which are not present when asking for all persons. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the 'key' value of personFields.

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.PersonsApi();
let id = 56; // Number | ID of a person
apiInstance.getPerson(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of a person

Return type

GetPersonDetailsResponse

Authorization

api_key, oauth2

HTTP request headers

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

getPersonActivities

ListActivitiesResponse getPersonActivities(id, opts)

List activities associated with a person

Lists activities associated with a person.

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.PersonsApi();
let id = 56; // Number | ID of a person
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.getPersonActivities(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 a person
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

ListActivitiesResponse

Authorization

api_key, oauth2

HTTP request headers

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

getPersonDeals

ListDealsResponse getPersonDeals(id, opts)

List deals associated with a person

Lists deals associated with a person.

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.PersonsApi();
let id = 56; // Number | ID of a person
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56, // Number | Items shown per page
  'status': "'all_not_deleted'", // String | Only fetch deals with specific status. If omitted, all not deleted deals are fetched.
  'sort': "sort_example" // String | 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).
};
apiInstance.getPersonDeals(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 a person
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]
status String Only fetch deals with specific status. If omitted, all not deleted deals are fetched. [optional] [default to 'all_not_deleted']
sort String 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]

Return type

ListDealsResponse

Authorization

api_key, oauth2

HTTP request headers

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

getPersonFiles

ListFilesResponse getPersonFiles(id, opts)

List files attached to a person

Lists files associated with a person.

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.PersonsApi();
let id = 56; // Number | ID of a person
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56, // Number | Items shown per page
  'includeDeletedFiles': new Pipedrive.NumberBoolean(), // NumberBoolean | When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work.
  'sort': "sort_example" // String | 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.getPersonFiles(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 a person
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]
includeDeletedFiles NumberBoolean When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. [optional]
sort String 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

getPersonFollowers

ListFollowersResponse getPersonFollowers(id)

List followers of a person

Lists the followers of a person.

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.PersonsApi();
let id = 56; // Number | ID of a person
apiInstance.getPersonFollowers(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of a person

Return type

ListFollowersResponse

Authorization

api_key, oauth2

HTTP request headers

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

getPersonMailMessages

ListMailMessagesResponse getPersonMailMessages(id, opts)

List mail messages associated with a person

Lists mail messages associated with a person.

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.PersonsApi();
let id = 56; // Number | ID of a person
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56 // Number | Items shown per page
};
apiInstance.getPersonMailMessages(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 a person
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

getPersonProducts

ListPersonProductsResponse getPersonProducts(id, opts)

List products associated with a person

Lists products associated with a person.

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';

let apiInstance = new Pipedrive.PersonsApi();
let id = 56; // Number | ID of a person
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56 // Number | Items shown per page
};
apiInstance.getPersonProducts(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 a person
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]

Return type

ListPersonProductsResponse

Authorization

api_key

HTTP request headers

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

getPersonUpdates

PersonFlowResponse getPersonUpdates(id, opts)

List updates about a person

Lists updates about a person.

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.PersonsApi();
let id = 56; // Number | ID of a person
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 - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document)
};
apiInstance.getPersonUpdates(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 a person
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]
allChanges 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 - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) [optional]

Return type

PersonFlowResponse

Authorization

api_key, oauth2

HTTP request headers

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

getPersonUsers

ListPermittedUsersResponse2 getPersonUsers(id)

List permitted users

List users permitted to access a person

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';

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

Parameters

Name Type Description Notes
id Number ID of a person

Return type

ListPermittedUsersResponse2

Authorization

api_key

HTTP request headers

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

getPersons

GetAllPersonsResponse getPersons(opts)

Get all persons

Returns all persons

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.PersonsApi();
let opts = {
  'userId': 56, // Number | If supplied, only persons owned by the given user will be returned.
  'filterId': 56, // Number | ID of the filter to use.
  'firstChar': "firstChar_example", // String | If supplied, only persons whose name starts with the specified letter will be returned (case insensitive).
  'start': 0, // Number | Pagination start
  'limit': 56, // Number | Items shown per page
  'sort': "sort_example" // String | 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).
};
apiInstance.getPersons(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
userId Number If supplied, only persons owned by the given user will be returned. [optional]
filterId Number ID of the filter to use. [optional]
firstChar String If supplied, only persons whose name starts with the specified letter will be returned (case insensitive). [optional]
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]
sort String 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]

Return type

GetAllPersonsResponse

Authorization

api_key, oauth2

HTTP request headers

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

mergePersons

MergePersonsResponse mergePersons(id, mergeWithId)

Merge two persons

Merges a person with another person. For more information on how to merge two persons, see <a href=&quot;https://pipedrive.readme.io/docs/merging-two-persons\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>this tutorial</a>.

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.PersonsApi();
let id = 56; // Number | ID of a person
let mergeWithId = 56; // Number | The ID of the Person that will not be overwritten. This Person’s data will be prioritized in case of conflict with the other Person.
apiInstance.mergePersons(id, mergeWithId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of a person
mergeWithId Number The ID of the Person that will not be overwritten. This Person’s data will be prioritized in case of conflict with the other Person.

Return type

MergePersonsResponse

Authorization

api_key, oauth2

HTTP request headers

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

searchPersons

PersonSearchResponse searchPersons(term, opts)

Search persons

Searches all Persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of <a href=&quot;https://developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch\&quot;&gt;/v1/itemSearch&lt;/a> with a narrower OAuth scope. Found Persons can be filtered by Organization ID.

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.PersonsApi();
let term = "term_example"; // String | The search term to look for. Minimum 2 characters (or 1 if using exact_match).
let opts = {
  'fields': "fields_example", // String | A comma-separated string array. The fields to perform the search from. Defaults to all of them.
  'exactMatch': true, // Boolean | When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive.
  'organizationId': 56, // Number | Will filter Deals by the provided Organization ID. The upper limit of found Deals associated with the Organization 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.searchPersons(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).
fields String A comma-separated string array. The fields to perform the search from. Defaults to all of them. [optional]
exactMatch Boolean When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. [optional]
organizationId Number Will filter Deals by the provided Organization ID. The upper limit of found Deals associated with the Organization is 2000. [optional]
includeFields 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

PersonSearchResponse

Authorization

api_key, oauth2

HTTP request headers

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

updatePerson

UpdatePersonResponse updatePerson(id, opts)

Update a person

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

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.PersonsApi();
let id = 56; // Number | ID of a person
let opts = {
  'basicPerson': new Pipedrive.BasicPerson() // BasicPerson | 
};
apiInstance.updatePerson(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 a person
basicPerson BasicPerson [optional]

Return type

UpdatePersonResponse

Authorization

api_key, oauth2

HTTP request headers

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