Skip to content

Instantly share code, notes, and snippets.

@markstreich
Last active November 5, 2022 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markstreich/656c17e737d504f2c530faab697342d4 to your computer and use it in GitHub Desktop.
Save markstreich/656c17e737d504f2c530faab697342d4 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
// see my comment here: https://github.com/pipedrive/client-nodejs/issues/340
/* eslint-disable max-classes-per-file */
declare module 'pipedrive' {
export class ApiClient {
authentications: any;
}
export class DealsApi {
constructor(client: any);
getDeals(
options: paths['/deals']['get']['parameters']['query']
): Promise<
paths['/deals']['get']['responses']['200']['content']['application/json']
>;
}
}
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
interface paths {
'/activities': {
/** Returns all activities assigned to a particular user. */
get: operations['getActivities'];
/** Adds a new activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-an-activity" target="_blank" rel="noopener noreferrer">adding an activity</a>. */
post: operations['addActivity'];
/** Marks multiple activities as deleted. After 30 days, the activities will be permanently deleted. */
delete: operations['deleteActivities'];
};
'/activities/{id}': {
/** Returns the details of a specific activity. */
get: operations['getActivity'];
/** Updates an activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). */
put: operations['updateActivity'];
/** Marks an activity as deleted. After 30 days, the activity will be permanently deleted. */
delete: operations['deleteActivity'];
};
'/activityFields': {
/** Returns all activity fields. */
get: operations['getActivityFields'];
};
'/activityTypes': {
/** Returns all activity types. */
get: operations['getActivityTypes'];
/** Adds a new activity type. */
post: operations['addActivityType'];
/** Marks multiple activity types as deleted. */
delete: operations['deleteActivityTypes'];
};
'/activityTypes/{id}': {
/** Updates an activity type. */
put: operations['updateActivityType'];
/** Marks an activity type as deleted. */
delete: operations['deleteActivityType'];
};
'/billing/subscriptions/addons': {
/** Returns the add-ons for a single company. */
get: operations['getCompanyAddons'];
};
'/callLogs': {
/** Returns all call logs assigned to a particular user. */
get: operations['getUserCallLogs'];
/** Adds a new call log. */
post: operations['addCallLog'];
};
'/callLogs/{id}': {
/** Returns details of a specific call log. */
get: operations['getCallLog'];
/** Deletes a call log. If there is an audio recording attached to it, it will also be deleted. The related activity will not be removed by this request. If you want to remove the related activities, please use the endpoint which is specific for activities. */
delete: operations['deleteCallLog'];
};
'/callLogs/{id}/recordings': {
/** Adds an audio recording to the call log. That audio can be played by those who have access to the call log object. */
post: operations['addCallLogAudioFile'];
};
'/channels': {
/** Adds a new messaging channel, only admins are able to register new channels. It will use the getConversations endpoint to fetch conversations, participants and messages afterward. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). */
post: operations['addChannel'];
};
'/channels/{id}': {
/** Deletes an existing messenger’s channel and all related entities (conversations and messages). To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). */
delete: operations['deleteChannel'];
};
'/channels/messages/receive': {
/** Adds a message to a conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). */
post: operations['receiveMessage'];
};
'/channels/{channel-id}/conversations/{conversation-id}': {
/** Deletes an existing conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). */
delete: operations['deleteConversation'];
};
'/currencies': {
/** Returns all supported currencies in given account which should be used when saving monetary values with other objects. The `code` parameter of the returning objects is the currency code according to ISO 4217 for all non-custom currencies. */
get: operations['getCurrencies'];
};
'/deals': {
/** Returns all deals. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/getting-all-deals" target="_blank" rel="noopener noreferrer">getting all deals</a>. */
get: operations['getDeals'];
/** Adds a new deal. 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="https://pipedrive.readme.io/docs/creating-a-deal" target="_blank" rel="noopener noreferrer">adding a deal</a>. */
post: operations['addDeal'];
/** Marks multiple deals as deleted. After 30 days, the deals will be permanently deleted. */
delete: operations['deleteDeals'];
};
'/deals/search': {
/** Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of <a href="https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem">/v1/itemSearch</a> with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. */
get: operations['searchDeals'];
};
'/deals/summary': {
/** Returns a summary of all the deals. */
get: operations['getDealsSummary'];
};
'/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`. */
get: operations['getDealsTimeline'];
};
'/deals/{id}': {
/** 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="https://pipedrive.readme.io/docs/getting-details-of-a-deal" target="_blank" rel="noopener noreferrer">getting details of a deal</a>. */
get: operations['getDeal'];
/** Updates the properties of a deal. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/updating-a-deal" target="_blank" rel="noopener noreferrer">updating a deal</a>. */
put: operations['updateDeal'];
/** Marks a deal as deleted. After 30 days, the deal will be permanently deleted. */
delete: operations['deleteDeal'];
};
'/deals/{id}/activities': {
/** Lists activities associated with a deal. */
get: operations['getDealActivities'];
};
'/deals/{id}/duplicate': {
/** Duplicates a deal. */
post: operations['duplicateDeal'];
};
'/deals/{id}/files': {
/** Lists files associated with a deal. */
get: operations['getDealFiles'];
};
'/deals/{id}/flow': {
/** Lists updates about a deal. */
get: operations['getDealUpdates'];
};
'/deals/{id}/followers': {
/** Lists the followers of a deal. */
get: operations['getDealFollowers'];
/** Adds a follower to a deal. */
post: operations['addDealFollower'];
};
'/deals/{id}/followers/{follower_id}': {
/** Deletes a follower from a deal. */
delete: operations['deleteDealFollower'];
};
'/deals/{id}/mailMessages': {
/** Lists mail messages associated with a deal. */
get: operations['getDealMailMessages'];
};
'/deals/{id}/merge': {
/** Merges a deal with another deal. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/merging-two-deals" target="_blank" rel="noopener noreferrer">merging two deals</a>. */
put: operations['mergeDeals'];
};
'/deals/{id}/participants': {
/** Lists the participants associated with a deal.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. */
get: operations['getDealParticipants'];
/** Adds a participant to a deal. */
post: operations['addDealParticipant'];
};
'/deals/{id}/participants/{deal_participant_id}': {
/** Deletes a participant from a deal. */
delete: operations['deleteDealParticipant'];
};
'/deals/{id}/permittedUsers': {
/** Lists the users permitted to access a deal. */
get: operations['getDealUsers'];
};
'/deals/{id}/persons': {
/** Lists all persons associated with a deal, regardless of whether the person is the primary contact of the deal, or added as a participant. */
get: operations['getDealPersons'];
};
'/deals/{id}/products': {
/** Lists products attached to a deal. */
get: operations['getDealProducts'];
/** Adds a product to the deal. */
post: operations['addDealProduct'];
};
'/deals/{id}/products/{product_attachment_id}': {
/** Updates product attachment details. */
put: operations['updateDealProduct'];
/** Deletes a product attachment from a deal, using the `product_attachment_id`. */
delete: operations['deleteDealProduct'];
};
'/dealFields': {
/** Returns data about all deal fields. */
get: operations['getDealFields'];
/** Adds a new deal field. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-new-custom-field" target="_blank" rel="noopener noreferrer">adding a new custom field</a>. */
post: operations['addDealField'];
/** Marks multiple deal fields as deleted. */
delete: operations['deleteDealFields'];
};
'/dealFields/{id}': {
/** Returns data about a specific deal field. */
get: operations['getDealField'];
/** Updates a deal field. For more information, see the tutorial for <a href=" https://pipedrive.readme.io/docs/updating-custom-field-value " target="_blank" rel="noopener noreferrer">updating custom fields' values</a>. */
put: operations['updateDealField'];
/** Marks a field as deleted. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/deleting-a-custom-field" target="_blank" rel="noopener noreferrer">deleting a custom field</a>. */
delete: operations['deleteDealField'];
};
'/files': {
/** Returns data about all files. */
get: operations['getFiles'];
/** Lets you upload a file and associate it with a deal, person, organization, activity or product. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-file" target="_blank" rel="noopener noreferrer">adding a file</a>. */
post: operations['addFile'];
};
'/files/remote': {
/** Creates a new empty file in the remote location (`googledrive`) that will be linked to the item you supply. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-remote-file" target="_blank" rel="noopener noreferrer">adding a remote file</a>. */
post: operations['addFileAndLinkIt'];
};
'/files/remoteLink': {
/** Links an existing remote file (`googledrive`) to the item you supply. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-remote-file" target="_blank" rel="noopener noreferrer">adding a remote file</a>. */
post: operations['linkFileToItem'];
};
'/files/{id}': {
/** Returns data about a specific file. */
get: operations['getFile'];
/** Updates the properties of a file. */
put: operations['updateFile'];
/** Marks a file as deleted. After 30 days, the file will be permanently deleted. */
delete: operations['deleteFile'];
};
'/files/{id}/download': {
/** Initializes a file download. */
get: operations['downloadFile'];
};
'/filters': {
/** Returns data about all filters. */
get: operations['getFilters'];
/** Adds a new filter, returns the ID upon success. Note that in the conditions JSON object only one first-level condition group is supported, and it must be glued with 'AND', and only two second level condition groups are supported of which one must be glued with 'AND' and the second with 'OR'. Other combinations do not work (yet) but the syntax supports introducing them in future. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-filter" target="_blank" rel="noopener noreferrer">adding a filter</a>. */
post: operations['addFilter'];
/** Marks multiple filters as deleted. */
delete: operations['deleteFilters'];
};
'/filters/helpers': {
/** Returns all supported filter helpers. It helps to know what conditions and helpers are available when you want to <a href="/docs/api/v1/Filters#addFilter">add</a> or <a href="/docs/api/v1/Filters#updateFilter">update</a> filters. Additionally, an exact date must be inserted in YYYY-MM-DD format and an exact time in HH:MM. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-filter" target="_blank" rel="noopener noreferrer">adding a filter</a>. */
get: operations['getFilterHelpers'];
};
'/filters/{id}': {
/** Returns data about a specific filter. Note that this also returns the condition lines of the filter. */
get: operations['getFilter'];
/** Updates an existing filter. */
put: operations['updateFilter'];
/** Marks a filter as deleted. */
delete: operations['deleteFilter'];
};
'/goals': {
/** Adds a new goal. Along with adding a new goal, a report is created to track the progress of your goal. */
post: operations['addGoal'];
};
'/goals/find': {
/** Returns data about goals based on criteria. For searching, append `{searchField}={searchValue}` to the URL, where `searchField` can be any one of the lowest-level fields in dot-notation (e.g. `type.params.pipeline_id`; `title`). `searchValue` should be the value you are looking for on that field. Additionally, `is_active=<true|false>` can be provided to search for only active/inactive goals. When providing `period.start`, `period.end` must also be provided and vice versa. */
get: operations['getGoals'];
};
'/goals/{id}': {
/** Updates an existing goal. */
put: operations['updateGoal'];
/** Marks a goal as deleted. */
delete: operations['deleteGoal'];
};
'/goals/{id}/results': {
/** Gets the progress of a goal for the specified period. */
get: operations['getGoalResult'];
};
'/itemSearch': {
/** Performs a search from your choice of item types and fields. */
get: operations['searchItem'];
};
'/itemSearch/field': {
/** Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products). */
get: operations['searchItemByField'];
};
'/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. */
get: operations['getLeads'];
/** Creates a lead. A lead always has to be linked to a person or an organization or both. All leads created through the Pipedrive API will have a lead source `API` assigned. Here's the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-lead" target="_blank" rel="noopener noreferrer">adding a lead</a>. 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 given in the <a href="https://pipedrive.readme.io/docs/updating-custom-field-value" target="_blank" rel="noopener noreferrer">updating custom fields' values tutorial</a>. */
post: operations['addLead'];
};
'/leads/{id}': {
/** 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. */
get: operations['getLead'];
/** Deletes a specific lead. */
delete: operations['deleteLead'];
/** 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 given in the <a href="https://pipedrive.readme.io/docs/updating-custom-field-value" target="_blank" rel="noopener noreferrer">updating custom fields’ values tutorial</a>. */
patch: operations['updateLead'];
};
'/leads/search': {
/** Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href="https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. */
get: operations['searchLeads'];
};
'/leadLabels': {
/** Returns details of all lead labels. This endpoint does not support pagination and all labels are always returned. */
get: operations['getLeadLabels'];
/** Creates a lead label. */
post: operations['addLeadLabel'];
};
'/leadLabels/{id}': {
/** Deletes a specific lead label. */
delete: operations['deleteLeadLabel'];
/** Updates one or more properties of a lead label. Only properties included in the request will be updated. */
patch: operations['updateLeadLabel'];
};
'/leadSources': {
/** Returns all lead sources. Please note that the list of lead sources is fixed, it cannot be modified. All leads created through the Pipedrive API will have a lead source `API` assigned. */
get: operations['getLeadSources'];
};
'/legacyTeams': {
/** Returns data about teams within the company. */
get: operations['getTeams'];
/** Adds a new team to the company and returns the created object. */
post: operations['addTeam'];
};
'/legacyTeams/{id}': {
/** Returns data about a specific team. */
get: operations['getTeam'];
/** Updates an existing team and returns the updated object. */
put: operations['updateTeam'];
};
'/legacyTeams/{id}/users': {
/** Returns a list of all user IDs within a team. */
get: operations['getTeamUsers'];
/** Adds users to an existing team. */
post: operations['addTeamUser'];
/** Deletes users from an existing team. */
delete: operations['deleteTeamUser'];
};
'/legacyTeams/user/{id}': {
/** Returns data about all teams which have the specified user as a member. */
get: operations['getUserTeams'];
};
'/mailbox/mailMessages/{id}': {
/** Returns data about a specific mail message. */
get: operations['getMailMessage'];
};
'/mailbox/mailThreads': {
/** Returns mail threads in a specified folder ordered by the most recent message within. */
get: operations['getMailThreads'];
};
'/mailbox/mailThreads/{id}': {
/** Returns a specific mail thread. */
get: operations['getMailThread'];
/** Updates the properties of a mail thread. */
put: operations['updateMailThreadDetails'];
/** Marks a mail thread as deleted. */
delete: operations['deleteMailThread'];
};
'/mailbox/mailThreads/{id}/mailMessages': {
/** Returns all the mail messages inside a specified mail thread. */
get: operations['getMailThreadMessages'];
};
'/notes': {
/** Returns all notes. */
get: operations['getNotes'];
/** Adds a new note. */
post: operations['addNote'];
};
'/notes/{id}': {
/** Returns details about a specific note. */
get: operations['getNote'];
/** Updates a note. */
put: operations['updateNote'];
/** Deletes a specific note. */
delete: operations['deleteNote'];
};
'/notes/{id}/comments': {
/** Returns all comments associated with a note. */
get: operations['getNoteComments'];
/** Adds a new comment to a note. */
post: operations['addNoteComment'];
};
'/notes/{id}/comments/{commentId}': {
/** Returns the details of a comment. */
get: operations['getComment'];
/** Updates a comment related to a note. */
put: operations['updateCommentForNote'];
/** Deletes a comment. */
delete: operations['deleteComment'];
};
'/noteFields': {
/** Returns data about all note fields. */
get: operations['getNoteFields'];
};
'/organizations': {
/** Returns all organizations. */
get: operations['getOrganizations'];
/** Adds a new organization. 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 organizationFields and look for `key` values. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-an-organization" target="_blank" rel="noopener noreferrer">adding an organization</a>. */
post: operations['addOrganization'];
/** Marks multiple organizations as deleted. After 30 days, the organizations will be permanently deleted. */
delete: operations['deleteOrganizations'];
};
'/organizations/search': {
/** Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of <a href="https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem">/v1/itemSearch</a> with a narrower OAuth scope. */
get: operations['searchOrganization'];
};
'/organizations/{id}': {
/** Returns the details of an organization. Note that this also returns some additional fields which are not present when asking for all organizations. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the `key` value of organizationFields. */
get: operations['getOrganization'];
/** Updates the properties of an organization. */
put: operations['updateOrganization'];
/** Marks an organization as deleted. After 30 days, the organization will be permanently deleted. */
delete: operations['deleteOrganization'];
};
'/organizations/{id}/activities': {
/** Lists activities associated with an organization. */
get: operations['getOrganizationActivities'];
};
'/organizations/{id}/deals': {
/** Lists deals associated with an organization. */
get: operations['getOrganizationDeals'];
};
'/organizations/{id}/files': {
/** Lists files associated with an organization. */
get: operations['getOrganizationFiles'];
};
'/organizations/{id}/flow': {
/** Lists updates about an organization. */
get: operations['getOrganizationUpdates'];
};
'/organizations/{id}/followers': {
/** Lists the followers of an organization. */
get: operations['getOrganizationFollowers'];
/** Adds a follower to an organization. */
post: operations['addOrganizationFollower'];
};
'/organizations/{id}/followers/{follower_id}': {
/** Deletes a follower from an organization. You can retrieve the `follower_id` from the <a href="https://developers.pipedrive.com/docs/api/v1/Organizations#getOrganizationFollowers">List followers of an organization</a> endpoint. */
delete: operations['deleteOrganizationFollower'];
};
'/organizations/{id}/mailMessages': {
/** Lists mail messages associated with an organization. */
get: operations['getOrganizationMailMessages'];
};
'/organizations/{id}/merge': {
/** Merges an organization with another organization. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/merging-two-organizations" target="_blank" rel="noopener noreferrer">merging two organizations</a>. */
put: operations['mergeOrganizations'];
};
'/organizations/{id}/permittedUsers': {
/** List users permitted to access an organization. */
get: operations['getOrganizationUsers'];
};
'/organizations/{id}/persons': {
/** Lists persons associated with an organization.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. */
get: operations['getOrganizationPersons'];
};
'/organizationFields': {
/** Returns data about all organization fields. */
get: operations['getOrganizationFields'];
/** Adds a new organization field. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-new-custom-field" target="_blank" rel="noopener noreferrer">adding a new custom field</a>. */
post: operations['addOrganizationField'];
/** Marks multiple fields as deleted. */
delete: operations['deleteOrganizationFields'];
};
'/organizationFields/{id}': {
/** Returns data about a specific organization field. */
get: operations['getOrganizationField'];
/** Updates an organization field. For more information, see the tutorial for <a href=" https://pipedrive.readme.io/docs/updating-custom-field-value " target="_blank" rel="noopener noreferrer">updating custom fields' values</a>. */
put: operations['updateOrganizationField'];
/** Marks a field as deleted. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/deleting-a-custom-field" target="_blank" rel="noopener noreferrer">deleting a custom field</a>. */
delete: operations['deleteOrganizationField'];
};
'/organizationRelationships': {
/** Gets all of the relationships for a supplied organization ID. */
get: operations['getOrganizationRelationships'];
/** Creates and returns an organization relationship. */
post: operations['addOrganizationRelationship'];
};
'/organizationRelationships/{id}': {
/** Finds and returns an organization relationship from its ID. */
get: operations['getOrganizationRelationship'];
/** Updates and returns an organization relationship. */
put: operations['updateOrganizationRelationship'];
/** Deletes an organization relationship and returns the deleted ID. */
delete: operations['deleteOrganizationRelationship'];
};
'/permissionSets': {
/** Returns data about all permission sets. */
get: operations['getPermissionSets'];
};
'/permissionSets/{id}': {
/** Returns data about a specific permission set. */
get: operations['getPermissionSet'];
};
'/permissionSets/{id}/assignments': {
/** Returns the list of assignments for a permission set. */
get: operations['getPermissionSetAssignments'];
};
'/persons': {
/** Returns all persons. */
get: operations['getPersons'];
/** 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.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `data.marketing_status` field. */
post: operations['addPerson'];
/** Marks multiple persons as deleted. After 30 days, the persons will be permanently deleted. */
delete: operations['deletePersons'];
};
'/persons/search': {
/** Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of <a href="https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem">/v1/itemSearch</a> with a narrower OAuth scope. Found persons can be filtered by organization ID. */
get: operations['searchPersons'];
};
'/persons/{id}': {
/** Returns the 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.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. */
get: operations['getPerson'];
/** Updates the properties of a person. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/updating-a-person" target="_blank" rel="noopener noreferrer">updating a person</a>.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `data.marketing_status` field. */
put: operations['updatePerson'];
/** Marks a person as deleted. After 30 days, the person will be permanently deleted. */
delete: operations['deletePerson'];
};
'/persons/{id}/activities': {
/** Lists activities associated with a person. */
get: operations['getPersonActivities'];
};
'/persons/{id}/deals': {
/** Lists deals associated with a person. */
get: operations['getPersonDeals'];
};
'/persons/{id}/files': {
/** Lists files associated with a person. */
get: operations['getPersonFiles'];
};
'/persons/{id}/flow': {
/** Lists updates about a person.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint's response will also include updates for the `marketing_status` field. */
get: operations['getPersonUpdates'];
};
'/persons/{id}/followers': {
/** Lists the followers of a person. */
get: operations['getPersonFollowers'];
/** Adds a follower to a person. */
post: operations['addPersonFollower'];
};
'/persons/{id}/followers/{follower_id}': {
/** Deletes a follower from a person. */
delete: operations['deletePersonFollower'];
};
'/persons/{id}/mailMessages': {
/** Lists mail messages associated with a person. */
get: operations['getPersonMailMessages'];
};
'/persons/{id}/merge': {
/** Merges a person with another person. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/merging-two-persons" target="_blank" rel="noopener noreferrer">merging two persons</a>. */
put: operations['mergePersons'];
};
'/persons/{id}/permittedUsers': {
/** List users permitted to access a person. */
get: operations['getPersonUsers'];
};
'/persons/{id}/picture': {
/** Adds 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. */
post: operations['addPersonPicture'];
/** Deletes a person’s picture. */
delete: operations['deletePersonPicture'];
};
'/persons/{id}/products': {
/** Lists products associated with a person. */
get: operations['getPersonProducts'];
};
'/personFields': {
/** Returns data about all person fields.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. */
get: operations['getPersonFields'];
/** Adds a new person field. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-new-custom-field" target="_blank" rel="noopener noreferrer">adding a new custom field</a>. */
post: operations['addPersonField'];
/** Marks multiple fields as deleted. */
delete: operations['deletePersonFields'];
};
'/personFields/{id}': {
/** Returns data about a specific person field. */
get: operations['getPersonField'];
/** Updates a person field. For more information, see the tutorial for <a href=" https://pipedrive.readme.io/docs/updating-custom-field-value " target="_blank" rel="noopener noreferrer">updating custom fields' values</a>. */
put: operations['updatePersonField'];
/** Marks a field as deleted. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/deleting-a-custom-field" target="_blank" rel="noopener noreferrer">deleting a custom field</a>. */
delete: operations['deletePersonField'];
};
'/pipelines': {
/** Returns data about all pipelines. */
get: operations['getPipelines'];
/** Adds a new pipeline. */
post: operations['addPipeline'];
};
'/pipelines/{id}': {
/** Returns data about a specific pipeline. Also returns the summary of the deals in this pipeline across its stages. */
get: operations['getPipeline'];
/** Updates the properties of a pipeline. */
put: operations['updatePipeline'];
/** Marks a pipeline as deleted. */
delete: operations['deletePipeline'];
};
'/pipelines/{id}/conversion_statistics': {
/** Returns all stage-to-stage conversion and pipeline-to-close rates for the given time period. */
get: operations['getPipelineConversionStatistics'];
};
'/pipelines/{id}/deals': {
/** Lists deals in a specific pipeline across all its stages. */
get: operations['getPipelineDeals'];
};
'/pipelines/{id}/movement_statistics': {
/** Returns statistics for deals movements for the given time period. */
get: operations['getPipelineMovementStatistics'];
};
'/products': {
/** Returns data about all products. */
get: operations['getProducts'];
/** Adds a new product to the Products inventory. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-product" target="_blank" rel="noopener noreferrer">adding a product</a>. */
post: operations['addProduct'];
};
'/products/search': {
/** Searches all products by name, code and/or custom fields. This endpoint is a wrapper of <a href="https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem">/v1/itemSearch</a> with a narrower OAuth scope. */
get: operations['searchProducts'];
};
'/products/{id}': {
/** Returns data about a specific product. */
get: operations['getProduct'];
/** Updates product data. */
put: operations['updateProduct'];
/** Marks a product as deleted. After 30 days, the product will be permanently deleted. */
delete: operations['deleteProduct'];
};
'/products/{id}/deals': {
/** Returns data about deals that have a product attached to it. */
get: operations['getProductDeals'];
};
'/products/{id}/files': {
/** Lists files associated with a product. */
get: operations['getProductFiles'];
};
'/products/{id}/followers': {
/** Lists the followers of a product. */
get: operations['getProductFollowers'];
/** Adds a follower to a product. */
post: operations['addProductFollower'];
};
'/products/{id}/followers/{follower_id}': {
/** Deletes a follower from a product. */
delete: operations['deleteProductFollower'];
};
'/products/{id}/permittedUsers': {
/** Lists users permitted to access a product. */
get: operations['getProductUsers'];
};
'/productFields': {
/** Returns data about all product fields. */
get: operations['getProductFields'];
/** Adds a new product field. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-new-custom-field" target="_blank" rel="noopener noreferrer">adding a new custom field</a>. */
post: operations['addProductField'];
/** Marks multiple fields as deleted. */
delete: operations['deleteProductFields'];
};
'/productFields/{id}': {
/** Returns data about a specific product field. */
get: operations['getProductField'];
/** Updates a product field. For more information, see the tutorial for <a href=" https://pipedrive.readme.io/docs/updating-custom-field-value " target="_blank" rel="noopener noreferrer">updating custom fields' values</a>. */
put: operations['updateProductField'];
/** Marks a product field as deleted. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/deleting-a-custom-field" target="_blank" rel="noopener noreferrer">deleting a custom field</a>. */
delete: operations['deleteProductField'];
};
'/recents': {
/** Returns data about all recent changes occurred after the given timestamp. */
get: operations['getRecents'];
};
'/roles': {
/** Returns all the roles within the company. */
get: operations['getRoles'];
/** Adds a new role. */
post: operations['addRole'];
};
'/roles/{id}': {
/** Returns the details of a specific role. */
get: operations['getRole'];
/** Updates the parent role and/or the name of a specific role. */
put: operations['updateRole'];
/** Marks a role as deleted. */
delete: operations['deleteRole'];
};
'/roles/{id}/assignments': {
/** Returns all users assigned to a role. */
get: operations['getRoleAssignments'];
/** Assigns a user to a role. */
post: operations['addRoleAssignment'];
/** Removes the assigned user from a role and adds to the default role. */
delete: operations['deleteRoleAssignment'];
};
'/roles/{id}/roles': {
/** Returns the direct children of a specific role. */
get: operations['getRoleSubRoles'];
};
'/roles/{id}/settings': {
/** Returns the visibility settings of a specific role. */
get: operations['getRoleSettings'];
/** Adds or updates the visibility setting for a role. */
post: operations['addOrUpdateRoleSetting'];
};
'/stages': {
/** Returns data about all stages. */
get: operations['getStages'];
/** Adds a new stage, returns the ID upon success. */
post: operations['addStage'];
/** Marks multiple stages as deleted. */
delete: operations['deleteStages'];
};
'/stages/{id}': {
/** Returns data about a specific stage. */
get: operations['getStage'];
/** Updates the properties of a stage. */
put: operations['updateStage'];
/** Marks a stage as deleted. */
delete: operations['deleteStage'];
};
'/stages/{id}/deals': {
/** Lists deals in a specific stage. */
get: operations['getStageDeals'];
};
'/subscriptions/{id}': {
/** Returns details of an installment or a recurring subscription. */
get: operations['getSubscription'];
/** Marks an installment or a recurring subscription as deleted. */
delete: operations['deleteSubscription'];
};
'/subscriptions/find/{dealId}': {
/** Returns details of an installment or a recurring subscription by the deal ID. */
get: operations['findSubscriptionByDeal'];
};
'/subscriptions/{id}/payments': {
/** Returns all payments of an installment or recurring subscription. */
get: operations['getSubscriptionPayments'];
};
'/subscriptions/recurring': {
/** Adds a new recurring subscription. */
post: operations['addRecurringSubscription'];
};
'/subscriptions/installment': {
/** Adds a new installment subscription. */
post: operations['addSubscriptionInstallment'];
};
'/subscriptions/recurring/{id}': {
/** Updates a recurring subscription. */
put: operations['updateRecurringSubscription'];
};
'/subscriptions/installment/{id}': {
/** Updates an installment subscription. */
put: operations['updateSubscriptionInstallment'];
};
'/subscriptions/recurring/{id}/cancel': {
/** Cancels a recurring subscription. */
put: operations['cancelRecurringSubscription'];
};
'/users': {
/** Returns data about all users within the company. */
get: operations['getUsers'];
/** Adds a new user to the company, returns the ID upon success. */
post: operations['addUser'];
};
'/users/find': {
/** Finds users by their name. */
get: operations['findUsersByName'];
};
'/users/me': {
/** Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note that the `locale` property means 'Date/number format' in the Pipedrive account settings, not the chosen language. */
get: operations['getCurrentUser'];
};
'/users/{id}': {
/** Returns data about a specific user within the company. */
get: operations['getUser'];
/** Updates the properties of a user. Currently, only `active_flag` can be updated. */
put: operations['updateUser'];
};
'/users/{id}/followers': {
/** Lists the followers of a specific user. */
get: operations['getUserFollowers'];
};
'/users/{id}/permissions': {
/** Lists aggregated permissions over all assigned permission sets for a user. */
get: operations['getUserPermissions'];
};
'/users/{id}/roleAssignments': {
/** Lists role assignments for a user. */
get: operations['getUserRoleAssignments'];
};
'/users/{id}/roleSettings': {
/** Lists the settings of user's assigned role. */
get: operations['getUserRoleSettings'];
};
'/userConnections': {
/** Returns data about all connections for the authorized user. */
get: operations['getUserConnections'];
};
'/userSettings': {
/** Lists the settings of an authorized user. Example response contains a shortened list of settings. */
get: operations['getUserSettings'];
};
'/webhooks': {
/** Returns data about all the Webhooks of a company. */
get: operations['getWebhooks'];
/** Creates a new Webhook and returns its details. Note that specifying an event which triggers the Webhook combines 2 parameters - `event_action` and `event_object`. E.g., use `*.*` for getting notifications about all events, `added.deal` for any newly added deals, `deleted.persons` for any deleted persons, etc. See <a href="https://pipedrive.readme.io/docs/guide-for-webhooks?ref=api_reference" target="_blank" rel="noopener noreferrer">the guide for Webhooks</a> for more details. */
post: operations['addWebhook'];
};
'/webhooks/{id}': {
/** Deletes the specified Webhook. */
delete: operations['deleteWebhook'];
};
}
interface components {}
interface operations {
/** Returns all activities assigned to a particular user. */
getActivities: {
parameters: {
query: {
/** The ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. */
user_id?: number;
/** The ID of the filter to use (will narrow down results if used together with `user_id` parameter) */
filter_id?: number;
/** The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. */
type?: string;
/** For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. */
limit?: number;
/** For pagination, the position that represents the first result for the page */
start?: number;
/** Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format. */
start_date?: string;
/** Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format. */
end_date?: string;
/** Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both done and not done activities. */
done?: 0 | 1;
};
};
responses: {
/** A list of activities */
200: {
content: {
'application/json': {
success?: boolean;
data?: ({
/**
* Format: date
* @description The due date of the activity. Format: YYYY-MM-DD
*/
due_date?: string;
/** @description The due time of the activity in UTC. Format: HH:MM */
due_time?: string;
/** @description The duration of the activity. Format: HH:MM */
duration?: string;
/** @description The ID of the deal this activity is associated with */
deal_id?: number;
/** @description The ID of the lead this activity is associated with */
lead_id?: string;
/** @description The ID of the person this activity is associated with */
person_id?: number;
/** @description The ID of the organization this activity is associated with */
org_id?: number;
/** @description The note of the activity (HTML format) */
note?: string;
/** @description The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. */
location?: string;
/** @description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. */
public_description?: string;
} & {
/** @description The activity ID, generated when the activity was created */
id?: number;
/** @description Whether the activity is done or not */
done?: boolean;
/** @description The subject of the activity */
subject?: string;
/** @description The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. */
type?: string;
/** @description The ID of the user whom the activity is assigned to */
user_id?: number;
/** @description List of multiple persons (participants) this activity is associated with */
participants?: { [key: string]: unknown }[] | null;
/**
* @description Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time.
* @enum {boolean}
*/
busy_flag?: true | false;
/** @description The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. */
attendees?: { [key: string]: unknown }[] | null;
/** @description The user's company ID */
company_id?: number;
/** @description If the activity references some other object, it is indicated here. For example, value `Salesphone` refers to activities created with Caller. */
reference_type?: string;
/** @description Together with the `reference_type`, gives the ID of the other object */
reference_id?: number;
/** @description The ID of Marketplace app, which is connected to this activity */
conference_meeting_client?: string;
/** @description The link to join the meeting which is associated with this activity */
conference_meeting_url?: string;
/** @description The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity */
conference_meeting_id?: string;
/** @description The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. */
marked_as_done_time?: string;
/** @description The date and time of latest notifications sent about this activity to the participants or the attendees of this activity */
last_notification_time?: string;
/** @description The ID of the user who triggered the sending of the latest notifications about this activity to the participants or the attendees of this activity */
last_notification_user_id?: number;
/** @description The ID of the language the notifications are sent in */
notification_language_id?: number;
/**
* Format: uuid
* @description The ID of the lead in the UUID format this activity is associated with
*/
lead_id?: string;
/** @description Whether the activity is active or not */
active_flag?: boolean;
/** @description The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
/** @description The ID of the user who was the last to update this activity */
update_user_id?: number;
/** @description For the activity which syncs to Google calendar, this is the Google event ID. NB! This field is related to old Google calendar sync and will be deprecated soon. */
gcal_event_id?: string;
/** @description The Google calendar ID that this activity syncs to. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_id?: string;
/** @description The Google calendar API etag (version) that is used for syncing this activity. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_etag?: string;
/** @description For activities that sync to an external calendar, this setting indicates if the activity syncs with context (what are the deals, persons, organizations this activity is related to) */
calendar_sync_include_context?: string;
/** @description The timezone the activity was created in an external calendar */
source_timezone?: string;
/** @description The rule for the recurrence of the activity. Is important for activities synced into Pipedrive from an external calendar. Example: "RRULE:FREQ=WEEKLY;BYDAY=WE" */
rec_rule?: string;
/** @description Additional rules for the recurrence of the activity, extend the `rec_rule`. Is important for activities synced into Pipedrive from an external calendar. */
rec_rule_extension?: string;
/** @description The ID of parent activity for a recurrent activity if the current activity is an exception to recurrence rules */
rec_master_activity_id?: number;
/** @description The list of recurring activity instances. It is in a structure as follows: `[{due_date: "2020-06-24", due_time: "10:00:00"}]` */
series?: { [key: string]: unknown }[];
/** @description The ID of the user who created the activity */
created_by_user_id?: number;
/** @description Subfield of location field. Indicates apartment/suite number. */
location_subpremise?: string;
/** @description Subfield of location field. Indicates house number. */
location_street_number?: string;
/** @description Subfield of location field. Indicates street name. */
location_route?: string;
/** @description Subfield of location field. Indicates district/sublocality. */
location_sublocality?: string;
/** @description Subfield of location field. Indicates city/town/village/locality. */
location_locality?: string;
/** @description Subfield of location field. Indicates state/county. */
location_admin_area_level_1?: string;
/** @description Subfield of location field. Indicates region. */
location_admin_area_level_2?: string;
/** @description Subfield of location field. Indicates country. */
location_country?: string;
/** @description Subfield of location field. Indicates ZIP/postal code. */
location_postal_code?: string;
/** @description Subfield of location field. Indicates full/combined address. */
location_formatted_address?: string;
/** @description Subfield of location field. Indicates latitude. */
location_lat?: number;
/** @description Subfield of location field. Indicates longitude. */
location_long?: number;
/** @description The name of the organization this activity is associated with */
org_name?: string;
/** @description The name of the person this activity is associated with */
person_name?: string;
/** @description The name of the deal this activity is associated with */
deal_title?: string;
/** @description The name of the user this activity is owned by */
owner_name?: string;
/** @description The BCC email address of the person */
person_dropbox_bcc?: string;
/** @description The BCC email address of the deal */
deal_dropbox_bcc?: string;
/** @description The ID of the user to whom the activity is assigned to. Equal to `user_id`. */
assigned_to_user_id?: number;
/** @description The file that is attached to this activity. For example, this can be a reference to an audio note file generated with Pipedrive mobile app. */
file?: { [key: string]: unknown };
})[];
additional_data?: {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
related_objects?: {
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
deal?: {
/** @description The ID of the deal which is associated with the item */
DEAL_ID?: {
/** @description The ID of the deal associated with the item */
id?: number;
/** @description The title of the deal associated with the item */
title?: string;
/** @description The status of the deal associated with the item */
status?: string;
/** @description The value of the deal that is associated with the item */
value?: number;
/** @description The currency of the deal value */
currency?: string;
/** @description The ID of the stage the deal is currently at */
stage_id?: number;
/** @description The ID of the pipeline the deal is in */
pipeline_id?: number;
};
};
person?: {
/** @description The ID of the person associated with the item */
PERSON_ID?: {
/** @description The ID of the person associated with the item */
id?: number;
/** @description The name of the person associated with the item */
name?: string;
/** @description The emails of the person associated with the item */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description Whether this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the item */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the item */
value?: string;
/** @description Whether this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the item */
owner_id?: number;
};
};
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
};
};
};
};
};
};
/** Adds a new activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-an-activity" target="_blank" rel="noopener noreferrer">adding an activity</a>. */
addActivity: {
responses: {
/** Created */
201: {
content: {
'application/json': {
success?: boolean;
/** activityResponseObject */
data?: {
/**
* Format: date
* @description The due date of the activity. Format: YYYY-MM-DD
*/
due_date?: string;
/** @description The due time of the activity in UTC. Format: HH:MM */
due_time?: string;
/** @description The duration of the activity. Format: HH:MM */
duration?: string;
/** @description The ID of the deal this activity is associated with */
deal_id?: number;
/** @description The ID of the lead this activity is associated with */
lead_id?: string;
/** @description The ID of the person this activity is associated with */
person_id?: number;
/** @description The ID of the organization this activity is associated with */
org_id?: number;
/** @description The note of the activity (HTML format) */
note?: string;
/** @description The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. */
location?: string;
/** @description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. */
public_description?: string;
} & {
/** @description The activity ID, generated when the activity was created */
id?: number;
/** @description Whether the activity is done or not */
done?: boolean;
/** @description The subject of the activity */
subject?: string;
/** @description The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. */
type?: string;
/** @description The ID of the user whom the activity is assigned to */
user_id?: number;
/** @description List of multiple persons (participants) this activity is associated with */
participants?: { [key: string]: unknown }[] | null;
/**
* @description Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time.
* @enum {boolean}
*/
busy_flag?: true | false;
/** @description The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. */
attendees?: { [key: string]: unknown }[] | null;
/** @description The user's company ID */
company_id?: number;
/** @description If the activity references some other object, it is indicated here. For example, value `Salesphone` refers to activities created with Caller. */
reference_type?: string;
/** @description Together with the `reference_type`, gives the ID of the other object */
reference_id?: number;
/** @description The ID of Marketplace app, which is connected to this activity */
conference_meeting_client?: string;
/** @description The link to join the meeting which is associated with this activity */
conference_meeting_url?: string;
/** @description The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity */
conference_meeting_id?: string;
/** @description The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. */
marked_as_done_time?: string;
/** @description The date and time of latest notifications sent about this activity to the participants or the attendees of this activity */
last_notification_time?: string;
/** @description The ID of the user who triggered the sending of the latest notifications about this activity to the participants or the attendees of this activity */
last_notification_user_id?: number;
/** @description The ID of the language the notifications are sent in */
notification_language_id?: number;
/**
* Format: uuid
* @description The ID of the lead in the UUID format this activity is associated with
*/
lead_id?: string;
/** @description Whether the activity is active or not */
active_flag?: boolean;
/** @description The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
/** @description The ID of the user who was the last to update this activity */
update_user_id?: number;
/** @description For the activity which syncs to Google calendar, this is the Google event ID. NB! This field is related to old Google calendar sync and will be deprecated soon. */
gcal_event_id?: string;
/** @description The Google calendar ID that this activity syncs to. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_id?: string;
/** @description The Google calendar API etag (version) that is used for syncing this activity. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_etag?: string;
/** @description For activities that sync to an external calendar, this setting indicates if the activity syncs with context (what are the deals, persons, organizations this activity is related to) */
calendar_sync_include_context?: string;
/** @description The timezone the activity was created in an external calendar */
source_timezone?: string;
/** @description The rule for the recurrence of the activity. Is important for activities synced into Pipedrive from an external calendar. Example: "RRULE:FREQ=WEEKLY;BYDAY=WE" */
rec_rule?: string;
/** @description Additional rules for the recurrence of the activity, extend the `rec_rule`. Is important for activities synced into Pipedrive from an external calendar. */
rec_rule_extension?: string;
/** @description The ID of parent activity for a recurrent activity if the current activity is an exception to recurrence rules */
rec_master_activity_id?: number;
/** @description The list of recurring activity instances. It is in a structure as follows: `[{due_date: "2020-06-24", due_time: "10:00:00"}]` */
series?: { [key: string]: unknown }[];
/** @description The ID of the user who created the activity */
created_by_user_id?: number;
/** @description Subfield of location field. Indicates apartment/suite number. */
location_subpremise?: string;
/** @description Subfield of location field. Indicates house number. */
location_street_number?: string;
/** @description Subfield of location field. Indicates street name. */
location_route?: string;
/** @description Subfield of location field. Indicates district/sublocality. */
location_sublocality?: string;
/** @description Subfield of location field. Indicates city/town/village/locality. */
location_locality?: string;
/** @description Subfield of location field. Indicates state/county. */
location_admin_area_level_1?: string;
/** @description Subfield of location field. Indicates region. */
location_admin_area_level_2?: string;
/** @description Subfield of location field. Indicates country. */
location_country?: string;
/** @description Subfield of location field. Indicates ZIP/postal code. */
location_postal_code?: string;
/** @description Subfield of location field. Indicates full/combined address. */
location_formatted_address?: string;
/** @description Subfield of location field. Indicates latitude. */
location_lat?: number;
/** @description Subfield of location field. Indicates longitude. */
location_long?: number;
/** @description The name of the organization this activity is associated with */
org_name?: string;
/** @description The name of the person this activity is associated with */
person_name?: string;
/** @description The name of the deal this activity is associated with */
deal_title?: string;
/** @description The name of the user this activity is owned by */
owner_name?: string;
/** @description The BCC email address of the person */
person_dropbox_bcc?: string;
/** @description The BCC email address of the deal */
deal_dropbox_bcc?: string;
/** @description The ID of the user to whom the activity is assigned to. Equal to `user_id`. */
assigned_to_user_id?: number;
/** @description The file that is attached to this activity. For example, this can be a reference to an audio note file generated with Pipedrive mobile app. */
file?: { [key: string]: unknown };
};
additional_data?: {
/** @description This field will be deprecated */
updates_story_id?: number;
};
related_objects?: {
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
deal?: {
/** @description The ID of the deal which is associated with the item */
DEAL_ID?: {
/** @description The ID of the deal associated with the item */
id?: number;
/** @description The title of the deal associated with the item */
title?: string;
/** @description The status of the deal associated with the item */
status?: string;
/** @description The value of the deal that is associated with the item */
value?: number;
/** @description The currency of the deal value */
currency?: string;
/** @description The ID of the stage the deal is currently at */
stage_id?: number;
/** @description The ID of the pipeline the deal is in */
pipeline_id?: number;
};
};
person?: {
/** @description The ID of the person associated with the item */
PERSON_ID?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the person associated with the item */
id?: number;
/** @description The name of the person associated with the item */
name?: string;
/** @description The emails of the person associated with the item */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description Whether this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the item */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the item */
value?: string;
/** @description Whether this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the item */
owner_id?: number;
};
};
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
} & ({
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
});
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/**
* Format: date
* @description The due date of the activity. Format: YYYY-MM-DD
*/
due_date?: string;
/** @description The due time of the activity in UTC. Format: HH:MM */
due_time?: string;
/** @description The duration of the activity. Format: HH:MM */
duration?: string;
/** @description The ID of the deal this activity is associated with */
deal_id?: number;
/** @description The ID of the lead this activity is associated with */
lead_id?: string;
/** @description The ID of the person this activity is associated with */
person_id?: number;
/** @description The ID of the organization this activity is associated with */
org_id?: number;
/** @description The note of the activity (HTML format) */
note?: string;
/** @description The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. */
location?: string;
/** @description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. */
public_description?: string;
} & {
/** @description The subject of the activity. When value for subject is not set, it will be given a default value `Call`. */
subject?: string;
/** @description The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. When value for type is not set, it will be given a default value `Call`. */
type?: string;
/** @description The ID of the user whom the activity is assigned to. If omitted, the activity is assigned to the authorized user. */
user_id?: number;
/** @description List of multiple persons (participants) this activity is associated with. If omitted, single participant from `person_id` field is used. It requires a structure as follows: `[{"person_id":1,"primary_flag":true}]` */
participants?: { [key: string]: unknown }[];
/**
* @description Set the activity as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with `null`. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time.
* @enum {boolean}
*/
busy_flag?: true | false;
/** @description The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. It requires a structure as follows: `[{"email_address":"mail@example.org"}]` or `[{"person_id":1, "email_address":"mail@example.org"}]` */
attendees?: { [key: string]: unknown }[];
/** @description Whether the activity is done or not. 0 = Not done, 1 = Done */
done?: 0 | 1;
};
};
};
};
/** Marks multiple activities as deleted. After 30 days, the activities will be permanently deleted. */
deleteActivities: {
parameters: {
query: {
/** The comma-separated IDs of activities that will be deleted */
ids: string;
};
};
responses: {
/** The activities were successfully deleted */
200: {
content: {
'application/json': {
success?: boolean;
data?: {
/** @description An array of the IDs of activities that were deleted */
id?: number[];
};
};
};
};
};
};
/** Returns the details of a specific activity. */
getActivity: {
parameters: {
path: {
/** The ID of the activity */
id: number;
};
};
responses: {
/** The request was successful */
200: {
content: {
'application/json': {
success?: boolean;
/** activityResponseObject */
data?: {
/**
* Format: date
* @description The due date of the activity. Format: YYYY-MM-DD
*/
due_date?: string;
/** @description The due time of the activity in UTC. Format: HH:MM */
due_time?: string;
/** @description The duration of the activity. Format: HH:MM */
duration?: string;
/** @description The ID of the deal this activity is associated with */
deal_id?: number;
/** @description The ID of the lead this activity is associated with */
lead_id?: string;
/** @description The ID of the person this activity is associated with */
person_id?: number;
/** @description The ID of the organization this activity is associated with */
org_id?: number;
/** @description The note of the activity (HTML format) */
note?: string;
/** @description The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. */
location?: string;
/** @description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. */
public_description?: string;
} & {
/** @description The activity ID, generated when the activity was created */
id?: number;
/** @description Whether the activity is done or not */
done?: boolean;
/** @description The subject of the activity */
subject?: string;
/** @description The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. */
type?: string;
/** @description The ID of the user whom the activity is assigned to */
user_id?: number;
/** @description List of multiple persons (participants) this activity is associated with */
participants?: { [key: string]: unknown }[] | null;
/**
* @description Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time.
* @enum {boolean}
*/
busy_flag?: true | false;
/** @description The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. */
attendees?: { [key: string]: unknown }[] | null;
/** @description The user's company ID */
company_id?: number;
/** @description If the activity references some other object, it is indicated here. For example, value `Salesphone` refers to activities created with Caller. */
reference_type?: string;
/** @description Together with the `reference_type`, gives the ID of the other object */
reference_id?: number;
/** @description The ID of Marketplace app, which is connected to this activity */
conference_meeting_client?: string;
/** @description The link to join the meeting which is associated with this activity */
conference_meeting_url?: string;
/** @description The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity */
conference_meeting_id?: string;
/** @description The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. */
marked_as_done_time?: string;
/** @description The date and time of latest notifications sent about this activity to the participants or the attendees of this activity */
last_notification_time?: string;
/** @description The ID of the user who triggered the sending of the latest notifications about this activity to the participants or the attendees of this activity */
last_notification_user_id?: number;
/** @description The ID of the language the notifications are sent in */
notification_language_id?: number;
/**
* Format: uuid
* @description The ID of the lead in the UUID format this activity is associated with
*/
lead_id?: string;
/** @description Whether the activity is active or not */
active_flag?: boolean;
/** @description The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
/** @description The ID of the user who was the last to update this activity */
update_user_id?: number;
/** @description For the activity which syncs to Google calendar, this is the Google event ID. NB! This field is related to old Google calendar sync and will be deprecated soon. */
gcal_event_id?: string;
/** @description The Google calendar ID that this activity syncs to. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_id?: string;
/** @description The Google calendar API etag (version) that is used for syncing this activity. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_etag?: string;
/** @description For activities that sync to an external calendar, this setting indicates if the activity syncs with context (what are the deals, persons, organizations this activity is related to) */
calendar_sync_include_context?: string;
/** @description The timezone the activity was created in an external calendar */
source_timezone?: string;
/** @description The rule for the recurrence of the activity. Is important for activities synced into Pipedrive from an external calendar. Example: "RRULE:FREQ=WEEKLY;BYDAY=WE" */
rec_rule?: string;
/** @description Additional rules for the recurrence of the activity, extend the `rec_rule`. Is important for activities synced into Pipedrive from an external calendar. */
rec_rule_extension?: string;
/** @description The ID of parent activity for a recurrent activity if the current activity is an exception to recurrence rules */
rec_master_activity_id?: number;
/** @description The list of recurring activity instances. It is in a structure as follows: `[{due_date: "2020-06-24", due_time: "10:00:00"}]` */
series?: { [key: string]: unknown }[];
/** @description The ID of the user who created the activity */
created_by_user_id?: number;
/** @description Subfield of location field. Indicates apartment/suite number. */
location_subpremise?: string;
/** @description Subfield of location field. Indicates house number. */
location_street_number?: string;
/** @description Subfield of location field. Indicates street name. */
location_route?: string;
/** @description Subfield of location field. Indicates district/sublocality. */
location_sublocality?: string;
/** @description Subfield of location field. Indicates city/town/village/locality. */
location_locality?: string;
/** @description Subfield of location field. Indicates state/county. */
location_admin_area_level_1?: string;
/** @description Subfield of location field. Indicates region. */
location_admin_area_level_2?: string;
/** @description Subfield of location field. Indicates country. */
location_country?: string;
/** @description Subfield of location field. Indicates ZIP/postal code. */
location_postal_code?: string;
/** @description Subfield of location field. Indicates full/combined address. */
location_formatted_address?: string;
/** @description Subfield of location field. Indicates latitude. */
location_lat?: number;
/** @description Subfield of location field. Indicates longitude. */
location_long?: number;
/** @description The name of the organization this activity is associated with */
org_name?: string;
/** @description The name of the person this activity is associated with */
person_name?: string;
/** @description The name of the deal this activity is associated with */
deal_title?: string;
/** @description The name of the user this activity is owned by */
owner_name?: string;
/** @description The BCC email address of the person */
person_dropbox_bcc?: string;
/** @description The BCC email address of the deal */
deal_dropbox_bcc?: string;
/** @description The ID of the user to whom the activity is assigned to. Equal to `user_id`. */
assigned_to_user_id?: number;
/** @description The file that is attached to this activity. For example, this can be a reference to an audio note file generated with Pipedrive mobile app. */
file?: { [key: string]: unknown };
};
related_objects?: {
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
deal?: {
/** @description The ID of the deal which is associated with the item */
DEAL_ID?: {
/** @description The ID of the deal associated with the item */
id?: number;
/** @description The title of the deal associated with the item */
title?: string;
/** @description The status of the deal associated with the item */
status?: string;
/** @description The value of the deal that is associated with the item */
value?: number;
/** @description The currency of the deal value */
currency?: string;
/** @description The ID of the stage the deal is currently at */
stage_id?: number;
/** @description The ID of the pipeline the deal is in */
pipeline_id?: number;
};
};
person?: {
/** @description The ID of the person associated with the item */
PERSON_ID?: {
/** @description The ID of the person associated with the item */
id?: number;
/** @description The name of the person associated with the item */
name?: string;
/** @description The emails of the person associated with the item */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description Whether this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the item */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the item */
value?: string;
/** @description Whether this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the item */
owner_id?: number;
};
};
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
};
};
};
};
};
};
/** Updates an activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). */
updateActivity: {
parameters: {
path: {
/** The ID of the activity */
id: number;
};
};
responses: {
/** The request was successful */
200: {
content: {
'application/json': {
success?: boolean;
/** activityResponseObject */
data?: {
/**
* Format: date
* @description The due date of the activity. Format: YYYY-MM-DD
*/
due_date?: string;
/** @description The due time of the activity in UTC. Format: HH:MM */
due_time?: string;
/** @description The duration of the activity. Format: HH:MM */
duration?: string;
/** @description The ID of the deal this activity is associated with */
deal_id?: number;
/** @description The ID of the lead this activity is associated with */
lead_id?: string;
/** @description The ID of the person this activity is associated with */
person_id?: number;
/** @description The ID of the organization this activity is associated with */
org_id?: number;
/** @description The note of the activity (HTML format) */
note?: string;
/** @description The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. */
location?: string;
/** @description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. */
public_description?: string;
} & {
/** @description The activity ID, generated when the activity was created */
id?: number;
/** @description Whether the activity is done or not */
done?: boolean;
/** @description The subject of the activity */
subject?: string;
/** @description The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. */
type?: string;
/** @description The ID of the user whom the activity is assigned to */
user_id?: number;
/** @description List of multiple persons (participants) this activity is associated with */
participants?: { [key: string]: unknown }[] | null;
/**
* @description Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time.
* @enum {boolean}
*/
busy_flag?: true | false;
/** @description The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. */
attendees?: { [key: string]: unknown }[] | null;
/** @description The user's company ID */
company_id?: number;
/** @description If the activity references some other object, it is indicated here. For example, value `Salesphone` refers to activities created with Caller. */
reference_type?: string;
/** @description Together with the `reference_type`, gives the ID of the other object */
reference_id?: number;
/** @description The ID of Marketplace app, which is connected to this activity */
conference_meeting_client?: string;
/** @description The link to join the meeting which is associated with this activity */
conference_meeting_url?: string;
/** @description The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity */
conference_meeting_id?: string;
/** @description The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. */
marked_as_done_time?: string;
/** @description The date and time of latest notifications sent about this activity to the participants or the attendees of this activity */
last_notification_time?: string;
/** @description The ID of the user who triggered the sending of the latest notifications about this activity to the participants or the attendees of this activity */
last_notification_user_id?: number;
/** @description The ID of the language the notifications are sent in */
notification_language_id?: number;
/**
* Format: uuid
* @description The ID of the lead in the UUID format this activity is associated with
*/
lead_id?: string;
/** @description Whether the activity is active or not */
active_flag?: boolean;
/** @description The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
/** @description The ID of the user who was the last to update this activity */
update_user_id?: number;
/** @description For the activity which syncs to Google calendar, this is the Google event ID. NB! This field is related to old Google calendar sync and will be deprecated soon. */
gcal_event_id?: string;
/** @description The Google calendar ID that this activity syncs to. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_id?: string;
/** @description The Google calendar API etag (version) that is used for syncing this activity. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_etag?: string;
/** @description For activities that sync to an external calendar, this setting indicates if the activity syncs with context (what are the deals, persons, organizations this activity is related to) */
calendar_sync_include_context?: string;
/** @description The timezone the activity was created in an external calendar */
source_timezone?: string;
/** @description The rule for the recurrence of the activity. Is important for activities synced into Pipedrive from an external calendar. Example: "RRULE:FREQ=WEEKLY;BYDAY=WE" */
rec_rule?: string;
/** @description Additional rules for the recurrence of the activity, extend the `rec_rule`. Is important for activities synced into Pipedrive from an external calendar. */
rec_rule_extension?: string;
/** @description The ID of parent activity for a recurrent activity if the current activity is an exception to recurrence rules */
rec_master_activity_id?: number;
/** @description The list of recurring activity instances. It is in a structure as follows: `[{due_date: "2020-06-24", due_time: "10:00:00"}]` */
series?: { [key: string]: unknown }[];
/** @description The ID of the user who created the activity */
created_by_user_id?: number;
/** @description Subfield of location field. Indicates apartment/suite number. */
location_subpremise?: string;
/** @description Subfield of location field. Indicates house number. */
location_street_number?: string;
/** @description Subfield of location field. Indicates street name. */
location_route?: string;
/** @description Subfield of location field. Indicates district/sublocality. */
location_sublocality?: string;
/** @description Subfield of location field. Indicates city/town/village/locality. */
location_locality?: string;
/** @description Subfield of location field. Indicates state/county. */
location_admin_area_level_1?: string;
/** @description Subfield of location field. Indicates region. */
location_admin_area_level_2?: string;
/** @description Subfield of location field. Indicates country. */
location_country?: string;
/** @description Subfield of location field. Indicates ZIP/postal code. */
location_postal_code?: string;
/** @description Subfield of location field. Indicates full/combined address. */
location_formatted_address?: string;
/** @description Subfield of location field. Indicates latitude. */
location_lat?: number;
/** @description Subfield of location field. Indicates longitude. */
location_long?: number;
/** @description The name of the organization this activity is associated with */
org_name?: string;
/** @description The name of the person this activity is associated with */
person_name?: string;
/** @description The name of the deal this activity is associated with */
deal_title?: string;
/** @description The name of the user this activity is owned by */
owner_name?: string;
/** @description The BCC email address of the person */
person_dropbox_bcc?: string;
/** @description The BCC email address of the deal */
deal_dropbox_bcc?: string;
/** @description The ID of the user to whom the activity is assigned to. Equal to `user_id`. */
assigned_to_user_id?: number;
/** @description The file that is attached to this activity. For example, this can be a reference to an audio note file generated with Pipedrive mobile app. */
file?: { [key: string]: unknown };
};
related_objects?: {
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
deal?: {
/** @description The ID of the deal which is associated with the item */
DEAL_ID?: {
/** @description The ID of the deal associated with the item */
id?: number;
/** @description The title of the deal associated with the item */
title?: string;
/** @description The status of the deal associated with the item */
status?: string;
/** @description The value of the deal that is associated with the item */
value?: number;
/** @description The currency of the deal value */
currency?: string;
/** @description The ID of the stage the deal is currently at */
stage_id?: number;
/** @description The ID of the pipeline the deal is in */
pipeline_id?: number;
};
};
person?: {
/** @description The ID of the person associated with the item */
PERSON_ID?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the person associated with the item */
id?: number;
/** @description The name of the person associated with the item */
name?: string;
/** @description The emails of the person associated with the item */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description Whether this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the item */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the item */
value?: string;
/** @description Whether this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the item */
owner_id?: number;
};
};
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
} & ({
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
});
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/**
* Format: date
* @description The due date of the activity. Format: YYYY-MM-DD
*/
due_date?: string;
/** @description The due time of the activity in UTC. Format: HH:MM */
due_time?: string;
/** @description The duration of the activity. Format: HH:MM */
duration?: string;
/** @description The ID of the deal this activity is associated with */
deal_id?: number;
/** @description The ID of the lead this activity is associated with */
lead_id?: string;
/** @description The ID of the person this activity is associated with */
person_id?: number;
/** @description The ID of the organization this activity is associated with */
org_id?: number;
/** @description The note of the activity (HTML format) */
note?: string;
/** @description The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. */
location?: string;
/** @description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. */
public_description?: string;
} & {
/** @description The subject of the activity */
subject?: string;
/** @description The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. */
type?: string;
/** @description The ID of the user whom the activity is assigned to */
user_id?: number;
/** @description List of multiple persons (participants) this activity is associated with. It requires a structure as follows: `[{"person_id":1,"primary_flag":true}]` */
participants?: { [key: string]: unknown }[];
/**
* @description Set the activity as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with `null`. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time.
* @enum {boolean}
*/
busy_flag?: true | false;
/** @description The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. It requires a structure as follows: `[{"email_address":"mail@example.org"}]` or `[{"person_id":1, "email_address":"mail@example.org"}]` */
attendees?: { [key: string]: unknown }[];
/** @description Whether the activity is done or not. 0 = Not done, 1 = Done */
done?: 0 | 1;
};
};
};
};
/** Marks an activity as deleted. After 30 days, the activity will be permanently deleted. */
deleteActivity: {
parameters: {
path: {
/** The ID of the activity */
id: number;
};
};
responses: {
/** The activity was successfully deleted */
200: {
content: {
'application/json': {
success?: boolean;
data?: {
/** @description The ID of the activity that was deleted */
id?: number;
};
};
};
};
};
};
/** Returns all activity fields. */
getActivityFields: {
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Returns all activity types. */
getActivityTypes: {
responses: {
/** A list of activity types */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of activity types */
data?: {
/** @description The ID of the activity type */
id?: number;
/** @description The name of the activity type */
name?: string;
/**
* @description Icon graphic to use for representing this activity type
* @enum {string}
*/
icon_key?:
| 'task'
| 'email'
| 'meeting'
| 'deadline'
| 'call'
| 'lunch'
| 'calendar'
| 'downarrow'
| 'document'
| 'smartphone'
| 'camera'
| 'scissors'
| 'cogs'
| 'bubble'
| 'uparrow'
| 'checkbox'
| 'signpost'
| 'shuffle'
| 'addressbook'
| 'linegraph'
| 'picture'
| 'car'
| 'world'
| 'search'
| 'clip'
| 'sound'
| 'brush'
| 'key'
| 'padlock'
| 'pricetag'
| 'suitcase'
| 'finish'
| 'plane'
| 'loop'
| 'wifi'
| 'truck'
| 'cart'
| 'bulb'
| 'bell'
| 'presentation';
/** @description A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black) */
color?: string;
/** @description An order number for the activity type. Order numbers should be used to order the types in the activity type selections. */
order_nr?: number;
/** @description A string that is generated by the API based on the given name of the activity type upon creation */
key_string?: string;
/** @description The active flag of the activity type */
active_flag?: boolean;
/** @description Whether the activity type is a custom one or not */
is_custom_flag?: boolean;
/**
* Format: datetime
* @description The creation time of the activity type
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the activity type
*/
update_time?: string;
}[];
};
};
};
};
};
/** Adds a new activity type. */
addActivityType: {
responses: {
/** The activity type was successfully created */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the activity type */
id?: number;
/** @description The name of the activity type */
name?: string;
/**
* @description Icon graphic to use for representing this activity type
* @enum {string}
*/
icon_key?:
| 'task'
| 'email'
| 'meeting'
| 'deadline'
| 'call'
| 'lunch'
| 'calendar'
| 'downarrow'
| 'document'
| 'smartphone'
| 'camera'
| 'scissors'
| 'cogs'
| 'bubble'
| 'uparrow'
| 'checkbox'
| 'signpost'
| 'shuffle'
| 'addressbook'
| 'linegraph'
| 'picture'
| 'car'
| 'world'
| 'search'
| 'clip'
| 'sound'
| 'brush'
| 'key'
| 'padlock'
| 'pricetag'
| 'suitcase'
| 'finish'
| 'plane'
| 'loop'
| 'wifi'
| 'truck'
| 'cart'
| 'bulb'
| 'bell'
| 'presentation';
/** @description A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black) */
color?: string;
/** @description An order number for the activity type. Order numbers should be used to order the types in the activity type selections. */
order_nr?: number;
/** @description A string that is generated by the API based on the given name of the activity type upon creation */
key_string?: string;
/** @description The active flag of the activity type */
active_flag?: boolean;
/** @description Whether the activity type is a custom one or not */
is_custom_flag?: boolean;
/**
* Format: datetime
* @description The creation time of the activity type
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the activity type
*/
update_time?: string;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/**
* @description The name of the activity type
* @example call
*/
name: string;
/**
* @description Icon graphic to use for representing this activity type
* @enum {string}
*/
icon_key:
| 'task'
| 'email'
| 'meeting'
| 'deadline'
| 'call'
| 'lunch'
| 'calendar'
| 'downarrow'
| 'document'
| 'smartphone'
| 'camera'
| 'scissors'
| 'cogs'
| 'bubble'
| 'uparrow'
| 'checkbox'
| 'signpost'
| 'shuffle'
| 'addressbook'
| 'linegraph'
| 'picture'
| 'car'
| 'world'
| 'search'
| 'clip'
| 'sound'
| 'brush'
| 'key'
| 'padlock'
| 'pricetag'
| 'suitcase'
| 'finish'
| 'plane'
| 'loop'
| 'wifi'
| 'truck'
| 'cart'
| 'bulb'
| 'bell'
| 'presentation';
/**
* @description A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black)
* @example FFFFFF
*/
color?: string;
};
};
};
};
/** Marks multiple activity types as deleted. */
deleteActivityTypes: {
parameters: {
query: {
/** The comma-separated activity type IDs */
ids: string;
};
};
responses: {
/** The activity types were successfully deleted */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The IDs of the deleted activity types */
id?: number[];
};
};
};
};
};
};
/** Updates an activity type. */
updateActivityType: {
parameters: {
path: {
/** The ID of the activity type */
id: number;
};
};
responses: {
/** The activity type was successfully updated */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the activity type */
id?: number;
/** @description The name of the activity type */
name?: string;
/**
* @description Icon graphic to use for representing this activity type
* @enum {string}
*/
icon_key?:
| 'task'
| 'email'
| 'meeting'
| 'deadline'
| 'call'
| 'lunch'
| 'calendar'
| 'downarrow'
| 'document'
| 'smartphone'
| 'camera'
| 'scissors'
| 'cogs'
| 'bubble'
| 'uparrow'
| 'checkbox'
| 'signpost'
| 'shuffle'
| 'addressbook'
| 'linegraph'
| 'picture'
| 'car'
| 'world'
| 'search'
| 'clip'
| 'sound'
| 'brush'
| 'key'
| 'padlock'
| 'pricetag'
| 'suitcase'
| 'finish'
| 'plane'
| 'loop'
| 'wifi'
| 'truck'
| 'cart'
| 'bulb'
| 'bell'
| 'presentation';
/** @description A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black) */
color?: string;
/** @description An order number for the activity type. Order numbers should be used to order the types in the activity type selections. */
order_nr?: number;
/** @description A string that is generated by the API based on the given name of the activity type upon creation */
key_string?: string;
/** @description The active flag of the activity type */
active_flag?: boolean;
/** @description Whether the activity type is a custom one or not */
is_custom_flag?: boolean;
/**
* Format: datetime
* @description The creation time of the activity type
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the activity type
*/
update_time?: string;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the activity type */
name?: string;
/**
* @description Icon graphic to use for representing this activity type
* @enum {string}
*/
icon_key?:
| 'task'
| 'email'
| 'meeting'
| 'deadline'
| 'call'
| 'lunch'
| 'calendar'
| 'downarrow'
| 'document'
| 'smartphone'
| 'camera'
| 'scissors'
| 'cogs'
| 'bubble'
| 'uparrow'
| 'checkbox'
| 'signpost'
| 'shuffle'
| 'addressbook'
| 'linegraph'
| 'picture'
| 'car'
| 'world'
| 'search'
| 'clip'
| 'sound'
| 'brush'
| 'key'
| 'padlock'
| 'pricetag'
| 'suitcase'
| 'finish'
| 'plane'
| 'loop'
| 'wifi'
| 'truck'
| 'cart'
| 'bulb'
| 'bell'
| 'presentation';
/** @description A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black) */
color?: string;
/** @description An order number for this activity type. Order numbers should be used to order the types in the activity type selections. */
order_nr?: number;
};
};
};
};
/** Marks an activity type as deleted. */
deleteActivityType: {
parameters: {
path: {
/** The ID of the activity type */
id: number;
};
};
responses: {
/** The activity type was successfully deleted */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the activity type */
id?: number;
/** @description The name of the activity type */
name?: string;
/**
* @description Icon graphic to use for representing this activity type
* @enum {string}
*/
icon_key?:
| 'task'
| 'email'
| 'meeting'
| 'deadline'
| 'call'
| 'lunch'
| 'calendar'
| 'downarrow'
| 'document'
| 'smartphone'
| 'camera'
| 'scissors'
| 'cogs'
| 'bubble'
| 'uparrow'
| 'checkbox'
| 'signpost'
| 'shuffle'
| 'addressbook'
| 'linegraph'
| 'picture'
| 'car'
| 'world'
| 'search'
| 'clip'
| 'sound'
| 'brush'
| 'key'
| 'padlock'
| 'pricetag'
| 'suitcase'
| 'finish'
| 'plane'
| 'loop'
| 'wifi'
| 'truck'
| 'cart'
| 'bulb'
| 'bell'
| 'presentation';
/** @description A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black) */
color?: string;
/** @description An order number for the activity type. Order numbers should be used to order the types in the activity type selections. */
order_nr?: number;
/** @description A string that is generated by the API based on the given name of the activity type upon creation */
key_string?: string;
/** @description The active flag of the activity type */
active_flag?: boolean;
/** @description Whether the activity type is a custom one or not */
is_custom_flag?: boolean;
/**
* Format: datetime
* @description The creation time of the activity type
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the activity type
*/
update_time?: string;
};
};
};
};
};
};
/** Returns the add-ons for a single company. */
getCompanyAddons: {
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description An array of add-ons that the company has. */
data?: { [key: string]: unknown }[];
};
};
};
};
};
/** Returns all call logs assigned to a particular user. */
getUserCallLogs: {
parameters: {
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** A list of call logs. */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: ({
/** @description The ID of the owner of the call log. Please note that a user without account settings access cannot create call logs for other users. */
user_id?: number;
/** @description If specified, this activity will be converted into a call log, with the information provided. When this field is used, you don't need to specify `deal_id`, `person_id` or `org_id`, as they will be ignored in favor of the values already available in the activity. */
activity_id?: number;
/** @description The name of the activity this call is attached to */
subject?: string;
/** @description The duration of the call in seconds */
duration?: string;
/**
* @description Describes the outcome of the call
* @enum {string}
*/
outcome:
| 'connected'
| 'no_answer'
| 'left_message'
| 'left_voicemail'
| 'wrong_number'
| 'busy';
/** @description The number that made the call */
from_phone_number?: string;
/** @description The number called */
to_phone_number: string;
/**
* Format: date-time
* @description The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS.
*/
start_time: string;
/**
* Format: date-time
* @description The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS.
*/
end_time: string;
/** @description The ID of the person this call is associated with */
person_id?: number;
/** @description The ID of the organization this call is associated with */
org_id?: number;
/** @description The ID of the deal this call is associated with */
deal_id?: number;
/** @description The note for the call log in HTML format */
note?: string;
} & {
/** @description The call log ID, generated when the call log was created */
id?: string;
/** @description If the call log has an audio recording attached, the value should be true */
has_recording?: boolean;
/** @description The company ID of the owner of the call log */
company_id?: number;
})[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Adds a new call log. */
addCallLog: {
responses: {
/** The call log was successfully created. */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the owner of the call log. Please note that a user without account settings access cannot create call logs for other users. */
user_id?: number;
/** @description If specified, this activity will be converted into a call log, with the information provided. When this field is used, you don't need to specify `deal_id`, `person_id` or `org_id`, as they will be ignored in favor of the values already available in the activity. */
activity_id?: number;
/** @description The name of the activity this call is attached to */
subject?: string;
/** @description The duration of the call in seconds */
duration?: string;
/**
* @description Describes the outcome of the call
* @enum {string}
*/
outcome:
| 'connected'
| 'no_answer'
| 'left_message'
| 'left_voicemail'
| 'wrong_number'
| 'busy';
/** @description The number that made the call */
from_phone_number?: string;
/** @description The number called */
to_phone_number: string;
/**
* Format: date-time
* @description The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS.
*/
start_time: string;
/**
* Format: date-time
* @description The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS.
*/
end_time: string;
/** @description The ID of the person this call is associated with */
person_id?: number;
/** @description The ID of the organization this call is associated with */
org_id?: number;
/** @description The ID of the deal this call is associated with */
deal_id?: number;
/** @description The note for the call log in HTML format */
note?: string;
} & {
/** @description The call log ID, generated when the call log was created */
id?: string;
/** @description If the call log has an audio recording attached, the value should be true */
has_recording?: boolean;
/** @description The company ID of the owner of the call log */
company_id?: number;
};
};
};
};
/** The request contains wrong or incorrectly formatted arguments. */
400: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example "outcome" is required.
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
/** You don't have permission to access the resource. */
403: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example You don't have permission to change this resource.
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
/** A resource required to process the request was not found. */
404: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example A resource required for this operation was not found.
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
/** There was an error processing the request. */
500: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example An internal server error occurred
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The ID of the owner of the call log. Please note that a user without account settings access cannot create call logs for other users. */
user_id?: number;
/** @description If specified, this activity will be converted into a call log, with the information provided. When this field is used, you don't need to specify `deal_id`, `person_id` or `org_id`, as they will be ignored in favor of the values already available in the activity. */
activity_id?: number;
/** @description The name of the activity this call is attached to */
subject?: string;
/** @description The duration of the call in seconds */
duration?: string;
/**
* @description Describes the outcome of the call
* @enum {string}
*/
outcome:
| 'connected'
| 'no_answer'
| 'left_message'
| 'left_voicemail'
| 'wrong_number'
| 'busy';
/** @description The number that made the call */
from_phone_number?: string;
/** @description The number called */
to_phone_number: string;
/**
* Format: date-time
* @description The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS.
*/
start_time: string;
/**
* Format: date-time
* @description The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS.
*/
end_time: string;
/** @description The ID of the person this call is associated with */
person_id?: number;
/** @description The ID of the organization this call is associated with */
org_id?: number;
/** @description The ID of the deal this call is associated with */
deal_id?: number;
/** @description The note for the call log in HTML format */
note?: string;
};
};
};
};
/** Returns details of a specific call log. */
getCallLog: {
parameters: {
path: {
/** The ID received when you create the call log */
id: string;
};
};
responses: {
/** The requested call log object. */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the owner of the call log. Please note that a user without account settings access cannot create call logs for other users. */
user_id?: number;
/** @description If specified, this activity will be converted into a call log, with the information provided. When this field is used, you don't need to specify `deal_id`, `person_id` or `org_id`, as they will be ignored in favor of the values already available in the activity. */
activity_id?: number;
/** @description The name of the activity this call is attached to */
subject?: string;
/** @description The duration of the call in seconds */
duration?: string;
/**
* @description Describes the outcome of the call
* @enum {string}
*/
outcome:
| 'connected'
| 'no_answer'
| 'left_message'
| 'left_voicemail'
| 'wrong_number'
| 'busy';
/** @description The number that made the call */
from_phone_number?: string;
/** @description The number called */
to_phone_number: string;
/**
* Format: date-time
* @description The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS.
*/
start_time: string;
/**
* Format: date-time
* @description The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS.
*/
end_time: string;
/** @description The ID of the person this call is associated with */
person_id?: number;
/** @description The ID of the organization this call is associated with */
org_id?: number;
/** @description The ID of the deal this call is associated with */
deal_id?: number;
/** @description The note for the call log in HTML format */
note?: string;
} & {
/** @description The call log ID, generated when the call log was created */
id?: string;
/** @description If the call log has an audio recording attached, the value should be true */
has_recording?: boolean;
/** @description The company ID of the owner of the call log */
company_id?: number;
};
};
};
};
/** A resource required to process the request was not found. */
404: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example A resource required for this operation was not found.
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
};
};
/** Deletes a call log. If there is an audio recording attached to it, it will also be deleted. The related activity will not be removed by this request. If you want to remove the related activities, please use the endpoint which is specific for activities. */
deleteCallLog: {
parameters: {
path: {
/** The ID received when you create the call log */
id: string;
};
};
responses: {
/** The call log was successfully deleted. */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
};
};
};
/** You don't have permission to access the resource. */
403: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example You don't have permission to change this resource.
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
/** A resource required to process the request was not found. */
404: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example A resource required for this operation was not found.
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
/** The callLog you are trying to access is no longer available. */
410: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example The callLog you are trying to access is no longer available
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
/** There was an error processing the request. */
500: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example An internal server error occurred
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
};
};
/** Adds an audio recording to the call log. That audio can be played by those who have access to the call log object. */
addCallLogAudioFile: {
parameters: {
path: {
/** The ID received when you create the call log */
id: string;
};
};
responses: {
/** The audio recording was successfully added to the log. */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
};
};
};
/** A resource required to process the request was not found. */
404: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example A resource required for this operation was not found.
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
/** Recording for this call already exists. */
409: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example A recording for this call already exists
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
/** There was an error processing the request. */
500: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The description of the error
* @example An internal server error occurred
*/
error?: string;
/**
* @description A message describing how to solve the problem
* @example Please check developers.pipedrive.com for more information about Pipedrive API.
*/
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
};
requestBody: {
content: {
'multipart/form-data': {
/**
* Format: binary
* @description Audio file supported by the HTML5 specification
*/
file: string;
};
};
};
};
/** Adds a new messaging channel, only admins are able to register new channels. It will use the getConversations endpoint to fetch conversations, participants and messages afterward. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). */
addChannel: {
responses: {
/** The channel registered */
200: {
content: {
'application/json': {
/** @example true */
success?: boolean;
data?: {
/** @description The unique channel ID used internally in omnichannel-api and the frontend of the extension */
id?: string;
/**
* @description The name of the channel
* @example My Channel
*/
name?: string;
/**
* @description The URL for an icon that represents your channel
* @example http://some-domain.com/test.jpg
*/
avatar_url?: string;
/**
* Format: string
* @description The channel ID you specified while creating the channel
*/
provider_channel_id?: string;
/** @description The client_id of your app in Pipedrive marketplace */
marketplace_client_id?: string;
/**
* @description The ID of the user's company in Pipedrive
* @example 1
*/
pd_company_id?: number;
/**
* @description The ID of the user in Pipedrive
* @example 1
*/
pd_user_id?: number;
/**
* Format: date-time
* @description The date and time when your channel was created in the API
*/
created_at?: string;
/**
* @description Value of the provider_type sent to this endpoint
* @enum {string}
*/
provider_type?: 'facebook' | 'whatsapp' | 'other';
/** @description Value of the template_support sent to this endpoint */
template_support?: boolean;
};
};
};
};
/** Bad Request */
400: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The error description
* @example Expected { name: string; avatar_url?: string; provider_channel_id: string; }, but was incompatible
*/
error?: string;
/** @example Please check the reference docs in https://developers.pipedrive.com/docs/api/v1 */
error_info?: string;
additional_data?: {
/**
* @description An error code sent by the API
* @example INVALID_BODY
*/
code?: string;
};
};
};
};
/** Forbidden */
403: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The error description
* @example Only admins can register channels
*/
error?: string;
/** @example Please check the reference docs in https://developers.pipedrive.com/docs/api/v1 */
error_info?: string;
additional_data?: {
/**
* @description An error code sent by the API
* @example ADMIN_ONLY
*/
code?: string;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/**
* @description The name of the channel
* @example My Channel
*/
name: string;
/** @description The channel ID */
provider_channel_id: string;
/**
* Format: url
* @description The URL for an icon that represents your channel
*/
avatar_url?: string;
/**
* @description If true, enables templates logic on UI. Requires getTemplates endpoint implemented. Find out more [here](https://pipedrive.readme.io/docs/implementing-messaging-app-extension).
* @default false
*/
template_support?: boolean;
/**
* @description It controls the icons (like the icon next to the conversation)
* @default other
* @enum {string}
*/
provider_type?: 'facebook' | 'whatsapp' | 'other';
};
};
};
};
/** Deletes an existing messenger’s channel and all related entities (conversations and messages). To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). */
deleteChannel: {
parameters: {
path: {
/** The ID of the channel provided by the integration */
id: string;
};
};
responses: {
/** The channel was deleted */
200: {
content: {
'application/json': {
/** @example true */
success?: boolean;
};
};
};
/** Bad Request */
400: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The error description
* @example Expected { name: string; avatar_url?: string; provider_channel_id: string; }, but was incompatible
*/
error?: string;
/** @example Please check the reference docs in https://developers.pipedrive.com/docs/api/v1 */
error_info?: string;
additional_data?: {
/**
* @description An error code sent by the API
* @example INVALID_BODY
*/
code?: string;
};
};
};
};
};
};
/** Adds a message to a conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). */
receiveMessage: {
responses: {
/** The message was registered in the conversation */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the message */
id: string;
/** @description The channel ID as in the provider */
channel_id: string;
/** @description The ID of the provider's user that sent the message */
sender_id: string;
/** @description The ID of the conversation */
conversation_id: string;
/** @description The body of the message */
message: string;
/**
* @description The status of the message
* @enum {string}
*/
status: 'sent' | 'delivered' | 'read' | 'failed';
/**
* Format: date-time
* @description The date and time when the message was created in the provider, in UTC. Format: YYYY-MM-DD HH:MM
*/
created_at: string;
/**
* Format: date-time
* @description The date and time when the message can no longer receive a reply, in UTC. Format: YYYY-MM-DD HH:MM
*/
reply_by?: string;
/**
* Format: url
* @description A URL that can open the conversation in the provider's side
*/
conversation_link?: string;
/** @description The list of attachments available in the message */
attachments?: {
/** @description The ID of the attachment */
id: string;
/** @description The mime-type of the attachment */
type: string;
/** @description The name of the attachment */
name?: string;
/** @description The size of the attachment */
size?: number;
/** @description A URL to the file */
url: string;
/** @description A URL to a preview picture of the file */
preview_url?: string;
/**
* @description If true, it will use the getMessageById endpoint for fetching updated attachment's urls. Find out more [here](https://pipedrive.readme.io/docs/implementing-messaging-app-extension)
* @default false
*/
link_expires?: boolean;
}[];
};
};
};
};
/** Bad Request */
400: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The error description
* @example Expected { id: string; sender_id: string; conversation_id: string; conversation_link?: string; channel_id: string; created_at: string; message: string; status: unknown; attachments: { id: string; type: string; name: string | null; size: number | null; url: string; preview_url: string | null; }[]; reply_by?: string | null; }, but was incompatible
*/
error?: string;
/** @example Please check the reference docs in https://developers.pipedrive.com/docs/api/v1 */
error_info?: string;
additional_data?: {
/**
* @description An error code sent by the API
* @example INVALID_RECEIVE_MESSAGE_PAYLOAD
*/
code?: string;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The ID of the message */
id: string;
/** @description The channel ID as in the provider */
channel_id: string;
/** @description The ID of the provider's user that sent the message */
sender_id: string;
/** @description The ID of the conversation */
conversation_id: string;
/** @description The body of the message */
message: string;
/**
* @description The status of the message
* @enum {string}
*/
status: 'sent' | 'delivered' | 'read' | 'failed';
/**
* Format: date-time
* @description The date and time when the message was created in the provider, in UTC. Format: YYYY-MM-DD HH:MM
*/
created_at: string;
/**
* Format: date-time
* @description The date and time when the message can no longer receive a reply, in UTC. Format: YYYY-MM-DD HH:MM
*/
reply_by?: string;
/**
* Format: url
* @description A URL that can open the conversation in the provider's side
*/
conversation_link?: string;
/** @description The list of attachments available in the message */
attachments?: {
/** @description The ID of the attachment */
id: string;
/** @description The mime-type of the attachment */
type: string;
/** @description The name of the attachment */
name?: string;
/** @description The size of the attachment */
size?: number;
/** @description A URL to the file */
url: string;
/** @description A URL to a preview picture of the file */
preview_url?: string;
/**
* @description If true, it will use the getMessageById endpoint for fetching updated attachment's urls. Find out more [here](https://pipedrive.readme.io/docs/implementing-messaging-app-extension)
* @default false
*/
link_expires?: boolean;
}[];
};
};
};
};
/** Deletes an existing conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). */
deleteConversation: {
parameters: {
path: {
/** The ID of the channel provided by the integration */
'channel-id': string;
/** The ID of the conversation provided by the integration */
'conversation-id': string;
};
};
responses: {
/** The conversation was deleted */
200: {
content: {
'application/json': {
/** @example true */
success?: boolean;
};
};
};
/** Forbidden */
403: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The error description
* @example Only the app owner can delete conversations
*/
error?: string;
/** @example Please check the reference docs in https://developers.pipedrive.com/docs/api/v1 */
error_info?: string;
additional_data?: {
/**
* @description An error code sent by the API
* @example FORBIDDEN_USER_REQUEST
*/
code?: string;
};
};
};
};
/** Not Found */
404: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/**
* @description The error description
* @example Channel not found.
*/
error?: string;
/** @example Please check the reference docs in https://developers.pipedrive.com/docs/api/v1 */
error_info?: string;
additional_data?: {
/**
* @description An error code sent by the API
* @example NOT_FOUND
*/
code?: string;
};
};
};
};
};
};
/** Returns all supported currencies in given account which should be used when saving monetary values with other objects. The `code` parameter of the returning objects is the currency code according to ISO 4217 for all non-custom currencies. */
getCurrencies: {
parameters: {
query: {
/** Optional search term that is searched for from currency's name and/or code */
term?: string;
};
};
responses: {
/** The list of supported currencies */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The array of currencies */
data?: {
/** @description The ID of the currency */
id?: number;
/** @description The code of the currency */
code?: string;
/** @description The name of the currency */
name?: string;
/** @description The amount of decimal points of the currency */
decimal_points?: number;
/** @description The symbol of the currency */
symbol?: string;
/** @description Whether the currency is active or not */
active_flag?: boolean;
/** @description Whether the currency is a custom one or not */
is_custom_flag?: boolean;
}[];
};
};
};
};
};
/** Returns all deals. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/getting-all-deals" target="_blank" rel="noopener noreferrer">getting all deals</a>. */
getDeals: {
parameters: {
query: {
/** 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. */
user_id?: number;
/** The ID of the filter to use */
filter_id?: number;
/** If supplied, only deals within the given stage will be returned */
stage_id?: number;
/** Only fetch deals with a specific status. If omitted, all not deleted deals are fetched. */
status?: 'open' | 'won' | 'lost' | 'deleted' | 'all_not_deleted';
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** 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). */
sort?: string;
/** When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. */
owned_by_you?: 0 | 1;
};
};
responses: {
/** Get all deals */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The array of deals */
data?: ({
/** @description The ID of the deal */
id?: number;
/** @description The creator of the deal */
creator_user_id?: {
/** @description The ID of the deal creator */
id?: number;
/** @description The name of the deal creator */
name?: string;
/** @description The email of the deal creator */
email?: string;
/** @description If the creator has a picture or not */
has_pic?: boolean;
/** @description The creator picture hash */
pic_hash?: string | null;
/** @description Whether the creator is active or not */
active_flag?: boolean;
/** @description The ID of the deal creator */
value?: number;
};
/** dealUserDataWithId */
user_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the user */
value?: number;
};
/** dealPersonDataWithId */
person_id?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
} & {
/** @description The ID of the person associated with the deal */
value?: number;
};
/** dealOrganizationDataWithId */
org_id?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
} & {
/** @description The ID of the organization associated with the deal */
value?: number;
};
} & {
/** @description The ID of the deal stage */
stage_id?: number;
/** @description The title of the deal */
title?: string;
/** @description The value of the deal */
value?: number;
/** @description The currency associated with the deal */
currency?: string;
/** @description The creation date and time of the deal */
add_time?: string;
/** @description The last updated date and time of the deal */
update_time?: string;
/** @description The last updated date and time of the deal stage */
stage_change_time?: string;
/** @description Whether the deal is active or not */
active?: boolean;
/** @description Whether the deal is deleted or not */
deleted?: boolean;
/** @description The status of the deal */
status?: string;
/** @description The success probability percentage of the deal */
probability?: number | null;
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
/** @description The reason for losing the deal */
lost_reason?: string | null;
/** @description The visibility of the deal */
visible_to?: string;
/** @description The date and time of closing the deal */
close_time?: string | null;
/** @description The ID of pipeline associated with the deal */
pipeline_id?: number;
/** @description The date and time of changing the deal status as won */
won_time?: string;
/** @description The date and time of the first time changing the deal status as won */
first_won_time?: string;
/** @description The date and time of changing the deal status as lost */
lost_time?: string;
/** @description The number of products associated with the deal */
products_count?: number;
/** @description The number of files associated with the deal */
files_count?: number;
/** @description The number of notes associated with the deal */
notes_count?: number;
/** @description The number of followers associated with the deal */
followers_count?: number;
/** @description The number of emails associated with the deal */
email_messages_count?: number;
/** @description The number of activities associated with the deal */
activities_count?: number;
/** @description The number of completed activities associated with the deal */
done_activities_count?: number;
/** @description The number of incomplete activities associated with the deal */
undone_activities_count?: number;
/** @description The number of participants associated with the deal */
participants_count?: number;
/**
* Format: date
* @description The expected close date of the deal
*/
expected_close_date?: string;
/** @description The date and time of the last incoming email associated with the deal */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the deal */
last_outgoing_mail_time?: string;
/** @description The label assigned to the deal */
label?: string;
/** @description The order number of the deal stage associated with the deal */
stage_order_nr?: number;
/** @description The name of the person associated with the deal */
person_name?: string;
/** @description The name of the organization associated with the deal */
org_name?: string;
/** @description The subject of the next activity associated with the deal */
next_activity_subject?: string;
/** @description The type of the next activity associated with the deal */
next_activity_type?: string;
/** @description The duration of the next activity associated with the deal */
next_activity_duration?: string;
/** @description The note of the next activity associated with the deal */
next_activity_note?: string;
/** @description The deal value formatted with selected currency. E.g. US$500 */
formatted_value?: string;
/** @description Probability times deal value. Probability can either be deal probability or if not set, then stage probability. */
weighted_value?: number;
/** @description The weighted_value formatted with selected currency. E.g. US$500 */
formatted_weighted_value?: string;
/** @description The currency associated with the deal */
weighted_value_currency?: string;
/** @description The date and time of changing the deal status as rotten */
rotten_time?: string | null;
/** @description The name of the deal owner */
owner_name?: string;
/** @description The BCC email of the deal */
cc_email?: string;
/** @description If the organization that is associated with the deal is hidden or not */
org_hidden?: boolean;
/** @description If the person that is associated with the deal is hidden or not */
person_hidden?: boolean;
})[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
related_objects?: {
/** @description The user who is associated with the deal */
user?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
};
/** @description The organization which is associated with the deal */
organization?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
};
/** @description The person who is associated with the deal */
person?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
};
};
};
};
};
};
};
/** Adds a new deal. 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="https://pipedrive.readme.io/docs/creating-a-deal" target="_blank" rel="noopener noreferrer">adding a deal</a>. */
addDeal: {
responses: {
/** Add a deal */
201: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The deal object */
data?: {
/** @description The ID of the deal */
id?: number;
/** @description The creator of the deal */
creator_user_id?: {
/** @description The ID of the deal creator */
id?: number;
/** @description The name of the deal creator */
name?: string;
/** @description The email of the deal creator */
email?: string;
/** @description If the creator has a picture or not */
has_pic?: boolean;
/** @description The creator picture hash */
pic_hash?: string | null;
/** @description Whether the creator is active or not */
active_flag?: boolean;
/** @description The ID of the deal creator */
value?: number;
};
/** dealUserDataWithId */
user_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the user */
value?: number;
};
/** dealPersonDataWithId */
person_id?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
} & {
/** @description The ID of the person associated with the deal */
value?: number;
};
/** dealOrganizationDataWithId */
org_id?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
} & {
/** @description The ID of the organization associated with the deal */
value?: number;
};
} & {
/** @description The ID of the deal stage */
stage_id?: number;
/** @description The title of the deal */
title?: string;
/** @description The value of the deal */
value?: number;
/** @description The currency associated with the deal */
currency?: string;
/** @description The creation date and time of the deal */
add_time?: string;
/** @description The last updated date and time of the deal */
update_time?: string;
/** @description The last updated date and time of the deal stage */
stage_change_time?: string;
/** @description Whether the deal is active or not */
active?: boolean;
/** @description Whether the deal is deleted or not */
deleted?: boolean;
/** @description The status of the deal */
status?: string;
/** @description The success probability percentage of the deal */
probability?: number | null;
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
/** @description The reason for losing the deal */
lost_reason?: string | null;
/** @description The visibility of the deal */
visible_to?: string;
/** @description The date and time of closing the deal */
close_time?: string | null;
/** @description The ID of pipeline associated with the deal */
pipeline_id?: number;
/** @description The date and time of changing the deal status as won */
won_time?: string;
/** @description The date and time of the first time changing the deal status as won */
first_won_time?: string;
/** @description The date and time of changing the deal status as lost */
lost_time?: string;
/** @description The number of products associated with the deal */
products_count?: number;
/** @description The number of files associated with the deal */
files_count?: number;
/** @description The number of notes associated with the deal */
notes_count?: number;
/** @description The number of followers associated with the deal */
followers_count?: number;
/** @description The number of emails associated with the deal */
email_messages_count?: number;
/** @description The number of activities associated with the deal */
activities_count?: number;
/** @description The number of completed activities associated with the deal */
done_activities_count?: number;
/** @description The number of incomplete activities associated with the deal */
undone_activities_count?: number;
/** @description The number of participants associated with the deal */
participants_count?: number;
/**
* Format: date
* @description The expected close date of the deal
*/
expected_close_date?: string;
/** @description The date and time of the last incoming email associated with the deal */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the deal */
last_outgoing_mail_time?: string;
/** @description The label assigned to the deal */
label?: string;
/** @description The order number of the deal stage associated with the deal */
stage_order_nr?: number;
/** @description The name of the person associated with the deal */
person_name?: string;
/** @description The name of the organization associated with the deal */
org_name?: string;
/** @description The subject of the next activity associated with the deal */
next_activity_subject?: string;
/** @description The type of the next activity associated with the deal */
next_activity_type?: string;
/** @description The duration of the next activity associated with the deal */
next_activity_duration?: string;
/** @description The note of the next activity associated with the deal */
next_activity_note?: string;
/** @description The deal value formatted with selected currency. E.g. US$500 */
formatted_value?: string;
/** @description Probability times deal value. Probability can either be deal probability or if not set, then stage probability. */
weighted_value?: number;
/** @description The weighted_value formatted with selected currency. E.g. US$500 */
formatted_weighted_value?: string;
/** @description The currency associated with the deal */
weighted_value_currency?: string;
/** @description The date and time of changing the deal status as rotten */
rotten_time?: string | null;
/** @description The name of the deal owner */
owner_name?: string;
/** @description The BCC email of the deal */
cc_email?: string;
/** @description If the organization that is associated with the deal is hidden or not */
org_hidden?: boolean;
/** @description If the person that is associated with the deal is hidden or not */
person_hidden?: boolean;
};
related_objects?: {
/** @description The user who is associated with the deal */
user?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
};
/** @description The organization which is associated with the deal */
organization?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
};
/** @description The person who is associated with the deal */
person?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The title of the deal */
title: string;
} & {
/** @description The value of the deal. If omitted, value will be set to 0. */
value?: string;
/** @description The currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user. */
currency?: string;
/** @description The ID of the user which will be the owner of the created deal. If not provided, the user making the request will be used. */
user_id?: number;
/** @description The ID of a person which this deal will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `org_id` is specified. */
person_id?: number;
/** @description The ID of an organization which this deal will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified. */
org_id?: number;
/** @description The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored. */
pipeline_id?: number;
/** @description The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline. */
stage_id?: number;
/**
* @description open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open.
* @enum {string}
*/
status?: 'open' | 'won' | 'lost' | 'deleted';
/**
* Format: date
* @description The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD.
*/
expected_close_date?: string;
/** @description The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. */
probability?: number;
/** @description The optional message about why the deal was lost (to be used when status = lost) */
lost_reason?: string;
/** @description The visibility of the deal. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href="https://support.pipedrive.com/en/article/visibility-groups" target="_blank" rel="noopener noreferrer">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> */
visible_to?: string;
} & {
/** @description The optional creation date & time of the deal in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
};
};
};
};
/** Marks multiple deals as deleted. After 30 days, the deals will be permanently deleted. */
deleteDeals: {
parameters: {
query: {
/** The comma-separated IDs that will be deleted */
ids: string;
};
};
responses: {
/** Delete multiple deals in bulk */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
data?: {
/** @description The list of deleted deals IDs */
id?: number[];
};
};
};
};
};
};
/** Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of <a href="https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem">/v1/itemSearch</a> with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. */
searchDeals: {
parameters: {
query: {
/** The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). */
term: string;
/** A comma-separated string array. The fields to perform the search from. Defaults to all of them. */
fields?: 'custom_fields' | 'notes' | 'title';
/** When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. */
exact_match?: true | false;
/** Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. */
person_id?: number;
/** Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. */
organization_id?: number;
/** 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. */
status?: 'open' | 'won' | 'lost';
/** Supports including optional fields in the results which are not provided by default */
include_fields?: 'deal.cc_email';
/** Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The array of deals */
items?: {
/** @description Search result relevancy */
result_score?: number;
item?: {
/** @description The ID of the deal */
id?: number;
/** @description The type of the item */
type?: string;
/** @description The title of the deal */
title?: string;
/** @description The value of the deal */
value?: number;
/** @description The currency of the deal */
currency?: string;
/** @description The status of the deal */
status?: string;
/** @description The visibility of the deal */
visible_to?: number;
owner?: {
/** @description The ID of the owner of the deal */
id?: number;
};
stage?: {
/** @description The ID of the stage of the deal */
id?: number;
/** @description The name of the stage of the deal */
name?: string;
};
person?: {
/** @description The ID of the person the deal is associated with */
id?: number;
/** @description The name of the person the deal is associated with */
name?: string;
} | null;
organization?: {
/** @description The ID of the organization the deal is associated with */
id?: number;
/** @description The name of the organization the deal is associated with */
name?: string;
} | null;
/** @description Custom fields */
custom_fields?: string[];
/** @description An array of notes */
notes?: string[];
};
}[];
};
additional_data?: {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
};
};
};
};
};
/** Returns a summary of all the deals. */
getDealsSummary: {
parameters: {
query: {
/** Only fetch deals with a specific status. open = Open, won = Won, lost = Lost */
status?: 'open' | 'won' | 'lost';
/** <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. */
filter_id?: number;
/** Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. */
user_id?: number;
/** Only deals within the given stage will be returned */
stage_id?: number;
};
};
responses: {
/** Get the summary of the deals */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The summary of deals */
data?: {
/** @description The total values of the deals grouped by deal currency */
values_total?: {
/** @description The total value of deals in the deal currency group */
value?: number;
/** @description The number of deals in the deal currency group */
count?: number;
/** @description The total value of deals converted into the company default currency */
value_converted?: number;
/** @description The total value of deals formatted with deal currency. E.g. €50 */
value_formatted?: string;
/** @description The value_converted formatted with deal currency. E.g. US$50.10 */
value_converted_formatted?: string;
};
/** @description The total weighted values of the deals grouped by deal currency. The weighted value is calculated as probability times deal value. */
weighted_values_total?: {
/** @description The total weighted value of the deals in the deal currency group */
value?: number;
/** @description The number of deals in the deal currency group */
count?: number;
/** @description The total weighted value of the deals formatted with deal currency. E.g. €50 */
value_formatted?: string;
};
/** @description The total number of deals */
total_count?: number;
/** @description The total value of deals converted into the company default currency */
total_currency_converted_value?: number;
/** @description The total weighted value of deals converted into the company default currency */
total_weighted_currency_converted_value?: number;
/** @description The total converted value of deals formatted with the company default currency. E.g. US$5,100.96 */
total_currency_converted_value_formatted?: string;
/** @description The total weighted value of deals formatted with the company default currency. E.g. US$5,100.96 */
total_weighted_currency_converted_value_formatted?: string;
};
};
};
};
};
};
/** 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`. */
getDealsTimeline: {
parameters: {
query: {
/** The date when the first interval starts. Format: YYYY-MM-DD */
start_date: 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> */
interval: 'day' | 'week' | 'month' | 'quarter';
/** The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). */
amount: number;
/** The date field key which deals will be retrieved from */
field_key: string;
/** If supplied, only deals matching the given user will be returned */
user_id?: number;
/** If supplied, only deals matching the given pipeline will be returned */
pipeline_id?: number;
/** If supplied, only deals matching the given filter will be returned */
filter_id?: number;
/** Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. */
exclude_deals?: 0 | 1;
/** 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. */
totals_convert_currency?: string;
};
};
responses: {
/** Get open and won deals, grouped by the defined interval of time */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description Open and won deals grouped into periods by defined interval, amount and date-type dealField (`field_key`) */
data?: {
/** @description The start date and time of the period */
period_start?: string;
/** @description The end date and time of the period */
period_end?: string;
deals?: ({
/** @description The ID of the deal */
id?: number;
/** @description The ID of the deal creator */
creator_user_id?: number;
/** @description The ID of the user */
user_id?: number;
/** @description The ID of the person associated with the deal */
person_id?: number;
/** @description The ID of the organization associated with the deal */
org_id?: number;
} & {
/** @description The ID of the deal stage */
stage_id?: number;
/** @description The title of the deal */
title?: string;
/** @description The value of the deal */
value?: number;
/** @description The currency associated with the deal */
currency?: string;
/** @description The creation date and time of the deal */
add_time?: string;
/** @description The last updated date and time of the deal */
update_time?: string;
/** @description The last updated date and time of the deal stage */
stage_change_time?: string;
/** @description Whether the deal is active or not */
active?: boolean;
/** @description Whether the deal is deleted or not */
deleted?: boolean;
/** @description The status of the deal */
status?: string;
/** @description The success probability percentage of the deal */
probability?: number | null;
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
/** @description The reason for losing the deal */
lost_reason?: string | null;
/** @description The visibility of the deal */
visible_to?: string;
/** @description The date and time of closing the deal */
close_time?: string | null;
/** @description The ID of pipeline associated with the deal */
pipeline_id?: number;
/** @description The date and time of changing the deal status as won */
won_time?: string;
/** @description The date and time of the first time changing the deal status as won */
first_won_time?: string;
/** @description The date and time of changing the deal status as lost */
lost_time?: string;
/** @description The number of products associated with the deal */
products_count?: number;
/** @description The number of files associated with the deal */
files_count?: number;
/** @description The number of notes associated with the deal */
notes_count?: number;
/** @description The number of followers associated with the deal */
followers_count?: number;
/** @description The number of emails associated with the deal */
email_messages_count?: number;
/** @description The number of activities associated with the deal */
activities_count?: number;
/** @description The number of completed activities associated with the deal */
done_activities_count?: number;
/** @description The number of incomplete activities associated with the deal */
undone_activities_count?: number;
/** @description The number of participants associated with the deal */
participants_count?: number;
/**
* Format: date
* @description The expected close date of the deal
*/
expected_close_date?: string;
/** @description The date and time of the last incoming email associated with the deal */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the deal */
last_outgoing_mail_time?: string;
/** @description The label assigned to the deal */
label?: string;
/** @description The order number of the deal stage associated with the deal */
stage_order_nr?: number;
/** @description The name of the person associated with the deal */
person_name?: string;
/** @description The name of the organization associated with the deal */
org_name?: string;
/** @description The subject of the next activity associated with the deal */
next_activity_subject?: string;
/** @description The type of the next activity associated with the deal */
next_activity_type?: string;
/** @description The duration of the next activity associated with the deal */
next_activity_duration?: string;
/** @description The note of the next activity associated with the deal */
next_activity_note?: string;
/** @description The deal value formatted with selected currency. E.g. US$500 */
formatted_value?: string;
/** @description Probability times deal value. Probability can either be deal probability or if not set, then stage probability. */
weighted_value?: number;
/** @description The weighted_value formatted with selected currency. E.g. US$500 */
formatted_weighted_value?: string;
/** @description The currency associated with the deal */
weighted_value_currency?: string;
/** @description The date and time of changing the deal status as rotten */
rotten_time?: string | null;
/** @description The name of the deal owner */
owner_name?: string;
/** @description The BCC email of the deal */
cc_email?: string;
/** @description If the organization that is associated with the deal is hidden or not */
org_hidden?: boolean;
/** @description If the person that is associated with the deal is hidden or not */
person_hidden?: boolean;
})[];
/** @description The total values of deals for the given period */
totals?: {
/** @description The number of deals for the given period */
count?: number;
/** @description The total values of deals grouped by deal currency */
values?: { [key: string]: unknown };
/** @description The total weighted values of deals for the given period grouped by deal currency. The weighted value of a deal is calculated as probability times deal value. */
weighted_values?: { [key: string]: unknown };
/** @description The number of open deals for the given period */
open_count?: number;
/** @description The total values of open deals for the given period grouped by deal currency */
open_values?: { [key: string]: unknown };
/** @description The total weighted values of open deals for the given period grouped by deal currency. The weighted value of a deal is calculated as probability times deal value. */
weighted_open_values?: { [key: string]: unknown };
/** @description The number of won deals for the given period */
won_count?: number;
/** @description The total values of won deals for the given period grouped by deal currency */
won_values?: { [key: string]: unknown };
};
};
};
};
};
};
};
/** 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="https://pipedrive.readme.io/docs/getting-details-of-a-deal" target="_blank" rel="noopener noreferrer">getting details of a deal</a>. */
getDeal: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
};
responses: {
/** Get a deal by its ID */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** dealNonStrictWithDetails */
data?: ({
/** @description The ID of the deal */
id?: number;
/** @description The creator of the deal */
creator_user_id?: {
/** @description The ID of the deal creator */
id?: number;
/** @description The name of the deal creator */
name?: string;
/** @description The email of the deal creator */
email?: string;
/** @description If the creator has a picture or not */
has_pic?: boolean;
/** @description The creator picture hash */
pic_hash?: string | null;
/** @description Whether the creator is active or not */
active_flag?: boolean;
/** @description The ID of the deal creator */
value?: number;
};
/** dealUserDataWithId */
user_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the user */
value?: number;
};
/** dealPersonDataWithId */
person_id?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
} & {
/** @description The ID of the person associated with the deal */
value?: number;
};
/** dealOrganizationDataWithId */
org_id?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
} & {
/** @description The ID of the organization associated with the deal */
value?: number;
};
} & {
/** @description The ID of the deal stage */
stage_id?: number;
/** @description The title of the deal */
title?: string;
/** @description The value of the deal */
value?: number;
/** @description The currency associated with the deal */
currency?: string;
/** @description The creation date and time of the deal */
add_time?: string;
/** @description The last updated date and time of the deal */
update_time?: string;
/** @description The last updated date and time of the deal stage */
stage_change_time?: string;
/** @description Whether the deal is active or not */
active?: boolean;
/** @description Whether the deal is deleted or not */
deleted?: boolean;
/** @description The status of the deal */
status?: string;
/** @description The success probability percentage of the deal */
probability?: number | null;
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
/** @description The reason for losing the deal */
lost_reason?: string | null;
/** @description The visibility of the deal */
visible_to?: string;
/** @description The date and time of closing the deal */
close_time?: string | null;
/** @description The ID of pipeline associated with the deal */
pipeline_id?: number;
/** @description The date and time of changing the deal status as won */
won_time?: string;
/** @description The date and time of the first time changing the deal status as won */
first_won_time?: string;
/** @description The date and time of changing the deal status as lost */
lost_time?: string;
/** @description The number of products associated with the deal */
products_count?: number;
/** @description The number of files associated with the deal */
files_count?: number;
/** @description The number of notes associated with the deal */
notes_count?: number;
/** @description The number of followers associated with the deal */
followers_count?: number;
/** @description The number of emails associated with the deal */
email_messages_count?: number;
/** @description The number of activities associated with the deal */
activities_count?: number;
/** @description The number of completed activities associated with the deal */
done_activities_count?: number;
/** @description The number of incomplete activities associated with the deal */
undone_activities_count?: number;
/** @description The number of participants associated with the deal */
participants_count?: number;
/**
* Format: date
* @description The expected close date of the deal
*/
expected_close_date?: string;
/** @description The date and time of the last incoming email associated with the deal */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the deal */
last_outgoing_mail_time?: string;
/** @description The label assigned to the deal */
label?: string;
/** @description The order number of the deal stage associated with the deal */
stage_order_nr?: number;
/** @description The name of the person associated with the deal */
person_name?: string;
/** @description The name of the organization associated with the deal */
org_name?: string;
/** @description The subject of the next activity associated with the deal */
next_activity_subject?: string;
/** @description The type of the next activity associated with the deal */
next_activity_type?: string;
/** @description The duration of the next activity associated with the deal */
next_activity_duration?: string;
/** @description The note of the next activity associated with the deal */
next_activity_note?: string;
/** @description The deal value formatted with selected currency. E.g. US$500 */
formatted_value?: string;
/** @description Probability times deal value. Probability can either be deal probability or if not set, then stage probability. */
weighted_value?: number;
/** @description The weighted_value formatted with selected currency. E.g. US$500 */
formatted_weighted_value?: string;
/** @description The currency associated with the deal */
weighted_value_currency?: string;
/** @description The date and time of changing the deal status as rotten */
rotten_time?: string | null;
/** @description The name of the deal owner */
owner_name?: string;
/** @description The BCC email of the deal */
cc_email?: string;
/** @description If the organization that is associated with the deal is hidden or not */
org_hidden?: boolean;
/** @description If the person that is associated with the deal is hidden or not */
person_hidden?: boolean;
}) & {
/** @description The average time to win the deal */
average_time_to_won?: {
/** @description Years */
y?: number;
/** @description Months */
m?: number;
/** @description Days */
d?: number;
/** @description Hours */
h?: number;
/** @description Minutes */
i?: number;
/** @description Seconds */
s?: number;
/** @description The total time in seconds */
total_seconds?: number;
};
/** @description The average of the deal stage progression */
average_stage_progress?: number;
/** @description The lifetime of the deal */
age?: {
/** @description Years */
y?: number;
/** @description Months */
m?: number;
/** @description Days */
d?: number;
/** @description Hours */
h?: number;
/** @description Minutes */
i?: number;
/** @description Seconds */
s?: number;
/** @description The total time in seconds */
total_seconds?: number;
};
/** @description The details of the duration of the deal being in each stage of the pipeline */
stay_in_pipeline_stages?: {
/** @description The number of seconds a deal has been in each stage of the pipeline */
times_in_stages?: { [key: string]: unknown };
/** @description The order of the deal progression through the pipeline stages */
order_of_stages?: number[];
};
/** @description The details of the last activity associated with the deal */
last_activity?: { [key: string]: unknown } | null;
/** @description The details of the next activity associated with the deal */
next_activity?: { [key: string]: unknown } | null;
};
additional_data?: {
/** @description The BCC email of the deal */
dropbox_email?: string;
};
related_objects?: {
/** @description The user who is associated with the deal */
user?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
};
/** @description The organization which is associated with the deal */
organization?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
};
/** @description The person who is associated with the deal */
person?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
};
};
};
};
};
};
};
/** Updates the properties of a deal. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/updating-a-deal" target="_blank" rel="noopener noreferrer">updating a deal</a>. */
updateDeal: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
};
responses: {
/** Add a deal */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The deal object */
data?: {
/** @description The ID of the deal */
id?: number;
/** @description The creator of the deal */
creator_user_id?: {
/** @description The ID of the deal creator */
id?: number;
/** @description The name of the deal creator */
name?: string;
/** @description The email of the deal creator */
email?: string;
/** @description If the creator has a picture or not */
has_pic?: boolean;
/** @description The creator picture hash */
pic_hash?: string | null;
/** @description Whether the creator is active or not */
active_flag?: boolean;
/** @description The ID of the deal creator */
value?: number;
};
/** dealUserDataWithId */
user_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the user */
value?: number;
};
/** dealPersonDataWithId */
person_id?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
} & {
/** @description The ID of the person associated with the deal */
value?: number;
};
/** dealOrganizationDataWithId */
org_id?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
} & {
/** @description The ID of the organization associated with the deal */
value?: number;
};
} & {
/** @description The ID of the deal stage */
stage_id?: number;
/** @description The title of the deal */
title?: string;
/** @description The value of the deal */
value?: number;
/** @description The currency associated with the deal */
currency?: string;
/** @description The creation date and time of the deal */
add_time?: string;
/** @description The last updated date and time of the deal */
update_time?: string;
/** @description The last updated date and time of the deal stage */
stage_change_time?: string;
/** @description Whether the deal is active or not */
active?: boolean;
/** @description Whether the deal is deleted or not */
deleted?: boolean;
/** @description The status of the deal */
status?: string;
/** @description The success probability percentage of the deal */
probability?: number | null;
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
/** @description The reason for losing the deal */
lost_reason?: string | null;
/** @description The visibility of the deal */
visible_to?: string;
/** @description The date and time of closing the deal */
close_time?: string | null;
/** @description The ID of pipeline associated with the deal */
pipeline_id?: number;
/** @description The date and time of changing the deal status as won */
won_time?: string;
/** @description The date and time of the first time changing the deal status as won */
first_won_time?: string;
/** @description The date and time of changing the deal status as lost */
lost_time?: string;
/** @description The number of products associated with the deal */
products_count?: number;
/** @description The number of files associated with the deal */
files_count?: number;
/** @description The number of notes associated with the deal */
notes_count?: number;
/** @description The number of followers associated with the deal */
followers_count?: number;
/** @description The number of emails associated with the deal */
email_messages_count?: number;
/** @description The number of activities associated with the deal */
activities_count?: number;
/** @description The number of completed activities associated with the deal */
done_activities_count?: number;
/** @description The number of incomplete activities associated with the deal */
undone_activities_count?: number;
/** @description The number of participants associated with the deal */
participants_count?: number;
/**
* Format: date
* @description The expected close date of the deal
*/
expected_close_date?: string;
/** @description The date and time of the last incoming email associated with the deal */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the deal */
last_outgoing_mail_time?: string;
/** @description The label assigned to the deal */
label?: string;
/** @description The order number of the deal stage associated with the deal */
stage_order_nr?: number;
/** @description The name of the person associated with the deal */
person_name?: string;
/** @description The name of the organization associated with the deal */
org_name?: string;
/** @description The subject of the next activity associated with the deal */
next_activity_subject?: string;
/** @description The type of the next activity associated with the deal */
next_activity_type?: string;
/** @description The duration of the next activity associated with the deal */
next_activity_duration?: string;
/** @description The note of the next activity associated with the deal */
next_activity_note?: string;
/** @description The deal value formatted with selected currency. E.g. US$500 */
formatted_value?: string;
/** @description Probability times deal value. Probability can either be deal probability or if not set, then stage probability. */
weighted_value?: number;
/** @description The weighted_value formatted with selected currency. E.g. US$500 */
formatted_weighted_value?: string;
/** @description The currency associated with the deal */
weighted_value_currency?: string;
/** @description The date and time of changing the deal status as rotten */
rotten_time?: string | null;
/** @description The name of the deal owner */
owner_name?: string;
/** @description The BCC email of the deal */
cc_email?: string;
/** @description If the organization that is associated with the deal is hidden or not */
org_hidden?: boolean;
/** @description If the person that is associated with the deal is hidden or not */
person_hidden?: boolean;
};
related_objects?: {
/** @description The user who is associated with the deal */
user?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
};
/** @description The organization which is associated with the deal */
organization?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
};
/** @description The person who is associated with the deal */
person?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The title of the deal */
title?: string;
} & {
/** @description The value of the deal. If omitted, value will be set to 0. */
value?: string;
/** @description The currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user. */
currency?: string;
/** @description The ID of the user which will be the owner of the created deal. If not provided, the user making the request will be used. */
user_id?: number;
/** @description The ID of a person which this deal will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `org_id` is specified. */
person_id?: number;
/** @description The ID of an organization which this deal will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified. */
org_id?: number;
/** @description The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored. */
pipeline_id?: number;
/** @description The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline. */
stage_id?: number;
/**
* @description open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open.
* @enum {string}
*/
status?: 'open' | 'won' | 'lost' | 'deleted';
/**
* Format: date
* @description The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD.
*/
expected_close_date?: string;
/** @description The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. */
probability?: number;
/** @description The optional message about why the deal was lost (to be used when status = lost) */
lost_reason?: string;
/** @description The visibility of the deal. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href="https://support.pipedrive.com/en/article/visibility-groups" target="_blank" rel="noopener noreferrer">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> */
visible_to?: string;
};
};
};
};
/** Marks a deal as deleted. After 30 days, the deal will be permanently deleted. */
deleteDeal: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
};
responses: {
/** Delete a deal */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the deal that was deleted */
id?: number;
};
};
};
};
};
};
/** Lists activities associated with a deal. */
getDealActivities: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. */
done?: 0 | 1;
/** A comma-separated string of activity IDs to exclude from result */
exclude?: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of activities */
data?: ({
/**
* Format: date
* @description The due date of the activity. Format: YYYY-MM-DD
*/
due_date?: string;
/** @description The due time of the activity in UTC. Format: HH:MM */
due_time?: string;
/** @description The duration of the activity. Format: HH:MM */
duration?: string;
/** @description The ID of the deal this activity is associated with */
deal_id?: number;
/** @description The ID of the lead this activity is associated with */
lead_id?: string;
/** @description The ID of the person this activity is associated with */
person_id?: number;
/** @description The ID of the organization this activity is associated with */
org_id?: number;
/** @description The note of the activity (HTML format) */
note?: string;
/** @description The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. */
location?: string;
/** @description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. */
public_description?: string;
} & {
/** @description The activity ID, generated when the activity was created */
id?: number;
/** @description Whether the activity is done or not */
done?: boolean;
/** @description The subject of the activity */
subject?: string;
/** @description The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. */
type?: string;
/** @description The ID of the user whom the activity is assigned to */
user_id?: number;
/** @description List of multiple persons (participants) this activity is associated with */
participants?: { [key: string]: unknown }[] | null;
/**
* @description Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time.
* @enum {boolean}
*/
busy_flag?: true | false;
/** @description The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. */
attendees?: { [key: string]: unknown }[] | null;
/** @description The user's company ID */
company_id?: number;
/** @description If the activity references some other object, it is indicated here. For example, value `Salesphone` refers to activities created with Caller. */
reference_type?: string;
/** @description Together with the `reference_type`, gives the ID of the other object */
reference_id?: number;
/** @description The ID of Marketplace app, which is connected to this activity */
conference_meeting_client?: string;
/** @description The link to join the meeting which is associated with this activity */
conference_meeting_url?: string;
/** @description The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity */
conference_meeting_id?: string;
/** @description The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. */
marked_as_done_time?: string;
/** @description The date and time of latest notifications sent about this activity to the participants or the attendees of this activity */
last_notification_time?: string;
/** @description The ID of the user who triggered the sending of the latest notifications about this activity to the participants or the attendees of this activity */
last_notification_user_id?: number;
/** @description The ID of the language the notifications are sent in */
notification_language_id?: number;
/**
* Format: uuid
* @description The ID of the lead in the UUID format this activity is associated with
*/
lead_id?: string;
/** @description Whether the activity is active or not */
active_flag?: boolean;
/** @description The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
/** @description The ID of the user who was the last to update this activity */
update_user_id?: number;
/** @description For the activity which syncs to Google calendar, this is the Google event ID. NB! This field is related to old Google calendar sync and will be deprecated soon. */
gcal_event_id?: string;
/** @description The Google calendar ID that this activity syncs to. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_id?: string;
/** @description The Google calendar API etag (version) that is used for syncing this activity. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_etag?: string;
/** @description For activities that sync to an external calendar, this setting indicates if the activity syncs with context (what are the deals, persons, organizations this activity is related to) */
calendar_sync_include_context?: string;
/** @description The timezone the activity was created in an external calendar */
source_timezone?: string;
/** @description The rule for the recurrence of the activity. Is important for activities synced into Pipedrive from an external calendar. Example: "RRULE:FREQ=WEEKLY;BYDAY=WE" */
rec_rule?: string;
/** @description Additional rules for the recurrence of the activity, extend the `rec_rule`. Is important for activities synced into Pipedrive from an external calendar. */
rec_rule_extension?: string;
/** @description The ID of parent activity for a recurrent activity if the current activity is an exception to recurrence rules */
rec_master_activity_id?: number;
/** @description The list of recurring activity instances. It is in a structure as follows: `[{due_date: "2020-06-24", due_time: "10:00:00"}]` */
series?: { [key: string]: unknown }[];
/** @description The ID of the user who created the activity */
created_by_user_id?: number;
/** @description Subfield of location field. Indicates apartment/suite number. */
location_subpremise?: string;
/** @description Subfield of location field. Indicates house number. */
location_street_number?: string;
/** @description Subfield of location field. Indicates street name. */
location_route?: string;
/** @description Subfield of location field. Indicates district/sublocality. */
location_sublocality?: string;
/** @description Subfield of location field. Indicates city/town/village/locality. */
location_locality?: string;
/** @description Subfield of location field. Indicates state/county. */
location_admin_area_level_1?: string;
/** @description Subfield of location field. Indicates region. */
location_admin_area_level_2?: string;
/** @description Subfield of location field. Indicates country. */
location_country?: string;
/** @description Subfield of location field. Indicates ZIP/postal code. */
location_postal_code?: string;
/** @description Subfield of location field. Indicates full/combined address. */
location_formatted_address?: string;
/** @description Subfield of location field. Indicates latitude. */
location_lat?: number;
/** @description Subfield of location field. Indicates longitude. */
location_long?: number;
/** @description The name of the organization this activity is associated with */
org_name?: string;
/** @description The name of the person this activity is associated with */
person_name?: string;
/** @description The name of the deal this activity is associated with */
deal_title?: string;
/** @description The name of the user this activity is owned by */
owner_name?: string;
/** @description The BCC email address of the person */
person_dropbox_bcc?: string;
/** @description The BCC email address of the deal */
deal_dropbox_bcc?: string;
/** @description The ID of the user to whom the activity is assigned to. Equal to `user_id`. */
assigned_to_user_id?: number;
/** @description The file that is attached to this activity. For example, this can be a reference to an audio note file generated with Pipedrive mobile app. */
file?: { [key: string]: unknown };
})[];
/** activityDistributionDataWithAdditionalData */
additional_data?: {
/** @description The distribution of activities related to the organization grouped by the user ID */
activity_distribution?: {
/** @description The ID of the user */
ASSIGNED_TO_USER_ID?: {
/** @description The count of activities related to the user grouped by activity type */
activities?: {
/** @description The count of activities related to a specific type */
ACTIVITY_TYPE_NAME?: number;
};
/** @description The name of the user */
name?: string;
/** @description The overall count of activities for the user */
activity_count?: number;
/** @description The percentage of activities belongs to the user */
share?: number;
};
};
} & {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
} & ({
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
});
};
person?: {
/** @description The ID of the person associated with the item */
PERSON_ID?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the person associated with the item */
id?: number;
/** @description The name of the person associated with the item */
name?: string;
/** @description The emails of the person associated with the item */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description Whether this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the item */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the item */
value?: string;
/** @description Whether this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the item */
owner_id?: number;
};
};
deal?: {
/** @description The ID of the deal which is associated with the item */
DEAL_ID?: {
/** @description The ID of the deal associated with the item */
id?: number;
/** @description The title of the deal associated with the item */
title?: string;
/** @description The status of the deal associated with the item */
status?: string;
/** @description The value of the deal that is associated with the item */
value?: number;
/** @description The currency of the deal value */
currency?: string;
/** @description The ID of the stage the deal is currently at */
stage_id?: number;
/** @description The ID of the pipeline the deal is in */
pipeline_id?: number;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
};
};
};
};
};
};
/** Duplicates a deal. */
duplicateDeal: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
};
responses: {
/** Duplicate a deal */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The deal object */
data?: {
/** @description The ID of the deal */
id?: number;
/** @description The ID of the deal creator */
creator_user_id?: number;
/** @description The ID of the user */
user_id?: number;
/** @description The ID of the person associated with the deal */
person_id?: number;
/** @description The ID of the organization associated with the deal */
org_id?: number;
} & {
/** @description The ID of the deal stage */
stage_id?: number;
/** @description The title of the deal */
title?: string;
/** @description The value of the deal */
value?: number;
/** @description The currency associated with the deal */
currency?: string;
/** @description The creation date and time of the deal */
add_time?: string;
/** @description The last updated date and time of the deal */
update_time?: string;
/** @description The last updated date and time of the deal stage */
stage_change_time?: string;
/** @description Whether the deal is active or not */
active?: boolean;
/** @description Whether the deal is deleted or not */
deleted?: boolean;
/** @description The status of the deal */
status?: string;
/** @description The success probability percentage of the deal */
probability?: number | null;
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
/** @description The reason for losing the deal */
lost_reason?: string | null;
/** @description The visibility of the deal */
visible_to?: string;
/** @description The date and time of closing the deal */
close_time?: string | null;
/** @description The ID of pipeline associated with the deal */
pipeline_id?: number;
/** @description The date and time of changing the deal status as won */
won_time?: string;
/** @description The date and time of the first time changing the deal status as won */
first_won_time?: string;
/** @description The date and time of changing the deal status as lost */
lost_time?: string;
/** @description The number of products associated with the deal */
products_count?: number;
/** @description The number of files associated with the deal */
files_count?: number;
/** @description The number of notes associated with the deal */
notes_count?: number;
/** @description The number of followers associated with the deal */
followers_count?: number;
/** @description The number of emails associated with the deal */
email_messages_count?: number;
/** @description The number of activities associated with the deal */
activities_count?: number;
/** @description The number of completed activities associated with the deal */
done_activities_count?: number;
/** @description The number of incomplete activities associated with the deal */
undone_activities_count?: number;
/** @description The number of participants associated with the deal */
participants_count?: number;
/**
* Format: date
* @description The expected close date of the deal
*/
expected_close_date?: string;
/** @description The date and time of the last incoming email associated with the deal */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the deal */
last_outgoing_mail_time?: string;
/** @description The label assigned to the deal */
label?: string;
/** @description The order number of the deal stage associated with the deal */
stage_order_nr?: number;
/** @description The name of the person associated with the deal */
person_name?: string;
/** @description The name of the organization associated with the deal */
org_name?: string;
/** @description The subject of the next activity associated with the deal */
next_activity_subject?: string;
/** @description The type of the next activity associated with the deal */
next_activity_type?: string;
/** @description The duration of the next activity associated with the deal */
next_activity_duration?: string;
/** @description The note of the next activity associated with the deal */
next_activity_note?: string;
/** @description The deal value formatted with selected currency. E.g. US$500 */
formatted_value?: string;
/** @description Probability times deal value. Probability can either be deal probability or if not set, then stage probability. */
weighted_value?: number;
/** @description The weighted_value formatted with selected currency. E.g. US$500 */
formatted_weighted_value?: string;
/** @description The currency associated with the deal */
weighted_value_currency?: string;
/** @description The date and time of changing the deal status as rotten */
rotten_time?: string | null;
/** @description The name of the deal owner */
owner_name?: string;
/** @description The BCC email of the deal */
cc_email?: string;
/** @description If the organization that is associated with the deal is hidden or not */
org_hidden?: boolean;
/** @description If the person that is associated with the deal is hidden or not */
person_hidden?: boolean;
};
};
};
};
};
};
/** Lists files associated with a deal. */
getDealFiles: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** 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`. */
sort?: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of files */
data?: {
/** @description The ID of the file */
id?: number;
/** @description The ID of the user to associate the file with */
user_id?: number;
/** @description The ID of the deal to associate the file with */
deal_id?: number;
/** @description The ID of the person to associate the file with */
person_id?: number;
/** @description The ID of the organization to associate the file with */
org_id?: number;
/** @description The ID of the product to associate the file with */
product_id?: number;
/** @description The ID of the activity to associate the file with */
activity_id?: number;
/** @description The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The original name of the file */
file_name?: string;
/** @description The size of the file */
file_size?: number;
/** @description Whether the user is active or not. false = Not activated, true = Activated */
active_flag?: boolean;
/** @description Whether the file was uploaded as inline or not */
inline_flag?: boolean;
/** @description The location type to send the file to. Only googledrive is supported at the moment. */
remote_location?: string;
/** @description The ID of the remote item */
remote_id?: string;
/** @description The ID of the inline attachment */
cid?: string;
/** @description The location of the cloud storage */
s3_bucket?: string;
/** @description The ID of the mail message to associate the file with */
mail_message_id?: string;
/** @description The ID of the mail template to associate the file with */
mail_template_id?: string;
/** @description The name of the deal associated with the dile */
deal_name?: string;
/** @description The name of the person associated with the file */
person_name?: string;
/** @description The name of the organization associated with the file */
org_name?: string;
/** @description The name of the product associated with the file */
product_name?: string;
/** @description The URL of the download file */
url?: string;
/** @description The visible name of the file */
name?: string;
/** @description The description of the file */
description?: string;
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Lists updates about a deal. */
getDealUpdates: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. */
all_changes?: 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) */
items?: string;
};
};
responses: {
/** Get the deal updates */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The type of the deal update. (Possible object types - dealChange, note, activity, mailMessage, invoice, document, file) */
object?: string;
/** @description The creation date and time of the update */
timestamp?: string;
/** @description The data related to the update */
data?: { [key: string]: unknown };
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
related_objects?: {
deal?: {
/** @description The ID of the deal which is associated with the item */
DEAL_ID?: {
/** @description The ID of the deal associated with the item */
id?: number;
/** @description The title of the deal associated with the item */
title?: string;
/** @description The status of the deal associated with the item */
status?: string;
/** @description The value of the deal that is associated with the item */
value?: number;
/** @description The currency of the deal value */
currency?: string;
/** @description The ID of the stage the deal is currently at */
stage_id?: number;
/** @description The ID of the pipeline the deal is in */
pipeline_id?: number;
};
};
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
person?: {
/** @description The ID of the person associated with the item */
PERSON_ID?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the person associated with the item */
id?: number;
/** @description The name of the person associated with the item */
name?: string;
/** @description The emails of the person associated with the item */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description Whether this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the item */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the item */
value?: string;
/** @description Whether this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the item */
owner_id?: number;
};
};
};
};
};
};
};
};
/** Lists the followers of a deal. */
getDealFollowers: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The list of followers */
data?: {
/** @description The ID of the user */
user_id?: number;
/** @description The ID of the user follower */
id?: number;
/** @description The ID of the person */
person_id?: number;
/** @description The date and time when the follower was added to the person */
add_time?: string;
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Adds a follower to a deal. */
addDealFollower: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
};
responses: {
/** Add a follower to a deal */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
data?: {
/** @description The user ID who added the follower */
user_id?: number;
/** @description The follower ID */
id?: number;
/** @description The ID of the deal which the follower was added to */
deal_id?: number;
/** @description The date and time when the deal follower was added */
add_time?: string;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The ID of the user */
user_id: number;
};
};
};
};
/** Deletes a follower from a deal. */
deleteDealFollower: {
parameters: {
path: {
/** The ID of the deal */
id: number;
/** The ID of the follower */
follower_id: number;
};
};
responses: {
/** Delete a follower from a deal */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the deal follower that was deleted */
id?: number;
};
};
};
};
};
};
/** Lists mail messages associated with a deal. */
getDealMailMessages: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of mail messages */
data?: {
/** @description The type of the data item */
object?: string;
/** @description The date and time when the item was created */
timestamp?: string;
/** mailMessageItemForList */
data?: {
/** @description ID of the mail message. */
id?: number;
/** @description The array of mail message sender (object) */
from?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message receiver (object) */
to?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message copies (object) */
cc?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message blind copies (object) */
bcc?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The mail message body URL */
body_url?: string;
/** @description The connection account ID */
account_id?: string;
/** @description ID of the user whom mail message will be assigned to */
user_id?: number;
/** @description ID of the mail message thread */
mail_thread_id?: number;
/** @description The subject of mail message */
subject?: string;
/** @description The snippet of mail message. Snippet length is up to 225 characters. */
snippet?: string;
/**
* @description The status of tracking mail message. Value is `null` if tracking is not enabled.
* @enum {string|null}
*/
mail_tracking_status?: ('opened' | 'not opened') | null;
/** @description Whether the link tracking in mail message body is enabled. */
mail_link_tracking_enabled_flag?: 0 | 1;
/** @description Whether the mail message is read or not by the user */
read_flag?: 0 | 1;
/** @description If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. */
draft?: string;
/** @description Whether the mail message is a draft or not */
draft_flag?: 0 | 1;
/** @description Whether the mail message is synced with the provider or not */
synced_flag?: 0 | 1;
/** @description Whether the mail message is deleted or not */
deleted_flag?: 0 | 1;
/** @description Whether the mail message has a body or not */
has_body_flag?: 0 | 1;
/** @description Whether the mail message has been sent or not */
sent_flag?: 0 | 1;
/** @description Whether the mail message has been sent from Pipedrive app or not */
sent_from_pipedrive_flag?: 0 | 1;
/** @description Whether the mail message has been created by Smart Email BCC feature or not */
smart_bcc_flag?: 0 | 1;
/**
* Format: date-time
* @description Creation or receival time of the mail message
*/
message_time?: string;
/**
* Format: date-time
* @description The insertion into the database time of the mail message
*/
add_time?: string;
/**
* Format: date-time
* @description The updating time in the database of the mail message
*/
update_time?: string;
/** @description Whether the mail message has an attachment or not */
has_attachments_flag?: 0 | 1;
/** @description Whether the mail message has an inline attachment or not */
has_inline_attachments_flag?: 0 | 1;
/** @description Whether the mail message has an attachment (which is not inline) or not */
has_real_attachments_flag?: 0 | 1;
} & {
/** @description The Mail Message ID assigned by the sync provider */
nylas_id?: string;
/** @description The name of the S3 bucket */
s3_bucket?: string;
/** @description The path of the S3 bucket */
s3_bucket_path?: string;
/** @description If the Mail Message has been deleted on the provider side or not */
external_deleted_flag?: boolean;
/** @description The Mail Message ID assigned by the mail user agent */
mua_message_id?: string;
/** @description The ID of the mail template */
template_id?: number;
/** @description The add date and time of the Mail Message */
timestamp?: string;
/** @description The type of the data item */
item_type?: string;
/** @description The ID of the company */
company_id?: number;
};
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Merges a deal with another deal. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/merging-two-deals" target="_blank" rel="noopener noreferrer">merging two deals</a>. */
mergeDeals: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
};
responses: {
/** Merges a deal with another deal */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
data?: ({
/** @description The ID of the deal */
id?: number;
/** @description The ID of the deal creator */
creator_user_id?: number;
/** @description The ID of the user */
user_id?: number;
/** @description The ID of the person associated with the deal */
person_id?: number;
/** @description The ID of the organization associated with the deal */
org_id?: number;
} & {
/** @description The ID of the deal stage */
stage_id?: number;
/** @description The title of the deal */
title?: string;
/** @description The value of the deal */
value?: number;
/** @description The currency associated with the deal */
currency?: string;
/** @description The creation date and time of the deal */
add_time?: string;
/** @description The last updated date and time of the deal */
update_time?: string;
/** @description The last updated date and time of the deal stage */
stage_change_time?: string;
/** @description Whether the deal is active or not */
active?: boolean;
/** @description Whether the deal is deleted or not */
deleted?: boolean;
/** @description The status of the deal */
status?: string;
/** @description The success probability percentage of the deal */
probability?: number | null;
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
/** @description The reason for losing the deal */
lost_reason?: string | null;
/** @description The visibility of the deal */
visible_to?: string;
/** @description The date and time of closing the deal */
close_time?: string | null;
/** @description The ID of pipeline associated with the deal */
pipeline_id?: number;
/** @description The date and time of changing the deal status as won */
won_time?: string;
/** @description The date and time of the first time changing the deal status as won */
first_won_time?: string;
/** @description The date and time of changing the deal status as lost */
lost_time?: string;
/** @description The number of products associated with the deal */
products_count?: number;
/** @description The number of files associated with the deal */
files_count?: number;
/** @description The number of notes associated with the deal */
notes_count?: number;
/** @description The number of followers associated with the deal */
followers_count?: number;
/** @description The number of emails associated with the deal */
email_messages_count?: number;
/** @description The number of activities associated with the deal */
activities_count?: number;
/** @description The number of completed activities associated with the deal */
done_activities_count?: number;
/** @description The number of incomplete activities associated with the deal */
undone_activities_count?: number;
/** @description The number of participants associated with the deal */
participants_count?: number;
/**
* Format: date
* @description The expected close date of the deal
*/
expected_close_date?: string;
/** @description The date and time of the last incoming email associated with the deal */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the deal */
last_outgoing_mail_time?: string;
/** @description The label assigned to the deal */
label?: string;
/** @description The order number of the deal stage associated with the deal */
stage_order_nr?: number;
/** @description The name of the person associated with the deal */
person_name?: string;
/** @description The name of the organization associated with the deal */
org_name?: string;
/** @description The subject of the next activity associated with the deal */
next_activity_subject?: string;
/** @description The type of the next activity associated with the deal */
next_activity_type?: string;
/** @description The duration of the next activity associated with the deal */
next_activity_duration?: string;
/** @description The note of the next activity associated with the deal */
next_activity_note?: string;
/** @description The deal value formatted with selected currency. E.g. US$500 */
formatted_value?: string;
/** @description Probability times deal value. Probability can either be deal probability or if not set, then stage probability. */
weighted_value?: number;
/** @description The weighted_value formatted with selected currency. E.g. US$500 */
formatted_weighted_value?: string;
/** @description The currency associated with the deal */
weighted_value_currency?: string;
/** @description The date and time of changing the deal status as rotten */
rotten_time?: string | null;
/** @description The name of the deal owner */
owner_name?: string;
/** @description The BCC email of the deal */
cc_email?: string;
/** @description If the organization that is associated with the deal is hidden or not */
org_hidden?: boolean;
/** @description If the person that is associated with the deal is hidden or not */
person_hidden?: boolean;
}) & {
/** @description The deal ID of the deal which the original deal was merged with */
merge_what_id?: number;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The ID of the deal that the deal will be merged with */
merge_with_id: number;
};
};
};
};
/** Lists the participants associated with a deal.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. */
getDealParticipants: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Get all deal participants by the DealID */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description The array of participants */
data?: ({
/** @description The ID of the person */
id?: number;
/** @description The ID of the company related to the person */
company_id?: number;
/** @description Whether the person is active or not */
active_flag?: boolean;
/** @description List of phone data related to the person */
phone?: {
/** @description The phone number */
value?: string;
/** @description Boolean that indicates if phone number is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) */
label?: string;
}[];
/** @description List of email data related to the person */
email?: {
/** @description Email */
value?: string;
/** @description Boolean that indicates if email is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the email. (Possible values - work, home or other) */
label?: string;
}[];
/** @description The primary email of the person */
primary_email?: string;
/** @description The first letter of the name of the person */
first_char?: string;
/** @description The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The visibility group ID of who can see the person */
visible_to?: string;
picture_id?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The label assigned to the person */
label?: number;
/** @description The name of the organization associated with the person */
org_name?: string;
/** @description The name of the owner associated with the person */
owner_name?: string;
/** @description The BCC email associated with the person */
cc_email?: string;
} & (({
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** relationshipOrganizationInfoItemWithActiveFlag */
org_id?: ({
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
}) & {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
};
} & {
/** @description The name of the person */
name?: string;
/** @description The first name of the person */
first_name?: string;
/** @description The last name of the person */
last_name?: string;
}) &
(({
/** @description The count of email messages related to the person */
email_messages_count?: number;
/** @description The count of activities related to the person */
activities_count?: number;
/** @description The count of done activities related to the person */
done_activities_count?: number;
/** @description The count of undone activities related to the person */
undone_activities_count?: number;
/** @description The count of files related to the person */
files_count?: number;
/** @description The count of notes related to the person */
notes_count?: number;
/** @description The count of followers related to the person */
followers_count?: number;
} & {
/** @description The date and time of the last incoming email associated with the person */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the person */
last_outgoing_mail_time?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
}))))[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
related_objects?: {
/** @description The user who is associated with the deal */
user?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
};
/** @description The organization which is associated with the deal */
organization?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
};
/** @description The person who is associated with the deal */
person?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
};
};
};
};
};
};
};
/** Adds a participant to a deal. */
addDealParticipant: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
};
responses: {
/** Add new participant to the deal */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description The object of participant */
data?: {
/** @description The ID of the person */
id?: number;
/** @description The ID of the company related to the person */
company_id?: number;
/** @description Whether the person is active or not */
active_flag?: boolean;
/** @description List of phone data related to the person */
phone?: {
/** @description The phone number */
value?: string;
/** @description Boolean that indicates if phone number is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) */
label?: string;
}[];
/** @description List of email data related to the person */
email?: {
/** @description Email */
value?: string;
/** @description Boolean that indicates if email is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the email. (Possible values - work, home or other) */
label?: string;
}[];
/** @description The primary email of the person */
primary_email?: string;
/** @description The first letter of the name of the person */
first_char?: string;
/** @description The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The visibility group ID of who can see the person */
visible_to?: string;
picture_id?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The label assigned to the person */
label?: number;
/** @description The name of the organization associated with the person */
org_name?: string;
/** @description The name of the owner associated with the person */
owner_name?: string;
/** @description The BCC email associated with the person */
cc_email?: string;
} & (({
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** relationshipOrganizationInfoItemWithActiveFlag */
org_id?: ({
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
}) & {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
};
} & {
/** @description The name of the person */
name?: string;
/** @description The first name of the person */
first_name?: string;
/** @description The last name of the person */
last_name?: string;
}) &
(({
/** @description The count of email messages related to the person */
email_messages_count?: number;
/** @description The count of activities related to the person */
activities_count?: number;
/** @description The count of done activities related to the person */
done_activities_count?: number;
/** @description The count of undone activities related to the person */
undone_activities_count?: number;
/** @description The count of files related to the person */
files_count?: number;
/** @description The count of notes related to the person */
notes_count?: number;
/** @description The count of followers related to the person */
followers_count?: number;
} & {
/** @description The date and time of the last incoming email associated with the person */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the person */
last_outgoing_mail_time?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
})));
related_objects?: {
/** @description The user who is associated with the deal */
user?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
};
/** @description The organization which is associated with the deal */
organization?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
};
/** @description The person who is associated with the deal */
person?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The ID of the person */
person_id: number;
};
};
};
};
/** Deletes a participant from a deal. */
deleteDealParticipant: {
parameters: {
path: {
/** The ID of the deal */
id: number;
/** The ID of the participant of the deal */
deal_participant_id: number;
};
};
responses: {
/** Delete a participant from a deal */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the deal participant that was deleted */
id?: number;
};
};
};
};
};
};
/** Lists the users permitted to access a deal. */
getDealUsers: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The list of permitted users IDs */
id?: number[];
};
};
};
};
};
};
/** Lists all persons associated with a deal, regardless of whether the person is the primary contact of the deal, or added as a participant. */
getDealPersons: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of persons */
data?: ({
/** @description The ID of the person */
id?: number;
/** @description The ID of the company related to the person */
company_id?: number;
/** @description Whether the person is active or not */
active_flag?: boolean;
/** @description List of phone data related to the person */
phone?: {
/** @description The phone number */
value?: string;
/** @description Boolean that indicates if phone number is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) */
label?: string;
}[];
/** @description List of email data related to the person */
email?: {
/** @description Email */
value?: string;
/** @description Boolean that indicates if email is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the email. (Possible values - work, home or other) */
label?: string;
}[];
/** @description The primary email of the person */
primary_email?: string;
/** @description The first letter of the name of the person */
first_char?: string;
/** @description The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The visibility group ID of who can see the person */
visible_to?: string;
picture_id?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The label assigned to the person */
label?: number;
/** @description The name of the organization associated with the person */
org_name?: string;
/** @description The name of the owner associated with the person */
owner_name?: string;
/** @description The BCC email associated with the person */
cc_email?: string;
} & (({
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** relationshipOrganizationInfoItemWithActiveFlag */
org_id?: ({
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
}) & {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
};
} & {
/** @description The name of the person */
name?: string;
/** @description The first name of the person */
first_name?: string;
/** @description The last name of the person */
last_name?: string;
}) &
(({
/** @description The count of email messages related to the person */
email_messages_count?: number;
/** @description The count of activities related to the person */
activities_count?: number;
/** @description The count of done activities related to the person */
done_activities_count?: number;
/** @description The count of undone activities related to the person */
undone_activities_count?: number;
/** @description The count of files related to the person */
files_count?: number;
/** @description The count of notes related to the person */
notes_count?: number;
/** @description The count of followers related to the person */
followers_count?: number;
} & {
/** @description The date and time of the last incoming email associated with the person */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the person */
last_outgoing_mail_time?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
}))))[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
} & ({
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
});
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
};
};
};
};
};
};
/** Lists products attached to a deal. */
getDealProducts: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** Whether to fetch product data along with each attached product (1) or not (0, default) */
include_product_data?: 0 | 1;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The array of products */
items?: {
/** @description The ID of the deal-product (the ID of the product attached to the deal) */
id?: number;
/** @description The ID of the deal */
deal_id?: number;
/** @description The order number of the product */
order_nr?: number;
/** @description The ID of the product */
product_id?: number;
/** @description The ID of the product variation */
product_variation_id?: number;
/** @description The price value of the product */
item_price?: number;
/** @description The discount percentage of the product */
discount_percentage?: number;
/** @description The duration of the product */
duration?: number;
/** @description The type of the duration. (For example hourly, daily, etc.) */
duration_unit?: string;
/** @description The product sum without the discount */
sum_no_discount?: number;
/** @description The sum of all the products attached to the deal */
sum?: number;
/** @description The currency associated with the deal product */
currency?: string;
/** @description Whether the product is enabled or not */
enabled_flag?: boolean;
/** @description The date and time when the product was added to the deal */
add_time?: string;
/** @description The date and time when the deal product was last edited */
last_edit?: string;
/** @description The comments of the product */
comments?: string;
/** @description Whether the product is active or not */
active_flag?: boolean;
/** @description The product tax */
tax?: number;
/** @description The product name */
name?: string;
/** @description The formatted sum of the product */
sum_formatted?: string;
/** @description The formatted quantity of the product */
quantity_formatted?: string;
/** @description The quantity of the product */
quantity?: number;
product?: {
/** @description The ID of the product */
id?: number;
/** @description The name of the product */
name?: string;
/** @description The product code */
code?: string;
/** @description The unit in which this product is sold */
unit?: string;
/**
* @description The ax percentage
* @default 0
*/
tax?: number;
/**
* numberBooleanDefault1
* @description Whether this product is active or not
* @default 1
* @enum {number}
*/
active_flag?: 0 | 1;
/**
* numberBooleanDefault1
* @description Whether this product is selected in deals or not
* @default 1
* @enum {number}
*/
selectable?: 0 | 1;
/** @description Visibility of the product */
visible_to?: '1' | '3' | '5' | '7';
/** @description Information about the Pipedrive user who owns the product */
owner_id?: { [key: string]: unknown };
} & {
/** @description Object of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional) */
prices?: { [key: string]: unknown };
};
}[];
};
additional_data?: {
/** @description The total quantity of the products */
products_quantity_total?: number;
/** @description The total sum of the products */
products_sum_total?: number;
/** @description Whether variations is enabled or not */
variations_enabled?: boolean;
/** @description The total formatted quantity of the products */
products_quantity_total_formatted?: string;
/** @description The total formatted sum of the products */
products_sum_total_formatted?: string;
} & {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
related_objects?: {
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
};
};
};
};
};
};
/** Adds a product to the deal. */
addDealProduct: {
parameters: {
path: {
/** The ID of the deal */
id: number;
};
};
responses: {
/** Add a product to the deal */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The added product object attached to the deal */
data?: (({
/** @description The price at which this product will be added to the deal */
item_price: number;
/** @description Quantity – e.g. how many items of this product will be added to the deal */
quantity: number;
/**
* @description The discount %. If omitted, will be set to 0.
* @default 0
*/
discount_percentage?: number;
/**
* @description The duration of the product (when product durations are not enabled for the company or if omitted, defaults to 1)
* @default 1
*/
duration?: number;
/** @description The ID of the product variation to use. When omitted, no variation will be used. */
product_variation_id?: number;
/** @description Any textual comment associated with this product-deal attachment. Visible and editable in the application UI. */
comments?: string;
/**
* @description The tax percentage
* @default 0
*/
tax?: number;
/** @description Whether the product is enabled on the deal or not. This makes it possible to add products to a deal with a specific price and discount criteria - but keep them disabled, which refrains them from being included in the deal price calculation. When omitted, the product will be marked as enabled by default. */
enabled_flag?: 0 | 1;
} & {
product_id: unknown;
}) & {
/** @description The ID of the deal-product (the ID of the product attached to the deal) */
id?: number;
/** @description The ID of the company */
company_id?: number;
/** @description The ID of the deal */
deal_id?: number;
/** @description The ID of the product */
product_id?: number;
/** @description The type of the duration. (For example hourly, daily, etc.) */
duration_unit?: string;
/** @description The product sum without the discount */
sum_no_discount?: number;
/** @description The sum of all the products attached to the deal */
sum?: number;
/** @description The currency associated with the deal product */
currency?: string;
/** @description The date and time when the product was added to the deal */
add_time?: string;
/** @description The date and time when the deal product was last edited */
last_edit?: string;
/** @description Whether the product is active or not */
active_flag?: boolean;
/** @description The product tax */
tax?: number;
/** @description The product name */
name?: string;
}) & {
/** @description The ID of the deal-product (the ID of the product attached to the deal) */
product_attachment_id?: number;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The price at which this product will be added to the deal */
item_price: number;
/** @description Quantity – e.g. how many items of this product will be added to the deal */
quantity: number;
/**
* @description The discount %. If omitted, will be set to 0.
* @default 0
*/
discount_percentage?: number;
/**
* @description The duration of the product (when product durations are not enabled for the company or if omitted, defaults to 1)
* @default 1
*/
duration?: number;
/** @description The ID of the product variation to use. When omitted, no variation will be used. */
product_variation_id?: number;
/** @description Any textual comment associated with this product-deal attachment. Visible and editable in the application UI. */
comments?: string;
/**
* @description The tax percentage
* @default 0
*/
tax?: number;
/** @description Whether the product is enabled on the deal or not. This makes it possible to add products to a deal with a specific price and discount criteria - but keep them disabled, which refrains them from being included in the deal price calculation. When omitted, the product will be marked as enabled by default. */
enabled_flag?: 0 | 1;
} & {
product_id: unknown;
};
};
};
};
/** Updates product attachment details. */
updateDealProduct: {
parameters: {
path: {
/** The ID of the deal */
id: number;
/** The ID of the deal-product (the ID of the product attached to the deal) */
product_attachment_id: number;
};
};
responses: {
/** Update product attachment details */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The updated product object attached to the deal */
data?: ({
/** @description The price at which this product will be added to the deal */
item_price: number;
/** @description Quantity – e.g. how many items of this product will be added to the deal */
quantity: number;
/**
* @description The discount %. If omitted, will be set to 0.
* @default 0
*/
discount_percentage?: number;
/**
* @description The duration of the product (when product durations are not enabled for the company or if omitted, defaults to 1)
* @default 1
*/
duration?: number;
/** @description The ID of the product variation to use. When omitted, no variation will be used. */
product_variation_id?: number;
/** @description Any textual comment associated with this product-deal attachment. Visible and editable in the application UI. */
comments?: string;
/**
* @description The tax percentage
* @default 0
*/
tax?: number;
/** @description Whether the product is enabled on the deal or not. This makes it possible to add products to a deal with a specific price and discount criteria - but keep them disabled, which refrains them from being included in the deal price calculation. When omitted, the product will be marked as enabled by default. */
enabled_flag?: 0 | 1;
} & {
product_id: unknown;
}) & {
/** @description The ID of the deal-product (the ID of the product attached to the deal) */
id?: number;
/** @description The ID of the company */
company_id?: number;
/** @description The ID of the deal */
deal_id?: number;
/** @description The ID of the product */
product_id?: number;
/** @description The type of the duration. (For example hourly, daily, etc.) */
duration_unit?: string;
/** @description The product sum without the discount */
sum_no_discount?: number;
/** @description The sum of all the products attached to the deal */
sum?: number;
/** @description The currency associated with the deal product */
currency?: string;
/** @description The date and time when the product was added to the deal */
add_time?: string;
/** @description The date and time when the deal product was last edited */
last_edit?: string;
/** @description Whether the product is active or not */
active_flag?: boolean;
/** @description The product tax */
tax?: number;
/** @description The product name */
name?: string;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The price at which this product will be added to the deal */
item_price: number;
/** @description Quantity – e.g. how many items of this product will be added to the deal */
quantity: number;
/**
* @description The discount %. If omitted, will be set to 0.
* @default 0
*/
discount_percentage?: number;
/**
* @description The duration of the product (when product durations are not enabled for the company or if omitted, defaults to 1)
* @default 1
*/
duration?: number;
/** @description The ID of the product variation to use. When omitted, no variation will be used. */
product_variation_id?: number;
/** @description Any textual comment associated with this product-deal attachment. Visible and editable in the application UI. */
comments?: string;
/**
* @description The tax percentage
* @default 0
*/
tax?: number;
/** @description Whether the product is enabled on the deal or not. This makes it possible to add products to a deal with a specific price and discount criteria - but keep them disabled, which refrains them from being included in the deal price calculation. When omitted, the product will be marked as enabled by default. */
enabled_flag?: 0 | 1;
} & {
product_id: unknown;
};
};
};
};
/** Deletes a product attachment from a deal, using the `product_attachment_id`. */
deleteDealProduct: {
parameters: {
path: {
/** The ID of the deal */
id: number;
/** The product attachment ID. This is returned as `product_attachment_id` after attaching a product to a deal or as id when listing the products attached to a deal. */
product_attachment_id: number;
};
};
responses: {
/** Delete an attached product from a deal */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of an attached product that was deleted from the deal */
id?: number;
/** @description The ID of an attached product that was deleted from the deal */
product_attachment_id?: number;
};
};
};
};
};
};
/** Returns data about all deal fields. */
getDealFields: {
parameters: {
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Adds a new deal field. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-new-custom-field" target="_blank" rel="noopener noreferrer">adding a new custom field</a>. */
addDealField: {
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the field */
name: string;
/** @description When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. Example: `[{"label":"New Item"}]` */
options?: string;
/**
* @description Whether the field is available in the 'add new' modal or not (both in the web and mobile app)
* @default true
* @enum {boolean}
*/
add_visible_flag?: true | false;
} & {
/**
* @description The type of the field<table><tr><th>Value</th><th>Description</th></tr><tr><td>`address`</td><td>Address field (has multiple subfields, autocompleted by Google Maps)</td></tr><tr><td>`date`</td><td>Date (format YYYY-MM-DD)</td></tr><tr><td>`daterange`</td><td>Date-range field (has a start date and end date value, both YYYY-MM-DD)</td></tr><tr><td>`double`</td><td>Numeric value</td></tr><tr><td>`enum`</td><td>Options field with a single possible chosen option</td></tr><tr></tr><tr><td>`monetary`</td><td>Monetary field (has a numeric value and a currency value)</td></tr><tr><td>`org`</td><td>Organization field (contains an organization ID which is stored on the same account)</td></tr><tr><td>`people`</td><td>Person field (contains a person ID which is stored on the same account)</td></tr><tr><td>`phone`</td><td>Phone field (up to 255 numbers and/or characters)</td></tr><tr><td>`set`</td><td>Options field with a possibility of having multiple chosen options</td></tr><tr><td>`text`</td><td>Long text (up to 65k characters)</td></tr><tr><td>`time`</td><td>Time field (format HH:MM:SS)</td></tr><tr><td>`timerange`</td><td>Time-range field (has a start time and end time value, both HH:MM:SS)</td></tr><tr><td>`user`</td><td>User field (contains a user ID of another Pipedrive user)</td></tr><tr><td>`varchar`</td><td>Text (up to 255 characters)</td></tr><tr><td>`varchar_auto`</td><td>Autocomplete text (up to 255 characters)</td></tr><tr><td>`visible_to`</td><td>System field that keeps item's visibility setting</td></tr></table>
* @enum {string}
*/
field_type:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
};
};
};
};
/** Marks multiple deal fields as deleted. */
deleteDealFields: {
parameters: {
query: {
/** The comma-separated field IDs to delete */
ids: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The list of deleted field IDs */
id?: number[];
};
};
};
};
};
};
/** Returns data about a specific deal field. */
getDealField: {
parameters: {
path: {
/** The ID of the field */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
};
};
};
};
};
};
/** Updates a deal field. For more information, see the tutorial for <a href=" https://pipedrive.readme.io/docs/updating-custom-field-value " target="_blank" rel="noopener noreferrer">updating custom fields' values</a>. */
updateDealField: {
parameters: {
path: {
/** The ID of the field */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the field */
name?: string;
/** @description When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: `[{"id":123,"label":"Existing Item"},{"label":"New Item"}]` */
options?: string;
/**
* @description Whether the field is available in 'add new' modal or not (both in web and mobile app)
* @default true
* @enum {boolean}
*/
add_visible_flag?: true | false;
};
};
};
};
/** Marks a field as deleted. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/deleting-a-custom-field" target="_blank" rel="noopener noreferrer">deleting a custom field</a>. */
deleteDealField: {
parameters: {
path: {
/** The ID of the field */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field that was deleted */
id?: number;
};
};
};
};
};
};
/** Returns data about all files. */
getFiles: {
parameters: {
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** 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`. */
sort?: string;
};
};
responses: {
/** Get data about all files uploaded to Pipedrive */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description The array of all uploaded files */
data?: {
/** @description The ID of the file */
id?: number;
/** @description The ID of the user to associate the file with */
user_id?: number;
/** @description The ID of the deal to associate the file with */
deal_id?: number;
/** @description The ID of the person to associate the file with */
person_id?: number;
/** @description The ID of the organization to associate the file with */
org_id?: number;
/** @description The ID of the product to associate the file with */
product_id?: number;
/** @description The ID of the activity to associate the file with */
activity_id?: number;
/** @description The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The original name of the file */
file_name?: string;
/** @description The size of the file */
file_size?: number;
/** @description Whether the user is active or not. false = Not activated, true = Activated */
active_flag?: boolean;
/** @description Whether the file was uploaded as inline or not */
inline_flag?: boolean;
/** @description The location type to send the file to. Only googledrive is supported at the moment. */
remote_location?: string;
/** @description The ID of the remote item */
remote_id?: string;
/** @description The ID of the inline attachment */
cid?: string;
/** @description The location of the cloud storage */
s3_bucket?: string;
/** @description The ID of the mail message to associate the file with */
mail_message_id?: string;
/** @description The ID of the mail template to associate the file with */
mail_template_id?: string;
/** @description The name of the deal associated with the file */
deal_name?: string;
/** @description The name of the person associated with the file */
person_name?: string;
/** @description The name of the organization associated with the file */
org_name?: string;
/** @description The name of the product associated with the file */
product_name?: string;
/** @description The URL of the download file */
url?: string;
/** @description The visible name of the file */
name?: string;
/** @description The description of the file */
description?: string;
}[];
additional_data?: {
/**
* paginationDetails
* @description Pagination details of the list
*/
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
} & {
/** @description Next pagination start */
next_start?: number;
};
};
};
};
};
};
};
/** Lets you upload a file and associate it with a deal, person, organization, activity or product. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-file" target="_blank" rel="noopener noreferrer">adding a file</a>. */
addFile: {
responses: {
/** Add a file from computer or Google Drive and associate it with deal, person, organization, activity or product */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description The file data */
data?: {
/** @description The ID of the file */
id?: number;
/** @description The ID of the user to associate the file with */
user_id?: number;
/** @description The ID of the deal to associate the file with */
deal_id?: number;
/** @description The ID of the person to associate the file with */
person_id?: number;
/** @description The ID of the organization to associate the file with */
org_id?: number;
/** @description The ID of the product to associate the file with */
product_id?: number;
/** @description The ID of the activity to associate the file with */
activity_id?: number;
/** @description The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The original name of the file */
file_name?: string;
/** @description The size of the file */
file_size?: number;
/** @description Whether the user is active or not. false = Not activated, true = Activated */
active_flag?: boolean;
/** @description Whether the file was uploaded as inline or not */
inline_flag?: boolean;
/** @description The location type to send the file to. Only googledrive is supported at the moment. */
remote_location?: string;
/** @description The ID of the remote item */
remote_id?: string;
/** @description The ID of the inline attachment */
cid?: string;
/** @description The location of the cloud storage */
s3_bucket?: string;
/** @description The ID of the mail message to associate the file with */
mail_message_id?: string;
/** @description The ID of the mail template to associate the file with */
mail_template_id?: string;
/** @description The name of the deal associated with the file */
deal_name?: string;
/** @description The name of the person associated with the file */
person_name?: string;
/** @description The name of the organization associated with the file */
org_name?: string;
/** @description The name of the product associated with the file */
product_name?: string;
/** @description The URL of the download file */
url?: string;
/** @description The visible name of the file */
name?: string;
/** @description The description of the file */
description?: string;
};
};
};
};
};
requestBody: {
content: {
'multipart/form-data': {
/**
* Format: binary
* @description A single file, supplied in the multipart/form-data encoding and contained within the given boundaries
*/
file: string;
/** @description The ID of the deal to associate file(s) with */
deal_id?: number;
/** @description The ID of the person to associate file(s) with */
person_id?: number;
/** @description The ID of the organization to associate file(s) with */
org_id?: number;
/** @description The ID of the product to associate file(s) with */
product_id?: number;
/** @description The ID of the activity to associate file(s) with */
activity_id?: number;
};
};
};
};
/** Creates a new empty file in the remote location (`googledrive`) that will be linked to the item you supply. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-remote-file" target="_blank" rel="noopener noreferrer">adding a remote file</a>. */
addFileAndLinkIt: {
responses: {
/** Creates a new empty file in the remote location (googledrive) that will be linked to the item you supply - deal, person or organization */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description The file data */
data?: {
/** @description The ID of the file */
id?: number;
/** @description The ID of the user to associate the file with */
user_id?: number;
/** @description The ID of the deal to associate the file with */
deal_id?: number;
/** @description The ID of the person to associate the file with */
person_id?: number;
/** @description The ID of the organization to associate the file with */
org_id?: number;
/** @description The ID of the product to associate the file with */
product_id?: number;
/** @description The ID of the activity to associate the file with */
activity_id?: number;
/** @description The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The original name of the file */
file_name?: string;
/** @description The size of the file */
file_size?: number;
/** @description Whether the user is active or not. false = Not activated, true = Activated */
active_flag?: boolean;
/** @description Whether the file was uploaded as inline or not */
inline_flag?: boolean;
/** @description The location type to send the file to. Only googledrive is supported at the moment. */
remote_location?: string;
/** @description The ID of the remote item */
remote_id?: string;
/** @description The ID of the inline attachment */
cid?: string;
/** @description The location of the cloud storage */
s3_bucket?: string;
/** @description The ID of the mail message to associate the file with */
mail_message_id?: string;
/** @description The ID of the mail template to associate the file with */
mail_template_id?: string;
/** @description The name of the deal associated with the file */
deal_name?: string;
/** @description The name of the person associated with the file */
person_name?: string;
/** @description The name of the organization associated with the file */
org_name?: string;
/** @description The name of the product associated with the file */
product_name?: string;
/** @description The URL of the download file */
url?: string;
/** @description The visible name of the file */
name?: string;
/** @description The description of the file */
description?: string;
};
};
};
};
};
requestBody: {
content: {
'application/x-www-form-urlencoded': {
/**
* @description The file type
* @enum {string}
*/
file_type: 'gdoc' | 'gslides' | 'gsheet' | 'gform' | 'gdraw';
/** @description The title of the file */
title: string;
/**
* @description The item type
* @enum {string}
*/
item_type: 'deal' | 'organization' | 'person';
/** @description The ID of the item to associate the file with */
item_id: number;
/**
* @description The location type to send the file to. Only `googledrive` is supported at the moment.
* @enum {string}
*/
remote_location: 'googledrive';
};
};
};
};
/** Links an existing remote file (`googledrive`) to the item you supply. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-remote-file" target="_blank" rel="noopener noreferrer">adding a remote file</a>. */
linkFileToItem: {
responses: {
/** Links an existing remote file (googledrive) to the item you supply - deal, person, organization */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description The file data */
data?: {
/** @description The ID of the file */
id?: number;
/** @description The ID of the user to associate the file with */
user_id?: number;
/** @description The ID of the deal to associate the file with */
deal_id?: number;
/** @description The ID of the person to associate the file with */
person_id?: number;
/** @description The ID of the organization to associate the file with */
org_id?: number;
/** @description The ID of the product to associate the file with */
product_id?: number;
/** @description The ID of the activity to associate the file with */
activity_id?: number;
/** @description The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The original name of the file */
file_name?: string;
/** @description The size of the file */
file_size?: number;
/** @description Whether the user is active or not. false = Not activated, true = Activated */
active_flag?: boolean;
/** @description Whether the file was uploaded as inline or not */
inline_flag?: boolean;
/** @description The location type to send the file to. Only googledrive is supported at the moment. */
remote_location?: string;
/** @description The ID of the remote item */
remote_id?: string;
/** @description The ID of the inline attachment */
cid?: string;
/** @description The location of the cloud storage */
s3_bucket?: string;
/** @description The ID of the mail message to associate the file with */
mail_message_id?: string;
/** @description The ID of the mail template to associate the file with */
mail_template_id?: string;
/** @description The name of the deal associated with the file */
deal_name?: string;
/** @description The name of the person associated with the file */
person_name?: string;
/** @description The name of the organization associated with the file */
org_name?: string;
/** @description The name of the product associated with the file */
product_name?: string;
/** @description The URL of the download file */
url?: string;
/** @description The visible name of the file */
name?: string;
/** @description The description of the file */
description?: string;
};
};
};
};
};
requestBody: {
content: {
'application/x-www-form-urlencoded': {
/**
* @description The item type
* @enum {string}
*/
item_type: 'deal' | 'organization' | 'person';
/** @description The ID of the item to associate the file with */
item_id: number;
/** @description The remote item ID */
remote_id: string;
/**
* @description The location type to send the file to. Only `googledrive` is supported at the moment.
* @enum {string}
*/
remote_location: 'googledrive';
};
};
};
};
/** Returns data about a specific file. */
getFile: {
parameters: {
path: {
/** The ID of the file */
id: number;
};
};
responses: {
/** Get data about one specific file uploaded to Pipedrive */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description The file data */
data?: {
/** @description The ID of the file */
id?: number;
/** @description The ID of the user to associate the file with */
user_id?: number;
/** @description The ID of the deal to associate the file with */
deal_id?: number;
/** @description The ID of the person to associate the file with */
person_id?: number;
/** @description The ID of the organization to associate the file with */
org_id?: number;
/** @description The ID of the product to associate the file with */
product_id?: number;
/** @description The ID of the activity to associate the file with */
activity_id?: number;
/** @description The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The original name of the file */
file_name?: string;
/** @description The size of the file */
file_size?: number;
/** @description Whether the user is active or not. false = Not activated, true = Activated */
active_flag?: boolean;
/** @description Whether the file was uploaded as inline or not */
inline_flag?: boolean;
/** @description The location type to send the file to. Only googledrive is supported at the moment. */
remote_location?: string;
/** @description The ID of the remote item */
remote_id?: string;
/** @description The ID of the inline attachment */
cid?: string;
/** @description The location of the cloud storage */
s3_bucket?: string;
/** @description The ID of the mail message to associate the file with */
mail_message_id?: string;
/** @description The ID of the mail template to associate the file with */
mail_template_id?: string;
/** @description The name of the deal associated with the file */
deal_name?: string;
/** @description The name of the person associated with the file */
person_name?: string;
/** @description The name of the organization associated with the file */
org_name?: string;
/** @description The name of the product associated with the file */
product_name?: string;
/** @description The URL of the download file */
url?: string;
/** @description The visible name of the file */
name?: string;
/** @description The description of the file */
description?: string;
};
};
};
};
};
};
/** Updates the properties of a file. */
updateFile: {
parameters: {
path: {
/** The ID of the file */
id: number;
};
};
responses: {
/** Update file name and description */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description The file data */
data?: {
/** @description The ID of the file */
id?: number;
/** @description The ID of the user to associate the file with */
user_id?: number;
/** @description The ID of the deal to associate the file with */
deal_id?: number;
/** @description The ID of the person to associate the file with */
person_id?: number;
/** @description The ID of the organization to associate the file with */
org_id?: number;
/** @description The ID of the product to associate the file with */
product_id?: number;
/** @description The ID of the activity to associate the file with */
activity_id?: number;
/** @description The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The original name of the file */
file_name?: string;
/** @description The size of the file */
file_size?: number;
/** @description Whether the user is active or not. false = Not activated, true = Activated */
active_flag?: boolean;
/** @description Whether the file was uploaded as inline or not */
inline_flag?: boolean;
/** @description The location type to send the file to. Only googledrive is supported at the moment. */
remote_location?: string;
/** @description The ID of the remote item */
remote_id?: string;
/** @description The ID of the inline attachment */
cid?: string;
/** @description The location of the cloud storage */
s3_bucket?: string;
/** @description The ID of the mail message to associate the file with */
mail_message_id?: string;
/** @description The ID of the mail template to associate the file with */
mail_template_id?: string;
/** @description The name of the deal associated with the file */
deal_name?: string;
/** @description The name of the person associated with the file */
person_name?: string;
/** @description The name of the organization associated with the file */
org_name?: string;
/** @description The name of the product associated with the file */
product_name?: string;
/** @description The URL of the download file */
url?: string;
/** @description The visible name of the file */
name?: string;
/** @description The description of the file */
description?: string;
};
};
};
};
};
requestBody: {
content: {
'application/x-www-form-urlencoded': {
/** @description The visible name of the file */
name?: string;
/** @description The description of the file */
description?: string;
};
};
};
};
/** Marks a file as deleted. After 30 days, the file will be permanently deleted. */
deleteFile: {
parameters: {
path: {
/** The ID of the file */
id: number;
};
};
responses: {
/** Delete a file from Pipedrive */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the file */
id?: number;
};
};
};
};
};
};
/** Initializes a file download. */
downloadFile: {
parameters: {
path: {
/** The ID of the file */
id: number;
};
};
responses: {
/** success */
200: {
content: {
'application/octet-stream': string;
};
};
};
};
/** Returns data about all filters. */
getFilters: {
parameters: {
query: {
/** The types of filters to fetch */
type?: 'deals' | 'leads' | 'org' | 'people' | 'products' | 'activity';
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of filters */
data?: {
/** @description The ID of the filter */
id?: number;
/** @description The name of the filter */
name?: string;
/** @description The active flag of the filter */
active_flag?: boolean;
/** @description The type of the item */
type?: string;
/** @description The owner of the filter */
user_id?: number;
/** @description The date and time when the filter was added */
add_time?: string;
/** @description The date and time when the filter was updated */
update_time?: string;
/** @description The visibility group ID of who can see then filter */
visible_to?: number;
/** @description Used by Pipedrive webapp */
custom_view_id?: number;
}[];
};
};
};
};
};
/** Adds a new filter, returns the ID upon success. Note that in the conditions JSON object only one first-level condition group is supported, and it must be glued with 'AND', and only two second level condition groups are supported of which one must be glued with 'AND' and the second with 'OR'. Other combinations do not work (yet) but the syntax supports introducing them in future. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-filter" target="_blank" rel="noopener noreferrer">adding a filter</a>. */
addFilter: {
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the created filter */
id?: number;
/** @description The name of the created filter */
name?: string;
/** @description The activity flag of the created filter */
active_flag?: boolean;
/** @enum {string} */
type?:
| 'deals'
| 'leads'
| 'org'
| 'people'
| 'products'
| 'activity';
/** @description If the created filter is temporary or not */
temporary_flag?: boolean;
/** @description The user ID of the created filter */
user_id?: number;
/** @description The add time of the created filter */
add_time?: string;
/** @description The update time of the created filter */
update_time?: string;
/** @description The visibility group ID of the created filter */
visible_to?: number;
/** @description The custom view ID of the created filter */
custom_view_id?: number;
/** @description The created filter conditions object */
conditions?: { [key: string]: unknown };
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the filter */
name: string;
/** @description The conditions of the filter as a JSON object. Please note that a maximum of 16 conditions is allowed per filter. It requires a minimum structure as follows: `{"glue":"and","conditions":[{"glue":"and","conditions": [CONDITION_OBJECTS]},{"glue":"or","conditions":[CONDITION_OBJECTS]}]}`. Replace `CONDITION_OBJECTS` with JSON objects of the following structure: `{"object":"","field_id":"", "operator":"","value":"", "extra_value":""}` or leave the array empty. Depending on the object type you should use another API endpoint to get `field_id`. There are five types of objects you can choose from: `"person"`, `"deal"`, `"organization"`, `"product"`, `"activity"` and you can use these types of operators depending on what type of a field you have: `"IS NOT NULL"`, `"IS NULL"`, `"<="`, `">="`, `"<"`, `">"`, `"!="`, `"="`, `"LIKE '$%'"`, `"LIKE '%$%'"`, `"NOT LIKE '$%'"`. To get a better understanding of how filters work try creating them directly from the Pipedrive application. */
conditions: { [key: string]: unknown };
/** @description The type of filter to create */
type: string;
};
};
};
};
/** Marks multiple filters as deleted. */
deleteFilters: {
parameters: {
query: {
/** The comma-separated filter IDs to delete */
ids: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The array of the IDs of the deleted filter */
id?: number[];
};
};
};
};
};
};
/** Returns all supported filter helpers. It helps to know what conditions and helpers are available when you want to <a href="/docs/api/v1/Filters#addFilter">add</a> or <a href="/docs/api/v1/Filters#updateFilter">update</a> filters. Additionally, an exact date must be inserted in YYYY-MM-DD format and an exact time in HH:MM. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-filter" target="_blank" rel="noopener noreferrer">adding a filter</a>. */
getFilterHelpers: {
responses: {
/** Success */
200: {
content: {
'application/json': { [key: string]: unknown };
};
};
};
};
/** Returns data about a specific filter. Note that this also returns the condition lines of the filter. */
getFilter: {
parameters: {
path: {
/** The ID of the filter */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The filter object */
data?: {
/** @description The ID of the filter */
id?: number;
/** @description The name of the filter */
name?: string;
/** @description The active flag of the filter */
active_flag?: boolean;
/** @description The type of the item */
type?: string;
/** @description The owner of the filter */
user_id?: number;
/** @description The date and time when the filter was added */
add_time?: string;
/** @description The date and time when the filter was updated */
update_time?: string;
/** @description The visibility group ID of who can see then filter */
visible_to?: number;
/** @description Used by Pipedrive webapp */
custom_view_id?: number;
};
};
};
};
};
};
/** Updates an existing filter. */
updateFilter: {
parameters: {
path: {
/** The ID of the filter */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the created filter */
id?: number;
/** @description The name of the created filter */
name?: string;
/** @description The activity flag of the created filter */
active_flag?: boolean;
/** @enum {string} */
type?:
| 'deals'
| 'leads'
| 'org'
| 'people'
| 'products'
| 'activity';
/** @description If the created filter is temporary or not */
temporary_flag?: boolean;
/** @description The user ID of the created filter */
user_id?: number;
/** @description The add time of the created filter */
add_time?: string;
/** @description The update time of the created filter */
update_time?: string;
/** @description The visibility group ID of the created filter */
visible_to?: number;
/** @description The custom view ID of the created filter */
custom_view_id?: number;
/** @description The created filter conditions object */
conditions?: { [key: string]: unknown };
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the filter */
name?: string;
/** @description The conditions of the filter as a JSON object. Please note that a maximum of 16 conditions is allowed per filter. It requires a minimum structure as follows: `{"glue":"and","conditions":[{"glue":"and","conditions": [CONDITION_OBJECTS]},{"glue":"or","conditions":[CONDITION_OBJECTS]}]}`. Replace `CONDITION_OBJECTS` with JSON objects of the following structure: `{"object":"","field_id":"", "operator":"","value":"", "extra_value":""}` or leave the array empty. Depending on the object type you should use another API endpoint to get `field_id`. There are five types of objects you can choose from: `"person"`, `"deal"`, `"organization"`, `"product"`, `"activity"` and you can use these types of operators depending on what type of a field you have: `"IS NOT NULL"`, `"IS NULL"`, `"<="`, `">="`, `"<"`, `">"`, `"!="`, `"="`, `"LIKE '$%'"`, `"LIKE '%$%'"`, `"NOT LIKE '$%'"`. To get a better understanding of how filters work try creating them directly from the Pipedrive application. */
conditions: { [key: string]: unknown };
};
};
};
};
/** Marks a filter as deleted. */
deleteFilter: {
parameters: {
path: {
/** The ID of the filter */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the deleted filter */
id?: number;
};
};
};
};
};
};
/** Adds a new goal. Along with adding a new goal, a report is created to track the progress of your goal. */
addGoal: {
responses: {
/** Successful response containing payload in the `data.goal` object */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
goal?: {
/** @description The ID of the goal */
id?: string;
/** @description The ID of the creator of the goal */
owner_id?: number;
/** @description The title of the goal */
title?: string;
/** @description The type of the goal */
type?: {
/** @description The name of the goal type */
name?: string;
/** @description The parameters that accompany the goal type */
params?: {
/** @description The IDs of pipelines of the goal */
pipeline_id?: number[];
/** @description The IDs of activity types of the goal */
activity_type_id?: number[];
};
};
/** @description Who the goal is assigned to */
assignee?: {
/** @description The ID of the goal assignee */
id?: number;
/** @description The type of the assignee */
type?: string;
};
/** @description The interval of the goal */
interval?: string;
/** @description The duration of the goal */
duration?: {
/** @description The start date of the goal */
start?: string;
/** @description The end date of the goal */
end?: string;
};
/** @description The expected outcome of the goal */
expected_outcome?: {
/** @description The numeric target of the goal */
target?: number;
/** @description The tracking metric of the goal */
tracking_metric?: string;
};
/** @description Whether the goal is currently active or not */
is_active?: boolean;
/** @description The IDs of the reports that belong to the goal */
report_ids?: string[];
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The title of the goal */
title?: string;
/** @description Who this goal is assigned to. It requires the following JSON structure: { "id": "1", "type": "person" }. `type` can be either `person`, `company` or `team`. ID of the assignee person, company or team. */
assignee?: { [key: string]: unknown };
/** @description The type of the goal. It requires the following JSON structure: { "name": "deals_started", "params": { "pipeline_id": [1, 2], "activity_type_id": [9] } }. Type can be one of: `deals_won`, `deals_progressed`, `activities_completed`, `activities_added`, `deals_started` or `revenue_forecast`. `params` can include `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is related to only `deals_progressed` type of goals and `activity_type_id` to `activities_completed` or `activities_added` types of goals. The `pipeline_id` and `activity_type_id` need to be given as an array of integers. To track the goal in all pipelines, set `pipeline_id` as `null` and similarly, to track the goal for all activities, set `activity_type_id` as `null`.” */
type?: { [key: string]: unknown };
/** @description The expected outcome of the goal. Expected outcome can be tracked either by `quantity` or by `sum`. It requires the following JSON structure: { "target": "50", "tracking_metric": "quantity" } or { "target": "50", "tracking_metric": "sum", "currency_id": 1 }. `currency_id` should only be added to `sum` type of goals. */
expected_outcome?: { [key: string]: unknown };
/** @description The date when the goal starts and ends. It requires the following JSON structure: { "start": "2019-01-01", "end": "2022-12-31" }. Date in format of YYYY-MM-DD. "end" can be set to `null` for an infinite, open-ended goal. */
duration?: { [key: string]: unknown };
/**
* @description The interval of the goal
* @enum {string}
*/
interval?: 'weekly' | 'monthly' | 'quarterly' | 'yearly';
} & ({ [key: string]: unknown } & {
type: unknown;
assignee: unknown;
expected_outcome: unknown;
duration: unknown;
interval: unknown;
});
};
};
};
/** Returns data about goals based on criteria. For searching, append `{searchField}={searchValue}` to the URL, where `searchField` can be any one of the lowest-level fields in dot-notation (e.g. `type.params.pipeline_id`; `title`). `searchValue` should be the value you are looking for on that field. Additionally, `is_active=<true|false>` can be provided to search for only active/inactive goals. When providing `period.start`, `period.end` must also be provided and vice versa. */
getGoals: {
parameters: {
query: {
/** The type of the goal. If provided, everyone's goals will be returned. */
'type.name'?:
| 'deals_won'
| 'deals_progressed'
| 'activities_completed'
| 'activities_added'
| 'deals_started';
/** The title of the goal */
title?: string;
/** Whether the goal is active or not */
is_active?: true | false;
/** The ID of the user who's goal to fetch. When omitted, only your goals will be returned. */
'assignee.id'?: number;
/** The type of the goal's assignee. If provided, everyone's goals will be returned. */
'assignee.type'?: 'person' | 'company' | 'team';
/** The numeric value of the outcome. If provided, everyone's goals will be returned. */
'expected_outcome.target'?: number;
/** The tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned. */
'expected_outcome.tracking_metric'?: 'quantity' | 'sum';
/** The numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned. */
'expected_outcome.currency_id'?: number;
/** An array of pipeline IDs or `null` for all pipelines. If provided, everyone's goals will be returned. */
'type.params.pipeline_id'?: number[];
/** The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned. */
'type.params.stage_id'?: number;
/** An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone's goals will be returned. */
'type.params.activity_type_id'?: number[];
/** The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too. */
'period.start'?: string;
/** The end date of the period for which to find goals. Date in format of YYYY-MM-DD. */
'period.end'?: string;
};
};
responses: {
/** Successful response containing payload in the `data.goal` object */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
goals?: {
/** @description The ID of the goal */
id?: string;
/** @description The ID of the creator of the goal */
owner_id?: number;
/** @description The title of the goal */
title?: string;
/** @description The type of the goal */
type?: {
/** @description The name of the goal type */
name?: string;
/** @description The parameters that accompany the goal type */
params?: {
/** @description The IDs of pipelines of the goal */
pipeline_id?: number[];
/** @description The IDs of activity types of the goal */
activity_type_id?: number[];
};
};
/** @description Who the goal is assigned to */
assignee?: {
/** @description The ID of the goal assignee */
id?: number;
/** @description The type of the assignee */
type?: string;
};
/** @description The interval of the goal */
interval?: string;
/** @description The duration of the goal */
duration?: {
/** @description The start date of the goal */
start?: string;
/** @description The end date of the goal */
end?: string;
};
/** @description The expected outcome of the goal */
expected_outcome?: {
/** @description The numeric target of the goal */
target?: number;
/** @description The tracking metric of the goal */
tracking_metric?: string;
};
/** @description Whether the goal is currently active or not */
is_active?: boolean;
/** @description The IDs of the reports that belong to the goal */
report_ids?: string[];
}[];
};
};
};
};
};
};
/** Updates an existing goal. */
updateGoal: {
parameters: {
path: {
/** The ID of the goal */
id: string;
};
};
responses: {
/** Successful response containing payload in the `data.goal` object */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
goal?: {
/** @description The ID of the goal */
id?: string;
/** @description The ID of the creator of the goal */
owner_id?: number;
/** @description The title of the goal */
title?: string;
/** @description The type of the goal */
type?: {
/** @description The name of the goal type */
name?: string;
/** @description The parameters that accompany the goal type */
params?: {
/** @description The IDs of pipelines of the goal */
pipeline_id?: number[];
/** @description The IDs of activity types of the goal */
activity_type_id?: number[];
};
};
/** @description Who the goal is assigned to */
assignee?: {
/** @description The ID of the goal assignee */
id?: number;
/** @description The type of the assignee */
type?: string;
};
/** @description The interval of the goal */
interval?: string;
/** @description The duration of the goal */
duration?: {
/** @description The start date of the goal */
start?: string;
/** @description The end date of the goal */
end?: string;
};
/** @description The expected outcome of the goal */
expected_outcome?: {
/** @description The numeric target of the goal */
target?: number;
/** @description The tracking metric of the goal */
tracking_metric?: string;
};
/** @description Whether the goal is currently active or not */
is_active?: boolean;
/** @description The IDs of the reports that belong to the goal */
report_ids?: string[];
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The title of the goal */
title?: string;
/** @description Who this goal is assigned to. It requires the following JSON structure: { "id": "1", "type": "person" }. `type` can be either `person`, `company` or `team`. ID of the assignee person, company or team. */
assignee?: { [key: string]: unknown };
/** @description The type of the goal. It requires the following JSON structure: { "name": "deals_started", "params": { "pipeline_id": [1, 2], "activity_type_id": [9] } }. Type can be one of: `deals_won`, `deals_progressed`, `activities_completed`, `activities_added`, `deals_started` or `revenue_forecast`. `params` can include `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is related to only `deals_progressed` type of goals and `activity_type_id` to `activities_completed` or `activities_added` types of goals. The `pipeline_id` and `activity_type_id` need to be given as an array of integers. To track the goal in all pipelines, set `pipeline_id` as `null` and similarly, to track the goal for all activities, set `activity_type_id` as `null`.” */
type?: { [key: string]: unknown };
/** @description The expected outcome of the goal. Expected outcome can be tracked either by `quantity` or by `sum`. It requires the following JSON structure: { "target": "50", "tracking_metric": "quantity" } or { "target": "50", "tracking_metric": "sum", "currency_id": 1 }. `currency_id` should only be added to `sum` type of goals. */
expected_outcome?: { [key: string]: unknown };
/** @description The date when the goal starts and ends. It requires the following JSON structure: { "start": "2019-01-01", "end": "2022-12-31" }. Date in format of YYYY-MM-DD. "end" can be set to `null` for an infinite, open-ended goal. */
duration?: { [key: string]: unknown };
/**
* @description The interval of the goal
* @enum {string}
*/
interval?: 'weekly' | 'monthly' | 'quarterly' | 'yearly';
};
};
};
};
/** Marks a goal as deleted. */
deleteGoal: {
parameters: {
path: {
/** The ID of the goal */
id: string;
};
};
responses: {
/** Successful response with id 'success' field only */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
};
};
};
};
};
/** Gets the progress of a goal for the specified period. */
getGoalResult: {
parameters: {
path: {
/** The ID of the goal that the results are looked for */
id: string;
};
query: {
/** The start date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date. */
'period.start': string;
/** The end date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date. */
'period.end': string;
};
};
responses: {
/** Successful response containing payload in the `data.goal` object */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The numeric progress of the goal */
progress?: number;
goal?: {
/** @description The ID of the goal */
id?: string;
/** @description The ID of the creator of the goal */
owner_id?: number;
/** @description The title of the goal */
title?: string;
/** @description The type of the goal */
type?: {
/** @description The name of the goal type */
name?: string;
/** @description The parameters that accompany the goal type */
params?: {
/** @description The IDs of pipelines of the goal */
pipeline_id?: number[];
/** @description The IDs of activity types of the goal */
activity_type_id?: number[];
};
};
/** @description Who the goal is assigned to */
assignee?: {
/** @description The ID of the goal assignee */
id?: number;
/** @description The type of the assignee */
type?: string;
};
/** @description The interval of the goal */
interval?: string;
/** @description The duration of the goal */
duration?: {
/** @description The start date of the goal */
start?: string;
/** @description The end date of the goal */
end?: string;
};
/** @description The expected outcome of the goal */
expected_outcome?: {
/** @description The numeric target of the goal */
target?: number;
/** @description The tracking metric of the goal */
tracking_metric?: string;
};
/** @description Whether the goal is currently active or not */
is_active?: boolean;
/** @description The IDs of the reports that belong to the goal */
report_ids?: string[];
};
};
};
};
};
};
};
/** Performs a search from your choice of item types and fields. */
searchItem: {
parameters: {
query: {
/** The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). */
term: string;
/** A comma-separated string array. The type of items to perform the search from. Defaults to all. */
item_types?:
| 'deal'
| 'person'
| 'organization'
| 'product'
| 'lead'
| 'file'
| 'mail_attachment';
/** A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> </table> <br> When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`. */
fields?:
| 'address'
| 'code'
| 'custom_fields'
| 'email'
| 'name'
| 'notes'
| 'organization_name'
| 'person_name'
| 'phone'
| 'title';
/** When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization. */
search_for_related_items?: true | false;
/** When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. */
exact_match?: true | false;
/** A comma-separated string array. Supports including optional fields in the results which are not provided by default. */
include_fields?: 'deal.cc_email' | 'person.picture' | 'product.price';
/** Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The array of found items */
items?: {
/** @description Search result relevancy */
result_score?: number;
/** @description Item */
item?: { [key: string]: unknown };
}[];
/** @description The array of related items if `search_for_related_items` was enabled */
related_items?: {
/** @description Search result relevancy */
result_score?: number;
/** @description Item */
item?: { [key: string]: unknown };
}[];
};
additional_data?: {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
};
};
};
};
};
/** Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products). */
searchItemByField: {
parameters: {
query: {
/** The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). */
term: string;
/** The type of the field to perform the search from */
field_type:
| 'dealField'
| 'leadField'
| 'personField'
| 'organizationField'
| 'productField';
/** When enabled, only full exact matches against the given term are returned. The search <b>is</b> case sensitive. */
exact_match?: true | false;
/** The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields' API GET methods (dealFields, personFields, etc.). */
field_key: string;
/** Whether to return the IDs of the matching items or not. When not set or set to `0` or `false`, only distinct values of the searched field are returned. When set to `1` or `true`, the ID of each found item is returned. */
return_item_ids?: true | false;
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'applicatoin/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of results */
data?: {
/** @description The ID of the item */
id?: number;
/** @description The value of the searched `field_key` */
$field_key?: unknown;
}[];
additional_data?: {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
};
};
};
};
};
/** 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. */
getLeads: {
parameters: {
query: {
/** For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. */
limit?: number;
/** For pagination, the position that represents the first result for the page */
start?: number;
/** Filtering based on the archived status of a lead. If not provided, `All` is used. */
archived_status?: 'archived' | 'not_archived' | 'all';
/** If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. */
owner_id?: number;
/** If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. */
person_id?: number;
/** If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. */
organization_id?: number;
/** The ID of the filter to use */
filter_id?: number;
/** 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). */
sort?:
| 'id'
| 'title'
| 'owner_id'
| 'creator_id'
| 'was_seen'
| 'expected_close_date'
| 'next_activity_id'
| 'add_time'
| 'update_time';
};
};
responses: {
/** Successful response containing payload in the `data` field */
200: {
content: {
'application/json': {
success?: boolean;
data?: {
/**
* Format: uuid
* @description The unique ID of the lead in the UUID format
*/
id?: string;
/** @description The title of the lead */
title?: string;
/** @description The ID of the user who owns the lead */
owner_id?: number;
/** @description The ID of the user who created the lead */
creator_id?: number;
/** @description The IDs of the lead labels which are associated with the lead */
label_ids?: string[];
/** @description The ID of a person which this lead is linked to */
person_id?: number | null;
/** @description The ID of an organization which this lead is linked to */
organization_id?: number | null;
/** @description Defines where the lead comes from. Will be `API` if the lead was created through the Public API and will be `Manually created` if the lead was created manually through the UI. */
source_name?: string;
/** @description A flag indicating whether the lead is archived or not */
is_archived?: boolean;
/** @description A flag indicating whether the lead was seen by someone in the Pipedrive UI */
was_seen?: boolean;
/** @description The potential value of the lead */
value?: {
amount: number;
currency: string;
};
/**
* Format: date
* @description The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD.
*/
expected_close_date?: string | null;
/** @description The ID of the next activity associated with the lead */
next_activity_id?: number | null;
/**
* Format: date-time
* @description The date and time of when the lead was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
add_time?: string;
/**
* Format: date-time
* @description The date and time of when the lead was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
update_time?: string;
/** @description The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers (private)</td></tr><tr><td>`3`</td><td>Entire company (shared)</td></tr></table> */
visible_to?: string;
/** @description The BCC email of the lead */
cc_email?: string;
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Creates a lead. A lead always has to be linked to a person or an organization or both. All leads created through the Pipedrive API will have a lead source `API` assigned. Here's the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-lead" target="_blank" rel="noopener noreferrer">adding a lead</a>. 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 given in the <a href="https://pipedrive.readme.io/docs/updating-custom-field-value" target="_blank" rel="noopener noreferrer">updating custom fields' values tutorial</a>. */
addLead: {
responses: {
/** Successful response containing payload in the `data` field */
201: {
content: {
'application/json': {
success?: boolean;
data?: {
/**
* Format: uuid
* @description The unique ID of the lead in the UUID format
*/
id?: string;
/** @description The title of the lead */
title?: string;
/** @description The ID of the user who owns the lead */
owner_id?: number;
/** @description The ID of the user who created the lead */
creator_id?: number;
/** @description The IDs of the lead labels which are associated with the lead */
label_ids?: string[];
/** @description The ID of a person which this lead is linked to */
person_id?: number | null;
/** @description The ID of an organization which this lead is linked to */
organization_id?: number | null;
/** @description Defines where the lead comes from. Will be `API` if the lead was created through the Public API and will be `Manually created` if the lead was created manually through the UI. */
source_name?: string;
/** @description A flag indicating whether the lead is archived or not */
is_archived?: boolean;
/** @description A flag indicating whether the lead was seen by someone in the Pipedrive UI */
was_seen?: boolean;
/** @description The potential value of the lead */
value?: {
amount: number;
currency: string;
};
/**
* Format: date
* @description The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD.
*/
expected_close_date?: string | null;
/** @description The ID of the next activity associated with the lead */
next_activity_id?: number | null;
/**
* Format: date-time
* @description The date and time of when the lead was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
add_time?: string;
/**
* Format: date-time
* @description The date and time of when the lead was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
update_time?: string;
/** @description The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers (private)</td></tr><tr><td>`3`</td><td>Entire company (shared)</td></tr></table> */
visible_to?: string;
/** @description The BCC email of the lead */
cc_email?: string;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the lead */
title: string;
/** @description The ID of the user which will be the owner of the created lead. If not provided, the user making the request will be used. */
owner_id?: number;
/** @description The IDs of the lead labels which will be associated with the lead */
label_ids?: string[];
/** @description The ID of a person which this lead will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `organization_id` is specified. */
person_id?: number;
/** @description The ID of an organization which this lead will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified. */
organization_id?: number;
/** @description The potential value of the lead */
value?: {
amount: number;
currency: string;
};
/**
* Format: date
* @description The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD.
*/
expected_close_date?: string;
/** @description The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href="https://support.pipedrive.com/en/article/visibility-groups" target="_blank" rel="noopener noreferrer">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style="width: 40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style="width: 40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> */
visible_to?: string;
/**
* @description A flag indicating whether the lead was seen by someone in the Pipedrive UI
* @enum {boolean}
*/
was_seen?: true | false;
};
};
};
};
/** 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. */
getLead: {
parameters: {
path: {
/** The ID of the lead */
id: string;
};
};
responses: {
/** Successful response containing payload in the `data` field */
200: {
content: {
'application/json': {
success?: boolean;
data?: {
/**
* Format: uuid
* @description The unique ID of the lead in the UUID format
*/
id?: string;
/** @description The title of the lead */
title?: string;
/** @description The ID of the user who owns the lead */
owner_id?: number;
/** @description The ID of the user who created the lead */
creator_id?: number;
/** @description The IDs of the lead labels which are associated with the lead */
label_ids?: string[];
/** @description The ID of a person which this lead is linked to */
person_id?: number | null;
/** @description The ID of an organization which this lead is linked to */
organization_id?: number | null;
/** @description Defines where the lead comes from. Will be `API` if the lead was created through the Public API and will be `Manually created` if the lead was created manually through the UI. */
source_name?: string;
/** @description A flag indicating whether the lead is archived or not */
is_archived?: boolean;
/** @description A flag indicating whether the lead was seen by someone in the Pipedrive UI */
was_seen?: boolean;
/** @description The potential value of the lead */
value?: {
amount: number;
currency: string;
};
/**
* Format: date
* @description The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD.
*/
expected_close_date?: string | null;
/** @description The ID of the next activity associated with the lead */
next_activity_id?: number | null;
/**
* Format: date-time
* @description The date and time of when the lead was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
add_time?: string;
/**
* Format: date-time
* @description The date and time of when the lead was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
update_time?: string;
/** @description The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers (private)</td></tr><tr><td>`3`</td><td>Entire company (shared)</td></tr></table> */
visible_to?: string;
/** @description The BCC email of the lead */
cc_email?: string;
};
};
};
};
/** A resource describing an error */
404: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/** @description The description of the error */
error?: string;
/** @description A message describing how to solve the problem */
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
};
};
/** Deletes a specific lead. */
deleteLead: {
parameters: {
path: {
/** The ID of the lead */
id: string;
};
};
responses: {
/** Successful response with id value only. Used in DELETE calls. */
200: {
content: {
'application/json': {
success?: boolean;
data?: {
/** Format: uuid */
id?: string;
};
};
};
};
/** A resource describing an error */
404: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/** @description The description of the error */
error?: string;
/** @description A message describing how to solve the problem */
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
};
};
/** 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 given in the <a href="https://pipedrive.readme.io/docs/updating-custom-field-value" target="_blank" rel="noopener noreferrer">updating custom fields’ values tutorial</a>. */
updateLead: {
parameters: {
path: {
/** The ID of the lead */
id: string;
};
};
responses: {
/** Successful response containing payload in the `data` field */
200: {
content: {
'application/json': {
success?: boolean;
data?: {
/**
* Format: uuid
* @description The unique ID of the lead in the UUID format
*/
id?: string;
/** @description The title of the lead */
title?: string;
/** @description The ID of the user who owns the lead */
owner_id?: number;
/** @description The ID of the user who created the lead */
creator_id?: number;
/** @description The IDs of the lead labels which are associated with the lead */
label_ids?: string[];
/** @description The ID of a person which this lead is linked to */
person_id?: number | null;
/** @description The ID of an organization which this lead is linked to */
organization_id?: number | null;
/** @description Defines where the lead comes from. Will be `API` if the lead was created through the Public API and will be `Manually created` if the lead was created manually through the UI. */
source_name?: string;
/** @description A flag indicating whether the lead is archived or not */
is_archived?: boolean;
/** @description A flag indicating whether the lead was seen by someone in the Pipedrive UI */
was_seen?: boolean;
/** @description The potential value of the lead */
value?: {
amount: number;
currency: string;
};
/**
* Format: date
* @description The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD.
*/
expected_close_date?: string | null;
/** @description The ID of the next activity associated with the lead */
next_activity_id?: number | null;
/**
* Format: date-time
* @description The date and time of when the lead was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
add_time?: string;
/**
* Format: date-time
* @description The date and time of when the lead was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
update_time?: string;
/** @description The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers (private)</td></tr><tr><td>`3`</td><td>Entire company (shared)</td></tr></table> */
visible_to?: string;
/** @description The BCC email of the lead */
cc_email?: string;
};
};
};
};
/** A resource describing an error */
404: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/** @description The description of the error */
error?: string;
/** @description A message describing how to solve the problem */
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the lead */
title?: string | null;
/** @description The ID of the user which will be the owner of the created lead. If not provided, the user making the request will be used. */
owner_id?: number;
/** @description The IDs of the lead labels which will be associated with the lead */
label_ids?: string[];
/** @description The ID of a person which this lead will be linked to. If the person does not exist yet, it needs to be created first. A lead always has to be linked to a person or organization or both. */
person_id?: number | null;
/** @description The ID of an organization which this lead will be linked to. If the organization does not exist yet, it needs to be created first. A lead always has to be linked to a person or organization or both. */
organization_id?: number | null;
/** @description A flag indicating whether the lead is archived or not */
is_archived?: boolean;
/** @description The potential value of the lead */
value?: {
amount: number;
currency: string;
} | null;
/**
* Format: date
* @description The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD.
*/
expected_close_date?: string | null;
/** @description The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href="https://support.pipedrive.com/en/article/visibility-groups" target="_blank" rel="noopener noreferrer">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style="width: 40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style="width: 40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> */
visible_to?: string;
/**
* @description A flag indicating whether the lead was seen by someone in the Pipedrive UI
* @enum {boolean}
*/
was_seen?: true | false;
};
};
};
};
/** Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href="https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. */
searchLeads: {
parameters: {
query: {
/** The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). */
term: string;
/** A comma-separated string array. The fields to perform the search from. Defaults to all of them. */
fields?: 'custom_fields' | 'notes' | 'title';
/** When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. */
exact_match?: true | false;
/** Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. */
person_id?: number;
/** Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. */
organization_id?: number;
/** Supports including optional fields in the results which are not provided by default */
include_fields?: 'lead.was_seen';
/** Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The array of leads */
items?: {
/** @description Search result relevancy */
result_score?: number;
item?: {
/** @description The ID of the lead */
id?: string;
/** @description The type of the item */
type?: string;
/** @description The title of the lead */
title?: string;
owner?: {
/** @description The ID of the owner of the lead */
id?: number;
};
person?: {
/** @description The ID of the person the lead is associated with */
id?: number;
/** @description The name of the person the lead is associated with */
name?: string;
};
organization?: {
/** @description The ID of the organization the lead is associated with */
id?: number;
/** @description The name of the organization the lead is associated with */
name?: string;
};
phones?: string[];
emails?: string[];
/** @description Custom fields */
custom_fields?: string[];
/** @description An array of notes */
notes?: string[];
/** @description The value of the lead */
value?: number;
/** @description The currency of the lead */
currency?: string;
/** @description The visibility of the lead */
visible_to?: number;
/** @description A flag indicating whether the lead is archived or not */
is_archived?: boolean;
};
}[];
};
additional_data?: {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
};
};
};
};
};
/** Returns details of all lead labels. This endpoint does not support pagination and all labels are always returned. */
getLeadLabels: {
responses: {
/** Successful response containing payload in the `data` field */
200: {
content: {
'application/json': {
success?: boolean;
data?: {
/**
* Format: uuid
* @description The unique ID of the lead label
*/
id?: string;
/** @description The name of the lead label */
name?: string;
/**
* @description The color of the label. Only a subset of colors can be used.
* @enum {string}
*/
color?: 'green' | 'blue' | 'red' | 'yellow' | 'purple' | 'gray';
/**
* Format: date-time
* @description The date and time of when the lead label was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
add_time?: string;
/**
* Format: date-time
* @description The date and time of when the lead label was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
update_time?: string;
}[];
};
};
};
};
};
/** Creates a lead label. */
addLeadLabel: {
responses: {
/** Successful response containing payload in the `data` field */
200: {
content: {
'application/json': {
success?: boolean;
data?: {
/**
* Format: uuid
* @description The unique ID of the lead label
*/
id?: string;
/** @description The name of the lead label */
name?: string;
/**
* @description The color of the label. Only a subset of colors can be used.
* @enum {string}
*/
color?: 'green' | 'blue' | 'red' | 'yellow' | 'purple' | 'gray';
/**
* Format: date-time
* @description The date and time of when the lead label was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
add_time?: string;
/**
* Format: date-time
* @description The date and time of when the lead label was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
update_time?: string;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the lead label */
name: string;
/**
* @description The color of the label. Only a subset of colors can be used.
* @enum {string}
*/
color: 'green' | 'blue' | 'red' | 'yellow' | 'purple' | 'gray';
};
};
};
};
/** Deletes a specific lead label. */
deleteLeadLabel: {
parameters: {
path: {
/** The ID of the lead label */
id: string;
};
};
responses: {
/** Successful response with id value only. Used in DELETE calls. */
200: {
content: {
'application/json': {
success?: boolean;
data?: {
/** Format: uuid */
id?: string;
};
};
};
};
/** A resource describing an error */
404: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/** @description The description of the error */
error?: string;
/** @description A message describing how to solve the problem */
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
};
};
/** Updates one or more properties of a lead label. Only properties included in the request will be updated. */
updateLeadLabel: {
parameters: {
path: {
/** The ID of the lead label */
id: string;
};
};
responses: {
/** Successful response containing payload in the `data` field */
200: {
content: {
'application/json': {
success?: boolean;
data?: {
/**
* Format: uuid
* @description The unique ID of the lead label
*/
id?: string;
/** @description The name of the lead label */
name?: string;
/**
* @description The color of the label. Only a subset of colors can be used.
* @enum {string}
*/
color?: 'green' | 'blue' | 'red' | 'yellow' | 'purple' | 'gray';
/**
* Format: date-time
* @description The date and time of when the lead label was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
add_time?: string;
/**
* Format: date-time
* @description The date and time of when the lead label was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
*/
update_time?: string;
};
};
};
};
/** A resource describing an error */
404: {
content: {
'application/json': {
/** @example false */
success?: boolean;
/** @description The description of the error */
error?: string;
/** @description A message describing how to solve the problem */
error_info?: string;
/** @example null */
data?: { [key: string]: unknown } | null;
/** @example null */
additional_data?: { [key: string]: unknown } | null;
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the lead label */
name?: string;
/**
* @description The color of the label. Only a subset of colors can be used.
* @enum {string}
*/
color?: 'green' | 'blue' | 'red' | 'yellow' | 'purple' | 'gray';
};
};
};
};
/** Returns all lead sources. Please note that the list of lead sources is fixed, it cannot be modified. All leads created through the Pipedrive API will have a lead source `API` assigned. */
getLeadSources: {
responses: {
/** The successful response containing payload in the `data` field. */
200: {
content: {
'application/json': {
success?: boolean;
data?: {
/** @description The unique name of a lead source */
name?: string;
}[];
};
};
};
};
};
/** Returns data about teams within the company. */
getTeams: {
parameters: {
query: {
/** The field name to sort returned teams by */
order_by?: 'id' | 'name' | 'manager_id' | 'active_flag';
/** When enabled, the teams will not include IDs of member users */
skip_users?: 0 | 1;
};
};
responses: {
/** The list of team objects */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: ({
/** @description The team ID */
id?: number;
} & (({
/** @description The team name */
name: string;
/** @description The team description */
description?: string;
/** @description The team manager ID */
manager_id: number;
/** @description The IDs of the users that belong to the team */
users?: number[];
} & {
/** @description Flag that indicates whether the team is active */
active_flag?: 0 | 1;
/** @description Flag that indicates whether the team is deleted */
deleted_flag?: 0 | 1;
}) & {
/** @description The team creation time. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The ID of the user who created the team */
created_by_user_id?: number;
}))[];
};
};
};
};
};
/** Adds a new team to the company and returns the created object. */
addTeam: {
responses: {
/** The team data */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** baseTeam */
data?: {
/** @description The team ID */
id?: number;
} & (({
/** @description The team name */
name: string;
/** @description The team description */
description?: string;
/** @description The team manager ID */
manager_id: number;
/** @description The IDs of the users that belong to the team */
users?: number[];
} & {
/** @description Flag that indicates whether the team is active */
active_flag?: 0 | 1;
/** @description Flag that indicates whether the team is deleted */
deleted_flag?: 0 | 1;
}) & {
/** @description The team creation time. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The ID of the user who created the team */
created_by_user_id?: number;
});
};
};
};
/** Forbidden response */
403: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The error message */
error?: string;
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The team name */
name: string;
/** @description The team description */
description?: string;
/** @description The team manager ID */
manager_id: number;
/** @description The IDs of the users that belong to the team */
users?: number[];
};
};
};
};
/** Returns data about a specific team. */
getTeam: {
parameters: {
path: {
/** The ID of the team */
id: number;
};
query: {
/** When enabled, the teams will not include IDs of member users */
skip_users?: 0 | 1;
};
};
responses: {
/** The team data */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** baseTeam */
data?: {
/** @description The team ID */
id?: number;
} & (({
/** @description The team name */
name: string;
/** @description The team description */
description?: string;
/** @description The team manager ID */
manager_id: number;
/** @description The IDs of the users that belong to the team */
users?: number[];
} & {
/** @description Flag that indicates whether the team is active */
active_flag?: 0 | 1;
/** @description Flag that indicates whether the team is deleted */
deleted_flag?: 0 | 1;
}) & {
/** @description The team creation time. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The ID of the user who created the team */
created_by_user_id?: number;
});
};
};
};
/** Team with specified ID does not exist or is inaccessible */
404: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The error message */
error?: string;
};
};
};
};
};
/** Updates an existing team and returns the updated object. */
updateTeam: {
parameters: {
path: {
/** The ID of the team */
id: number;
};
};
responses: {
/** The team data */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** baseTeam */
data?: {
/** @description The team ID */
id?: number;
} & (({
/** @description The team name */
name: string;
/** @description The team description */
description?: string;
/** @description The team manager ID */
manager_id: number;
/** @description The IDs of the users that belong to the team */
users?: number[];
} & {
/** @description Flag that indicates whether the team is active */
active_flag?: 0 | 1;
/** @description Flag that indicates whether the team is deleted */
deleted_flag?: 0 | 1;
}) & {
/** @description The team creation time. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The ID of the user who created the team */
created_by_user_id?: number;
});
};
};
};
/** Forbidden response */
403: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The error message */
error?: string;
};
};
};
/** Team with specified ID does not exist or is inaccessible */
404: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The error message */
error?: string;
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The team name */
name: string;
/** @description The team description */
description?: string;
/** @description The team manager ID */
manager_id: number;
/** @description The IDs of the users that belong to the team */
users?: number[];
} & {
/** @description Flag that indicates whether the team is active */
active_flag?: 0 | 1;
/** @description Flag that indicates whether the team is deleted */
deleted_flag?: 0 | 1;
};
};
};
};
/** Returns a list of all user IDs within a team. */
getTeamUsers: {
parameters: {
path: {
/** The ID of the team */
id: number;
};
};
responses: {
/** A list of user IDs within a team */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The list of user IDs */
data?: number[];
};
};
};
/** Team with specified ID does not exist or is inaccessible */
404: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The error message */
error?: string;
};
};
};
};
};
/** Adds users to an existing team. */
addTeamUser: {
parameters: {
path: {
/** The ID of the team */
id: number;
};
};
responses: {
/** A list of user IDs within a team */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The list of user IDs */
data?: number[];
};
};
};
/** Forbidden response */
403: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The error message */
error?: string;
};
};
};
/** Team with specified ID does not exist or is inaccessible */
404: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The error message */
error?: string;
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The list of user IDs */
users: number[];
};
};
};
};
/** Deletes users from an existing team. */
deleteTeamUser: {
parameters: {
path: {
/** The ID of the team */
id: number;
};
};
responses: {
/** A list of user IDs within a team */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The list of user IDs */
data?: number[];
};
};
};
/** Forbidden response */
403: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The error message */
error?: string;
};
};
};
/** Team with specified ID does not exist or is inaccessible */
404: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The error message */
error?: string;
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The list of user IDs */
users: number[];
};
};
};
};
/** Returns data about all teams which have the specified user as a member. */
getUserTeams: {
parameters: {
path: {
/** The ID of the user */
id: number;
};
query: {
/** The field name to sort returned teams by */
order_by?: 'id' | 'name' | 'manager_id' | 'active_flag';
/** When enabled, the teams will not include IDs of member users */
skip_users?: 0 | 1;
};
};
responses: {
/** The list of team objects */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: ({
/** @description The team ID */
id?: number;
} & (({
/** @description The team name */
name: string;
/** @description The team description */
description?: string;
/** @description The team manager ID */
manager_id: number;
/** @description The IDs of the users that belong to the team */
users?: number[];
} & {
/** @description Flag that indicates whether the team is active */
active_flag?: 0 | 1;
/** @description Flag that indicates whether the team is deleted */
deleted_flag?: 0 | 1;
}) & {
/** @description The team creation time. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The ID of the user who created the team */
created_by_user_id?: number;
}))[];
};
};
};
};
};
/** Returns data about a specific mail message. */
getMailMessage: {
parameters: {
path: {
/** The ID of the mail message to fetch */
id: number;
};
query: {
/** Whether to include the full message body or not. `0` = Don't include, `1` = Include */
include_body?: 0 | 1;
};
};
responses: {
/** The mail messages that are being synced with Pipedrive */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
/** @description The email service specific status code and it is returned through the response body. */
statusCode?: number;
/** @description The status text of the response. */
statusText?: string;
/** @description The service name of the response. */
service?: string;
} & {
data?: {
/** @description ID of the mail message. */
id?: number;
/** @description The array of mail message sender (object) */
from?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message receiver (object) */
to?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message copies (object) */
cc?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message blind copies (object) */
bcc?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The mail message body URL */
body_url?: string;
/** @description The connection account ID */
account_id?: string;
/** @description ID of the user whom mail message will be assigned to */
user_id?: number;
/** @description ID of the mail message thread */
mail_thread_id?: number;
/** @description The subject of mail message */
subject?: string;
/** @description The snippet of mail message. Snippet length is up to 225 characters. */
snippet?: string;
/**
* @description The status of tracking mail message. Value is `null` if tracking is not enabled.
* @enum {string|null}
*/
mail_tracking_status?: ('opened' | 'not opened') | null;
/** @description Whether the link tracking in mail message body is enabled. */
mail_link_tracking_enabled_flag?: 0 | 1;
/** @description Whether the mail message is read or not by the user */
read_flag?: 0 | 1;
/** @description If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. */
draft?: string;
/** @description Whether the mail message is a draft or not */
draft_flag?: 0 | 1;
/** @description Whether the mail message is synced with the provider or not */
synced_flag?: 0 | 1;
/** @description Whether the mail message is deleted or not */
deleted_flag?: 0 | 1;
/** @description Whether the mail message has a body or not */
has_body_flag?: 0 | 1;
/** @description Whether the mail message has been sent or not */
sent_flag?: 0 | 1;
/** @description Whether the mail message has been sent from Pipedrive app or not */
sent_from_pipedrive_flag?: 0 | 1;
/** @description Whether the mail message has been created by Smart Email BCC feature or not */
smart_bcc_flag?: 0 | 1;
/**
* Format: date-time
* @description Creation or receival time of the mail message
*/
message_time?: string;
/**
* Format: date-time
* @description The insertion into the database time of the mail message
*/
add_time?: string;
/**
* Format: date-time
* @description The updating time in the database of the mail message
*/
update_time?: string;
/** @description Whether the mail message has an attachment or not */
has_attachments_flag?: 0 | 1;
/** @description Whether the mail message has an inline attachment or not */
has_inline_attachments_flag?: 0 | 1;
/** @description Whether the mail message has an attachment (which is not inline) or not */
has_real_attachments_flag?: 0 | 1;
};
};
};
};
};
};
/** Returns mail threads in a specified folder ordered by the most recent message within. */
getMailThreads: {
parameters: {
query: {
/** The type of folder to fetch */
folder: 'inbox' | 'drafts' | 'sent' | 'archive';
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Get mail threads */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of mail threads */
data?: ({
/** @description ID of the mail thread */
id?: number;
/** @description The connection account ID */
account_id?: string;
/** @description ID of the user whom mail message will be assigned to */
user_id?: number;
/** @description The subject */
subject?: string;
/** @description A snippet */
snippet?: string;
/** @description Whether the mail thread is read */
read_flag?: 0 | 1;
/** @description Mail tracking status */
mail_tracking_status?: string | null;
/** @description Whether the mail thread has an attachment */
has_attachments_flag?: 0 | 1;
/** @description Whether the mail thread has inline attachments */
has_inline_attachments_flag?: 0 | 1;
/** @description Whether the mail thread has real attachments (which are not inline) */
has_real_attachments_flag?: 0 | 1;
/** @description Whether the mail thread is deleted */
deleted_flag?: 0 | 1;
/** @description Whether the mail thread is synced */
synced_flag?: 0 | 1;
/** @description Whether one of the parties of the mail thread is Bcc */
smart_bcc_flag?: 0 | 1;
/** @description Whether the link tracking of the mail thread is enabled */
mail_link_tracking_enabled_flag?: 0 | 1;
} & {
/** @description Parties of the mail thread */
parties?: {
/** @description Recipients of the mail thread */
to?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
/** @description Senders of the mail thread */
from?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
};
/** @description Parties of the drafted mail thread */
drafts_parties?: { [key: string]: unknown }[];
/** @description Folders in which messages from thread are being stored */
folders?: string[];
/** @description Version */
version?: number;
/** @description A snippet from a draft */
snippet_draft?: string | null;
/** @description A snippet from a message sent */
snippet_sent?: string;
/** @description An amount of messages */
message_count?: number;
/** @description Whether the mail thread has any drafts */
has_draft_flag?: number;
/** @description Whether the mail thread has messages sent */
has_sent_flag?: number;
/** @description Whether the mail thread is archived */
archived_flag?: 0 | 1;
/** @description Whether the mail thread is shared */
shared_flag?: 0 | 1;
/** @description Whether the mail thread has been deleted externally */
external_deleted_flag?: 0 | 1;
/** @description Whether the mail thread was initialized by others */
first_message_to_me_flag?: 0 | 1;
/**
* Format: date-time
* @description Last message timestamp
*/
last_message_timestamp?: string;
/**
* Format: date-time
* @description The time when the mail thread has had the first message received or created
*/
first_message_timestamp?: string;
/**
* Format: date-time
* @description The last time when the mail thread has had a message sent
*/
last_message_sent_timestamp?: string | null;
/**
* Format: date-time
* @description The last time when the mail thread has had a message received
*/
last_message_received_timestamp?: string;
/**
* Format: date-time
* @description The time when the mail thread was inserted to database
*/
add_time?: string;
/**
* Format: date-time
* @description The time when the mail thread was updated in database received
*/
update_time?: string;
/** @description The ID of the deal */
deal_id?: number | null;
/** @description Status of the deal */
deal_status?: string | null;
/**
* Format: uuid
* @description The ID of the lead
*/
lead_id?: string | null;
/** @description Whether all the mail thread messages have been sent */
all_messages_sent_flag?: number;
})[];
};
};
};
};
};
/** Returns a specific mail thread. */
getMailThread: {
parameters: {
path: {
/** The ID of the mail thread */
id: number;
};
};
responses: {
/** Get mail threads */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The mail thread object */
data?: {
/** @description ID of the mail thread */
id?: number;
/** @description The connection account ID */
account_id?: string;
/** @description ID of the user whom mail message will be assigned to */
user_id?: number;
/** @description The subject */
subject?: string;
/** @description A snippet */
snippet?: string;
/** @description Whether the mail thread is read */
read_flag?: 0 | 1;
/** @description Mail tracking status */
mail_tracking_status?: string | null;
/** @description Whether the mail thread has an attachment */
has_attachments_flag?: 0 | 1;
/** @description Whether the mail thread has inline attachments */
has_inline_attachments_flag?: 0 | 1;
/** @description Whether the mail thread has real attachments (which are not inline) */
has_real_attachments_flag?: 0 | 1;
/** @description Whether the mail thread is deleted */
deleted_flag?: 0 | 1;
/** @description Whether the mail thread is synced */
synced_flag?: 0 | 1;
/** @description Whether one of the parties of the mail thread is Bcc */
smart_bcc_flag?: 0 | 1;
/** @description Whether the link tracking of the mail thread is enabled */
mail_link_tracking_enabled_flag?: 0 | 1;
} & {
/** @description Parties of the mail thread */
parties?: {
/** @description Recipients of the mail thread */
to?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
/** @description Senders of the mail thread */
from?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
};
/** @description Parties of the drafted mail thread */
drafts_parties?: { [key: string]: unknown }[];
/** @description Folders in which messages from thread are being stored */
folders?: string[];
/** @description Version */
version?: number;
/** @description A snippet from a draft */
snippet_draft?: string | null;
/** @description A snippet from a message sent */
snippet_sent?: string;
/** @description An amount of messages */
message_count?: number;
/** @description Whether the mail thread has any drafts */
has_draft_flag?: number;
/** @description Whether the mail thread has messages sent */
has_sent_flag?: number;
/** @description Whether the mail thread is archived */
archived_flag?: 0 | 1;
/** @description Whether the mail thread is shared */
shared_flag?: 0 | 1;
/** @description Whether the mail thread has been deleted externally */
external_deleted_flag?: 0 | 1;
/** @description Whether the mail thread was initialized by others */
first_message_to_me_flag?: 0 | 1;
/**
* Format: date-time
* @description Last message timestamp
*/
last_message_timestamp?: string;
/**
* Format: date-time
* @description The time when the mail thread has had the first message received or created
*/
first_message_timestamp?: string;
/**
* Format: date-time
* @description The last time when the mail thread has had a message sent
*/
last_message_sent_timestamp?: string | null;
/**
* Format: date-time
* @description The last time when the mail thread has had a message received
*/
last_message_received_timestamp?: string;
/**
* Format: date-time
* @description The time when the mail thread was inserted to database
*/
add_time?: string;
/**
* Format: date-time
* @description The time when the mail thread was updated in database received
*/
update_time?: string;
/** @description The ID of the deal */
deal_id?: number | null;
/** @description Status of the deal */
deal_status?: string | null;
/**
* Format: uuid
* @description The ID of the lead
*/
lead_id?: string | null;
/** @description Whether all the mail thread messages have been sent */
all_messages_sent_flag?: number;
};
};
};
};
};
};
/** Updates the properties of a mail thread. */
updateMailThreadDetails: {
parameters: {
path: {
/** The ID of the mail thread */
id: number;
};
};
responses: {
/** Updates the properties of a mail thread */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/**
* baseMailThread
* @description The mail thread object
*/
data?: {
/** @description ID of the mail thread */
id?: number;
/** @description The connection account ID */
account_id?: string;
/** @description ID of the user whom mail message will be assigned to */
user_id?: number;
/** @description The subject */
subject?: string;
/** @description A snippet */
snippet?: string;
/** @description Whether the mail thread is read */
read_flag?: 0 | 1;
/** @description Mail tracking status */
mail_tracking_status?: string | null;
/** @description Whether the mail thread has an attachment */
has_attachments_flag?: 0 | 1;
/** @description Whether the mail thread has inline attachments */
has_inline_attachments_flag?: 0 | 1;
/** @description Whether the mail thread has real attachments (which are not inline) */
has_real_attachments_flag?: 0 | 1;
/** @description Whether the mail thread is deleted */
deleted_flag?: 0 | 1;
/** @description Whether the mail thread is synced */
synced_flag?: 0 | 1;
/** @description Whether one of the parties of the mail thread is Bcc */
smart_bcc_flag?: 0 | 1;
/** @description Whether the link tracking of the mail thread is enabled */
mail_link_tracking_enabled_flag?: 0 | 1;
} & {
/** @description Parties of the mail thread */
parties?: {
/** @description Recipients of the mail thread */
to?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
/** @description Senders of the mail thread */
from?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
};
/** @description Parties of the drafted mail thread */
drafts_parties?: { [key: string]: unknown }[];
/** @description Folders in which messages from thread are being stored */
folders?: string[];
/** @description Version */
version?: number;
/** @description A snippet from a draft */
snippet_draft?: string | null;
/** @description A snippet from a message sent */
snippet_sent?: string;
/** @description An amount of messages */
message_count?: number;
/** @description Whether the mail thread has any drafts */
has_draft_flag?: number;
/** @description Whether the mail thread has messages sent */
has_sent_flag?: number;
/** @description Whether the mail thread is archived */
archived_flag?: 0 | 1;
/** @description Whether the mail thread is shared */
shared_flag?: 0 | 1;
/** @description Whether the mail thread has been deleted externally */
external_deleted_flag?: 0 | 1;
/** @description Whether the mail thread was initialized by others */
first_message_to_me_flag?: 0 | 1;
/**
* Format: date-time
* @description Last message timestamp
*/
last_message_timestamp?: string;
/**
* Format: date-time
* @description The time when the mail thread has had the first message received or created
*/
first_message_timestamp?: string;
/**
* Format: date-time
* @description The last time when the mail thread has had a message sent
*/
last_message_sent_timestamp?: string | null;
/**
* Format: date-time
* @description The last time when the mail thread has had a message received
*/
last_message_received_timestamp?: string;
/**
* Format: date-time
* @description The time when the mail thread was inserted to database
*/
add_time?: string;
/**
* Format: date-time
* @description The time when the mail thread was updated in database received
*/
update_time?: string;
/** @description The ID of the deal */
deal_id?: number | null;
/** @description Status of the deal */
deal_status?: string | null;
/**
* Format: uuid
* @description The ID of the lead
*/
lead_id?: string | null;
/** @description Whether all the mail thread messages have been sent */
all_messages_sent_flag?: number;
};
};
};
};
};
requestBody: {
content: {
'application/x-www-form-urlencoded': {
/** @description The ID of the deal this thread is associated with */
deal_id?: number;
/**
* Format: uuid
* @description The ID of the lead this thread is associated with
*/
lead_id?: string;
/** @description Whether this thread is shared with other users in your company */
shared_flag?: 0 | 1;
/** @description Whether this thread is read or unread */
read_flag?: 0 | 1;
/** @description Whether this thread is archived or not. You can only archive threads that belong to Inbox folder. Archived threads will disappear from Inbox. */
archived_flag?: 0 | 1;
};
};
};
};
/** Marks a mail thread as deleted. */
deleteMailThread: {
parameters: {
path: {
/** The ID of the mail thread */
id: number;
};
};
responses: {
/** Marks mail thread as deleted */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description An array of mail threads */
data?: ({
/** @description ID of the mail thread */
id?: number;
/** @description The connection account ID */
account_id?: string;
/** @description ID of the user whom mail message will be assigned to */
user_id?: number;
/** @description The subject */
subject?: string;
/** @description A snippet */
snippet?: string;
/** @description Whether the mail thread is read */
read_flag?: 0 | 1;
/** @description Mail tracking status */
mail_tracking_status?: string | null;
/** @description Whether the mail thread has an attachment */
has_attachments_flag?: 0 | 1;
/** @description Whether the mail thread has inline attachments */
has_inline_attachments_flag?: 0 | 1;
/** @description Whether the mail thread has real attachments (which are not inline) */
has_real_attachments_flag?: 0 | 1;
/** @description Whether the mail thread is deleted */
deleted_flag?: 0 | 1;
/** @description Whether the mail thread is synced */
synced_flag?: 0 | 1;
/** @description Whether one of the parties of the mail thread is Bcc */
smart_bcc_flag?: 0 | 1;
/** @description Whether the link tracking of the mail thread is enabled */
mail_link_tracking_enabled_flag?: 0 | 1;
} & {
/** @description Parties of the mail thread */
parties?: {
/** @description Recipients of the mail thread */
to?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
/** @description Senders of the mail thread */
from?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
};
/** @description Parties of the drafted mail thread */
drafts_parties?: { [key: string]: unknown }[];
/** @description Folders in which messages from thread are being stored */
folders?: string[];
/** @description Version */
version?: number;
/** @description A snippet from a draft */
snippet_draft?: string | null;
/** @description A snippet from a message sent */
snippet_sent?: string;
/** @description An amount of messages */
message_count?: number;
/** @description Whether the mail thread has any drafts */
has_draft_flag?: number;
/** @description Whether the mail thread has messages sent */
has_sent_flag?: number;
/** @description Whether the mail thread is archived */
archived_flag?: 0 | 1;
/** @description Whether the mail thread is shared */
shared_flag?: 0 | 1;
/** @description Whether the mail thread has been deleted externally */
external_deleted_flag?: 0 | 1;
/** @description Whether the mail thread was initialized by others */
first_message_to_me_flag?: 0 | 1;
/**
* Format: date-time
* @description Last message timestamp
*/
last_message_timestamp?: string;
/**
* Format: date-time
* @description The time when the mail thread has had the first message received or created
*/
first_message_timestamp?: string;
/**
* Format: date-time
* @description The last time when the mail thread has had a message sent
*/
last_message_sent_timestamp?: string | null;
/**
* Format: date-time
* @description The last time when the mail thread has had a message received
*/
last_message_received_timestamp?: string;
/**
* Format: date-time
* @description The time when the mail thread was inserted to database
*/
add_time?: string;
/**
* Format: date-time
* @description The time when the mail thread was updated in database received
*/
update_time?: string;
/** @description The ID of the deal */
deal_id?: number | null;
/** @description Status of the deal */
deal_status?: string | null;
/**
* Format: uuid
* @description The ID of the lead
*/
lead_id?: string | null;
/** @description Whether all the mail thread messages have been sent */
all_messages_sent_flag?: number;
})[];
};
};
};
};
};
/** Returns all the mail messages inside a specified mail thread. */
getMailThreadMessages: {
parameters: {
path: {
/** The ID of the mail thread */
id: number;
};
};
responses: {
/** Get mail messages from thread */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of the mail messages of the mail thread */
data?: ({
/** @description ID of the mail thread */
id?: number;
/** @description The connection account ID */
account_id?: string;
/** @description ID of the user whom mail message will be assigned to */
user_id?: number;
/** @description The subject */
subject?: string;
/** @description A snippet */
snippet?: string;
/** @description Whether the mail thread is read */
read_flag?: 0 | 1;
/** @description Mail tracking status */
mail_tracking_status?: string | null;
/** @description Whether the mail thread has an attachment */
has_attachments_flag?: 0 | 1;
/** @description Whether the mail thread has inline attachments */
has_inline_attachments_flag?: 0 | 1;
/** @description Whether the mail thread has real attachments (which are not inline) */
has_real_attachments_flag?: 0 | 1;
/** @description Whether the mail thread is deleted */
deleted_flag?: 0 | 1;
/** @description Whether the mail thread is synced */
synced_flag?: 0 | 1;
/** @description Whether one of the parties of the mail thread is Bcc */
smart_bcc_flag?: 0 | 1;
/** @description Whether the link tracking of the mail thread is enabled */
mail_link_tracking_enabled_flag?: 0 | 1;
} & {
/** @description Senders of the mail thread */
from?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
/** @description Recipients of the mail thread */
to?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
/** @description Participants of the Cc */
cc?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
/** @description Participants of the Bcc */
bcc?: {
/** @description ID of the mail thread participant */
id?: number;
/** @description Name of the mail thread participant */
name?: string;
/** @description Whether the mail thread participant was last to send an email */
latest_sent?: boolean;
/** @description Email address of the mail thread participant */
email_address?: string;
/** @description Message time */
message_time?: number;
/** @description ID of the linked person */
linked_person_id?: number;
/** @description Email of the linked person */
linked_person_name?: string;
/** @description ID of the mail message party */
mail_message_party_id?: number;
/** @description Linked Organization ID */
linked_organization_id?: number | null;
}[];
/** @description A link to the mail thread message */
body_url?: string;
/** @description ID of the mail thread */
mail_thread_id?: number;
/** @description If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. */
draft?: string | null;
/** @description Whether the mail thread message has a body */
has_body_flag?: number;
/** @description Whether the mail thread message is sent */
sent_flag?: number;
/** @description Whether the mail thread message is sent from Pipedrive */
sent_from_pipedrive_flag?: number;
/**
* Format: date-time
* @description The time when the mail message was received or created
*/
message_time?: string;
/**
* Format: date-time
* @description The time when the mail message was inserted to database
*/
add_time?: string;
/**
* Format: date-time
* @description The time when the mail message was updated in database received
*/
update_time?: string;
})[];
};
};
};
};
};
/** Returns all notes. */
getNotes: {
parameters: {
query: {
/** The ID of the user whose notes to fetch. If omitted, notes by all users will be returned. */
user_id?: number;
/** The ID of the lead which notes to fetch. If omitted, notes about all leads will be returned. */
lead_id?: string;
/** The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. */
deal_id?: number;
/** The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. */
person_id?: number;
/** The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. */
org_id?: number;
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** 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`, `content`, `add_time`, `update_time`. */
sort?: string;
/** The date in format of YYYY-MM-DD from which notes to fetch */
start_date?: string;
/** The date in format of YYYY-MM-DD until which notes to fetch to */
end_date?: string;
/** If set, the results are filtered by note to lead pinning state */
pinned_to_lead_flag?: 0 | 1;
/** If set, the results are filtered by note to deal pinning state */
pinned_to_deal_flag?: 0 | 1;
/** If set, the results are filtered by note to organization pinning state */
pinned_to_organization_flag?: 0 | 1;
/** If set, the results are filtered by note to person pinning state */
pinned_to_person_flag?: 0 | 1;
};
};
responses: {
/** Get all notes */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description The array of notes */
data?: {
/** @description The ID of the note */
id?: number;
/** @description Whether the note is active or deleted */
active_flag?: boolean;
/** @description The creation date and time of the note */
add_time?: string;
/** @description The content of the note in HTML format. Subject to sanitization on the back-end. */
content?: string;
/** @description The deal this note is attached to */
deal?: {
/** @description The title of the deal this note is attached to */
title?: string;
};
/**
* Format: uuid
* @description The ID of the lead the note is attached to
*/
lead_id?: string;
/** @description The ID of the deal the note is attached to */
deal_id?: number;
/** @description The ID of the user who last updated the note */
last_update_user_id?: number;
/** @description The ID of the organization the note is attached to */
org_id?: number;
/** @description The organization the note is attached to */
organization?: {
/** @description The name of the organization the note is attached to */
name?: string;
};
/** @description The person the note is attached to */
person?: {
/** @description The name of the person the note is attached to */
name?: string;
};
/** @description The ID of the person the note is attached to */
person_id?: number;
/** @description If true, the results are filtered by note to deal pinning state */
pinned_to_deal_flag?: boolean;
/** @description If true, the results are filtered by note to organization pinning state */
pinned_to_organization_flag?: boolean;
/** @description If true, the results are filtered by note to person pinning state */
pinned_to_person_flag?: boolean;
/** @description The last updated date and time of the note */
update_time?: string;
/** @description The user who created the note */
user?: {
/** @description The email of the note creator */
email?: string;
/** @description The URL of the note creator avatar picture */
icon_url?: string;
/** @description Whether the note is created by you or not */
is_you?: boolean;
/** @description The name of the note creator */
name?: string;
};
/** @description The ID of the note creator */
user_id?: number;
}[];
additional_data?: {
/** @description The pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
} & {
/** @description Next pagination start */
next_start?: number;
};
};
};
};
};
};
};
/** Adds a new note. */
addNote: {
responses: {
/** Add, update or get a note */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the note */
id?: number;
/** @description Whether the note is active or deleted */
active_flag?: boolean;
/** @description The creation date and time of the note */
add_time?: string;
/** @description The content of the note in HTML format. Subject to sanitization on the back-end. */
content?: string;
/** @description The deal this note is attached to */
deal?: {
/** @description The title of the deal this note is attached to */
title?: string;
};
/**
* Format: uuid
* @description The ID of the lead the note is attached to
*/
lead_id?: string;
/** @description The ID of the deal the note is attached to */
deal_id?: number;
/** @description The ID of the user who last updated the note */
last_update_user_id?: number;
/** @description The ID of the organization the note is attached to */
org_id?: number;
/** @description The organization the note is attached to */
organization?: {
/** @description The name of the organization the note is attached to */
name?: string;
};
/** @description The person the note is attached to */
person?: {
/** @description The name of the person the note is attached to */
name?: string;
};
/** @description The ID of the person the note is attached to */
person_id?: number;
/** @description If true, the results are filtered by note to deal pinning state */
pinned_to_deal_flag?: boolean;
/** @description If true, the results are filtered by note to organization pinning state */
pinned_to_organization_flag?: boolean;
/** @description If true, the results are filtered by note to person pinning state */
pinned_to_person_flag?: boolean;
/** @description The last updated date and time of the note */
update_time?: string;
/** @description The user who created the note */
user?: {
/** @description The email of the note creator */
email?: string;
/** @description The URL of the note creator avatar picture */
icon_url?: string;
/** @description Whether the note is created by you or not */
is_you?: boolean;
/** @description The name of the note creator */
name?: string;
};
/** @description The ID of the note creator */
user_id?: number;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The content of the note in HTML format. Subject to sanitization on the back-end. */
content: string;
/**
* Format: uuid
* @description The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id`) is specified.
*/
lead_id?: string;
/** @description The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id`) is specified. */
deal_id?: number;
/** @description The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id`) is specified. */
person_id?: number;
/** @description The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id`) is specified. */
org_id?: number;
} & {
/** @description The ID of the user who will be marked as the author of the note. Only an admin can change the author. */
user_id?: number;
/** @description The optional creation date & time of the note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description If set, the results are filtered by note to lead pinning state (`lead_id` is also required) */
pinned_to_lead_flag?: 0 | 1;
/** @description If set, the results are filtered by note to deal pinning state (`deal_id` is also required) */
pinned_to_deal_flag?: 0 | 1;
/** @description If set, the results are filtered by note to organization pinning state (`org_id` is also required) */
pinned_to_organization_flag?: 0 | 1;
/** @description If set, the results are filtered by note to person pinning state (`person_id` is also required) */
pinned_to_person_flag?: 0 | 1;
};
};
};
};
/** Returns details about a specific note. */
getNote: {
parameters: {
path: {
/** The ID of the note */
id: number;
};
};
responses: {
/** Add, update or get a note */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the note */
id?: number;
/** @description Whether the note is active or deleted */
active_flag?: boolean;
/** @description The creation date and time of the note */
add_time?: string;
/** @description The content of the note in HTML format. Subject to sanitization on the back-end. */
content?: string;
/** @description The deal this note is attached to */
deal?: {
/** @description The title of the deal this note is attached to */
title?: string;
};
/**
* Format: uuid
* @description The ID of the lead the note is attached to
*/
lead_id?: string;
/** @description The ID of the deal the note is attached to */
deal_id?: number;
/** @description The ID of the user who last updated the note */
last_update_user_id?: number;
/** @description The ID of the organization the note is attached to */
org_id?: number;
/** @description The organization the note is attached to */
organization?: {
/** @description The name of the organization the note is attached to */
name?: string;
};
/** @description The person the note is attached to */
person?: {
/** @description The name of the person the note is attached to */
name?: string;
};
/** @description The ID of the person the note is attached to */
person_id?: number;
/** @description If true, the results are filtered by note to deal pinning state */
pinned_to_deal_flag?: boolean;
/** @description If true, the results are filtered by note to organization pinning state */
pinned_to_organization_flag?: boolean;
/** @description If true, the results are filtered by note to person pinning state */
pinned_to_person_flag?: boolean;
/** @description The last updated date and time of the note */
update_time?: string;
/** @description The user who created the note */
user?: {
/** @description The email of the note creator */
email?: string;
/** @description The URL of the note creator avatar picture */
icon_url?: string;
/** @description Whether the note is created by you or not */
is_you?: boolean;
/** @description The name of the note creator */
name?: string;
};
/** @description The ID of the note creator */
user_id?: number;
};
};
};
};
};
};
/** Updates a note. */
updateNote: {
parameters: {
path: {
/** The ID of the note */
id: number;
};
};
responses: {
/** Add, update or get a note */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the note */
id?: number;
/** @description Whether the note is active or deleted */
active_flag?: boolean;
/** @description The creation date and time of the note */
add_time?: string;
/** @description The content of the note in HTML format. Subject to sanitization on the back-end. */
content?: string;
/** @description The deal this note is attached to */
deal?: {
/** @description The title of the deal this note is attached to */
title?: string;
};
/**
* Format: uuid
* @description The ID of the lead the note is attached to
*/
lead_id?: string;
/** @description The ID of the deal the note is attached to */
deal_id?: number;
/** @description The ID of the user who last updated the note */
last_update_user_id?: number;
/** @description The ID of the organization the note is attached to */
org_id?: number;
/** @description The organization the note is attached to */
organization?: {
/** @description The name of the organization the note is attached to */
name?: string;
};
/** @description The person the note is attached to */
person?: {
/** @description The name of the person the note is attached to */
name?: string;
};
/** @description The ID of the person the note is attached to */
person_id?: number;
/** @description If true, the results are filtered by note to deal pinning state */
pinned_to_deal_flag?: boolean;
/** @description If true, the results are filtered by note to organization pinning state */
pinned_to_organization_flag?: boolean;
/** @description If true, the results are filtered by note to person pinning state */
pinned_to_person_flag?: boolean;
/** @description The last updated date and time of the note */
update_time?: string;
/** @description The user who created the note */
user?: {
/** @description The email of the note creator */
email?: string;
/** @description The URL of the note creator avatar picture */
icon_url?: string;
/** @description Whether the note is created by you or not */
is_you?: boolean;
/** @description The name of the note creator */
name?: string;
};
/** @description The ID of the note creator */
user_id?: number;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The content of the note in HTML format. Subject to sanitization on the back-end. */
content?: string;
} & {
/**
* Format: uuid
* @description The ID of the lead the note will be attached to
*/
lead_id?: string;
/** @description The ID of the deal the note will be attached to */
deal_id?: number;
/** @description The ID of the person the note will be attached to */
person_id?: number;
/** @description The ID of the organization the note will be attached to */
org_id?: number;
} & {
/** @description The ID of the user who will be marked as the author of the note. Only an admin can change the author. */
user_id?: number;
/** @description The optional creation date & time of the note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description If set, the results are filtered by note to lead pinning state (`lead_id` is also required) */
pinned_to_lead_flag?: 0 | 1;
/** @description If set, the results are filtered by note to deal pinning state (`deal_id` is also required) */
pinned_to_deal_flag?: 0 | 1;
/** @description If set, the results are filtered by note to organization pinning state (`org_id` is also required) */
pinned_to_organization_flag?: 0 | 1;
/** @description If set, the results are filtered by note to person pinning state (`person_id` is also required) */
pinned_to_person_flag?: 0 | 1;
};
};
};
};
/** Deletes a specific note. */
deleteNote: {
parameters: {
path: {
/** The ID of the note */
id: number;
};
};
responses: {
/** Delete a note */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description If the response is successful or not */
data?: boolean;
};
};
};
};
};
/** Returns all comments associated with a note. */
getNoteComments: {
parameters: {
path: {
/** The ID of the note */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Get all comments */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description The array of comments */
data?: {
/**
* Format: uuid
* @description The ID of the note
*/
uuid?: string;
/** @description Whether the note is active or deleted */
active_flag?: boolean;
/** @description The creation date and time of the note */
add_time?: string;
/** @description The creation date and time of the note */
update_time?: string;
/** @description The content of the note in HTML format. Subject to sanitization on the back-end. */
content?: string;
/** @description The ID of the object that the comment is attached to, will be the id of the note */
object_id?: string;
/** @description The type of object that the comment is attached to, will be "note" */
object_type?: string;
/** @description The ID of the user who created the comment */
user_id?: number;
/** @description The ID of the user who last updated the comment */
updater_id?: number;
/** @description The ID of the company */
company_id?: number;
}[];
additional_data?: {
/** @description The pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
} & {
/** @description Next pagination start */
next_start?: number;
};
};
};
};
};
};
};
/** Adds a new comment to a note. */
addNoteComment: {
parameters: {
path: {
/** The ID of the note */
id: number;
};
};
responses: {
/** Add, update or get a comment */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/**
* Format: uuid
* @description The ID of the note
*/
uuid?: string;
/** @description Whether the note is active or deleted */
active_flag?: boolean;
/** @description The creation date and time of the note */
add_time?: string;
/** @description The creation date and time of the note */
update_time?: string;
/** @description The content of the note in HTML format. Subject to sanitization on the back-end. */
content?: string;
/** @description The ID of the object that the comment is attached to, will be the id of the note */
object_id?: string;
/** @description The type of object that the comment is attached to, will be "note" */
object_type?: string;
/** @description The ID of the user who created the comment */
user_id?: number;
/** @description The ID of the user who last updated the comment */
updater_id?: number;
/** @description The ID of the company */
company_id?: number;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The content of the comment in HTML format. Subject to sanitization on the back-end. */
content: string;
};
};
};
};
/** Returns the details of a comment. */
getComment: {
parameters: {
path: {
/** The ID of the note */
id: number;
/** The ID of the comment */
commentId: string;
};
};
responses: {
/** Add, update or get a comment */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/**
* Format: uuid
* @description The ID of the note
*/
uuid?: string;
/** @description Whether the note is active or deleted */
active_flag?: boolean;
/** @description The creation date and time of the note */
add_time?: string;
/** @description The creation date and time of the note */
update_time?: string;
/** @description The content of the note in HTML format. Subject to sanitization on the back-end. */
content?: string;
/** @description The ID of the object that the comment is attached to, will be the id of the note */
object_id?: string;
/** @description The type of object that the comment is attached to, will be "note" */
object_type?: string;
/** @description The ID of the user who created the comment */
user_id?: number;
/** @description The ID of the user who last updated the comment */
updater_id?: number;
/** @description The ID of the company */
company_id?: number;
};
};
};
};
};
};
/** Updates a comment related to a note. */
updateCommentForNote: {
parameters: {
path: {
/** The ID of the note */
id: number;
/** The ID of the comment */
commentId: string;
};
};
responses: {
/** Add, update or get a comment */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/**
* Format: uuid
* @description The ID of the note
*/
uuid?: string;
/** @description Whether the note is active or deleted */
active_flag?: boolean;
/** @description The creation date and time of the note */
add_time?: string;
/** @description The creation date and time of the note */
update_time?: string;
/** @description The content of the note in HTML format. Subject to sanitization on the back-end. */
content?: string;
/** @description The ID of the object that the comment is attached to, will be the id of the note */
object_id?: string;
/** @description The type of object that the comment is attached to, will be "note" */
object_type?: string;
/** @description The ID of the user who created the comment */
user_id?: number;
/** @description The ID of the user who last updated the comment */
updater_id?: number;
/** @description The ID of the company */
company_id?: number;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The content of the comment in HTML format. Subject to sanitization on the back-end. */
content: string;
};
};
};
};
/** Deletes a comment. */
deleteComment: {
parameters: {
path: {
/** The ID of the note */
id: number;
/** The ID of the comment */
commentId: string;
};
};
responses: {
/** Delete a comment */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description If the response is successful or not */
data?: boolean;
};
};
};
};
};
/** Returns data about all note fields. */
getNoteFields: {
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field */
id?: number;
/** @description The key of the field */
key?: string;
/** @description The name of the field */
name?: string;
/**
* @description The type of the field<table><tr><th>Value</th><th>Description</th></tr><tr><td>`address`</td><td>Address field (has multiple subfields, autocompleted by Google Maps)</td></tr><tr><td>`date`</td><td>Date (format YYYY-MM-DD)</td></tr><tr><td>`daterange`</td><td>Date-range field (has a start date and end date value, both YYYY-MM-DD)</td></tr><tr><td>`double`</td><td>Numeric value</td></tr><tr><td>`enum`</td><td>Options field with a single possible chosen option</td></tr><tr></tr><tr><td>`monetary`</td><td>Monetary field (has a numeric value and a currency value)</td></tr><tr><td>`org`</td><td>Organization field (contains an organization ID which is stored on the same account)</td></tr><tr><td>`people`</td><td>Person field (contains a person ID which is stored on the same account)</td></tr><tr><td>`phone`</td><td>Phone field (up to 255 numbers and/or characters)</td></tr><tr><td>`set`</td><td>Options field with a possibility of having multiple chosen options</td></tr><tr><td>`text`</td><td>Long text (up to 65k characters)</td></tr><tr><td>`time`</td><td>Time field (format HH:MM:SS)</td></tr><tr><td>`timerange`</td><td>Time-range field (has a start time and end time value, both HH:MM:SS)</td></tr><tr><td>`user`</td><td>User field (contains a user ID of another Pipedrive user)</td></tr><tr><td>`varchar`</td><td>Text (up to 255 characters)</td></tr><tr><td>`varchar_auto`</td><td>Autocomplete text (up to 255 characters)</td></tr><tr><td>`visible_to`</td><td>System field that keeps item's visibility setting</td></tr></table>
* @enum {string}
*/
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
bulk_edit_allowed?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: {
id?: number;
label?: string;
}[];
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Returns all organizations. */
getOrganizations: {
parameters: {
query: {
/** If supplied, only organizations owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. */
user_id?: number;
/** The ID of the filter to use */
filter_id?: number;
/** If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive) */
first_char?: string;
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** 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). */
sort?: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of organizations */
data?: ({
/** @description The ID of the organization */
id?: number;
/** @description The ID of the company related to the organization */
company_id?: number;
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** @description The name of the organization */
name?: string;
/** @description Whether the organization is active or not */
active_flag?: boolean;
picture_id?: {
/** @description The ID of the picture associated with the item */
value?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The country code of the organization */
country_code?: string;
/** @description The first character of the organization name */
first_char?: string;
/** @description The creation date and time of the organization */
add_time?: string;
/** @description The last updated date and time of the organization */
update_time?: string;
/** @description The visibility group ID of who can see the organization */
visible_to?: string;
/** @description The ID of the label */
label?: number;
/** @description The name of the organization owner */
owner_name?: string;
/** @description The BCC email of the organization */
cc_email?: string;
} & (({
/** @description The count of email messages related to the organization */
email_messages_count?: number;
/** @description The count of persons related to the organization */
people_count?: number;
/** @description The count of activities related to the organization */
activities_count?: number;
/** @description The count of done activities related to the organization */
done_activities_count?: number;
/** @description The count of undone activities related to the organization */
undone_activities_count?: number;
/** @description The count of files related to the organization */
files_count?: number;
/** @description The count of notes related to the organization */
notes_count?: number;
/** @description The count of followers related to the organization */
followers_count?: number;
} & {
/** @description The full address of the organization */
address?: string;
/** @description The sub-premise of the organization location */
address_subpremise?: string;
/** @description The street number of the organization location */
address_street_number?: string;
/** @description The route of the organization location */
address_route?: string;
/** @description The sub-locality of the organization location */
address_sublocality?: string;
/** @description The locality of the organization location */
address_locality?: string;
/** @description The level 1 admin area of the organization location */
address_admin_area_level_1?: string;
/** @description The level 2 admin area of the organization location */
address_admin_area_level_2?: string;
/** @description The country of the organization location */
address_country?: string;
/** @description The postal code of the organization location */
address_postal_code?: string;
/** @description The formatted organization location */
address_formatted_address?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
})))[];
additional_data?: {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
/** @description The picture that is associated with the item */
picture?: {
/** @description The ID of the picture */
PICTURE_ID?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
};
};
};
};
};
};
};
/** Adds a new organization. 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 organizationFields and look for `key` values. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-an-organization" target="_blank" rel="noopener noreferrer">adding an organization</a>. */
addOrganization: {
responses: {
/** Success */
201: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** baseOrganizationItemWithEditNameFlag */
data?: ({
/** @description The ID of the organization */
id?: number;
/** @description The ID of the company related to the organization */
company_id?: number;
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** @description The name of the organization */
name?: string;
/** @description Whether the organization is active or not */
active_flag?: boolean;
picture_id?: {
/** @description The ID of the picture associated with the item */
value?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The country code of the organization */
country_code?: string;
/** @description The first character of the organization name */
first_char?: string;
/** @description The creation date and time of the organization */
add_time?: string;
/** @description The last updated date and time of the organization */
update_time?: string;
/** @description The visibility group ID of who can see the organization */
visible_to?: string;
/** @description The ID of the label */
label?: number;
/** @description The name of the organization owner */
owner_name?: string;
/** @description The BCC email of the organization */
cc_email?: string;
} & (({
/** @description The count of email messages related to the organization */
email_messages_count?: number;
/** @description The count of persons related to the organization */
people_count?: number;
/** @description The count of activities related to the organization */
activities_count?: number;
/** @description The count of done activities related to the organization */
done_activities_count?: number;
/** @description The count of undone activities related to the organization */
undone_activities_count?: number;
/** @description The count of files related to the organization */
files_count?: number;
/** @description The count of notes related to the organization */
notes_count?: number;
/** @description The count of followers related to the organization */
followers_count?: number;
} & {
/** @description The full address of the organization */
address?: string;
/** @description The sub-premise of the organization location */
address_subpremise?: string;
/** @description The street number of the organization location */
address_street_number?: string;
/** @description The route of the organization location */
address_route?: string;
/** @description The sub-locality of the organization location */
address_sublocality?: string;
/** @description The locality of the organization location */
address_locality?: string;
/** @description The level 1 admin area of the organization location */
address_admin_area_level_1?: string;
/** @description The level 2 admin area of the organization location */
address_admin_area_level_2?: string;
/** @description The country of the organization location */
address_country?: string;
/** @description The postal code of the organization location */
address_postal_code?: string;
/** @description The formatted organization location */
address_formatted_address?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
}))) & {
/** @description If the company ID of the organization and company ID of the request is same or not */
edit_name?: boolean;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
/** @description The picture that is associated with the item */
picture?: {
/** @description The ID of the picture */
PICTURE_ID?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the organization */
name: string;
/** @description The optional creation date & time of the organization in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
} & {
/** @description The ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. */
owner_id?: number;
/** @description The visibility of the organization. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href="https://support.pipedrive.com/en/article/visibility-groups" target="_blank" rel="noopener noreferrer">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> */
visible_to?: string;
};
};
};
};
/** Marks multiple organizations as deleted. After 30 days, the organizations will be permanently deleted. */
deleteOrganizations: {
parameters: {
query: {
/** The comma-separated IDs that will be deleted */
ids: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The IDs of the organizations that were deleted */
id?: number[];
};
};
};
};
};
};
/** Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of <a href="https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem">/v1/itemSearch</a> with a narrower OAuth scope. */
searchOrganization: {
parameters: {
query: {
/** The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). */
term: string;
/** A comma-separated string array. The fields to perform the search from. Defaults to all of them. */
fields?: 'address' | 'custom_fields' | 'notes' | 'name';
/** When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. */
exact_match?: true | false;
/** Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The array of found items */
items?: {
/** @description Search result relevancy */
result_score?: number;
item?: {
/** @description The ID of the organization */
id?: number;
/** @description The type of the item */
type?: string;
/** @description The name of the organization */
name?: string;
/** @description The address of the organization */
address?: string;
/** @description The visibility of the organization */
visible_to?: number;
owner?: {
/** @description The ID of the owner of the deal */
id?: number;
};
/** @description Custom fields */
custom_fields?: string[];
/** @description An array of notes */
notes?: string[];
};
}[];
};
additional_data?: {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
};
};
};
};
};
/** Returns the details of an organization. Note that this also returns some additional fields which are not present when asking for all organizations. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the `key` value of organizationFields. */
getOrganization: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** organizationItem */
data?: (({
/** @description The ID of the organization */
id?: number;
/** @description The ID of the company related to the organization */
company_id?: number;
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** @description The name of the organization */
name?: string;
/** @description Whether the organization is active or not */
active_flag?: boolean;
picture_id?: {
/** @description The ID of the picture associated with the item */
value?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The country code of the organization */
country_code?: string;
/** @description The first character of the organization name */
first_char?: string;
/** @description The creation date and time of the organization */
add_time?: string;
/** @description The last updated date and time of the organization */
update_time?: string;
/** @description The visibility group ID of who can see the organization */
visible_to?: string;
/** @description The ID of the label */
label?: number;
/** @description The name of the organization owner */
owner_name?: string;
/** @description The BCC email of the organization */
cc_email?: string;
} & (({
/** @description The count of email messages related to the organization */
email_messages_count?: number;
/** @description The count of persons related to the organization */
people_count?: number;
/** @description The count of activities related to the organization */
activities_count?: number;
/** @description The count of done activities related to the organization */
done_activities_count?: number;
/** @description The count of undone activities related to the organization */
undone_activities_count?: number;
/** @description The count of files related to the organization */
files_count?: number;
/** @description The count of notes related to the organization */
notes_count?: number;
/** @description The count of followers related to the organization */
followers_count?: number;
} & {
/** @description The full address of the organization */
address?: string;
/** @description The sub-premise of the organization location */
address_subpremise?: string;
/** @description The street number of the organization location */
address_street_number?: string;
/** @description The route of the organization location */
address_route?: string;
/** @description The sub-locality of the organization location */
address_sublocality?: string;
/** @description The locality of the organization location */
address_locality?: string;
/** @description The level 1 admin area of the organization location */
address_admin_area_level_1?: string;
/** @description The level 2 admin area of the organization location */
address_admin_area_level_2?: string;
/** @description The country of the organization location */
address_country?: string;
/** @description The postal code of the organization location */
address_postal_code?: string;
/** @description The formatted organization location */
address_formatted_address?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
}))) & {
/** @description If the company ID of the organization and company ID of the request is same or not */
edit_name?: boolean;
}) & {
/** @description Please refer to response schema of <a href="https://developers.pipedrive.com/docs/api/v1/Activities#getActivity">Activity</a> */
last_activity?: { [key: string]: unknown };
/** @description Please refer to response schema of <a href="https://developers.pipedrive.com/docs/api/v1/Activities#getActivity">Activity</a> */
next_activity?: { [key: string]: unknown };
};
additional_data?: {
/** @description The follower that is associated with the item */
followers?: {
/** @description The user ID of the follower */
FOLLOWER_USER_ID?: {
/** @description The ID of the follower associated with the item */
id?: number;
} & {
/** @description The name of the follower */
name?: string;
/** @description The email of the follower */
email?: string;
/** @description The user ID of the follower */
user_id?: number;
/** @description The follower picture hash */
pic_hash?: string;
};
};
/** @description Dropbox email for the organization */
dropbox_email?: string;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
/** @description The picture that is associated with the item */
picture?: {
/** @description The ID of the picture */
PICTURE_ID?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
};
};
};
};
};
};
};
/** Updates the properties of an organization. */
updateOrganization: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** baseOrganizationItem */
data?: {
/** @description The ID of the organization */
id?: number;
/** @description The ID of the company related to the organization */
company_id?: number;
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** @description The name of the organization */
name?: string;
/** @description Whether the organization is active or not */
active_flag?: boolean;
picture_id?: {
/** @description The ID of the picture associated with the item */
value?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The country code of the organization */
country_code?: string;
/** @description The first character of the organization name */
first_char?: string;
/** @description The creation date and time of the organization */
add_time?: string;
/** @description The last updated date and time of the organization */
update_time?: string;
/** @description The visibility group ID of who can see the organization */
visible_to?: string;
/** @description The ID of the label */
label?: number;
/** @description The name of the organization owner */
owner_name?: string;
/** @description The BCC email of the organization */
cc_email?: string;
} & (({
/** @description The count of email messages related to the organization */
email_messages_count?: number;
/** @description The count of persons related to the organization */
people_count?: number;
/** @description The count of activities related to the organization */
activities_count?: number;
/** @description The count of done activities related to the organization */
done_activities_count?: number;
/** @description The count of undone activities related to the organization */
undone_activities_count?: number;
/** @description The count of files related to the organization */
files_count?: number;
/** @description The count of notes related to the organization */
notes_count?: number;
/** @description The count of followers related to the organization */
followers_count?: number;
} & {
/** @description The full address of the organization */
address?: string;
/** @description The sub-premise of the organization location */
address_subpremise?: string;
/** @description The street number of the organization location */
address_street_number?: string;
/** @description The route of the organization location */
address_route?: string;
/** @description The sub-locality of the organization location */
address_sublocality?: string;
/** @description The locality of the organization location */
address_locality?: string;
/** @description The level 1 admin area of the organization location */
address_admin_area_level_1?: string;
/** @description The level 2 admin area of the organization location */
address_admin_area_level_2?: string;
/** @description The country of the organization location */
address_country?: string;
/** @description The postal code of the organization location */
address_postal_code?: string;
/** @description The formatted organization location */
address_formatted_address?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
}));
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
/** @description The picture that is associated with the item */
picture?: {
/** @description The ID of the picture */
PICTURE_ID?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the organization */
name?: string;
} & {
/** @description The ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. */
owner_id?: number;
/** @description The visibility of the organization. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href="https://support.pipedrive.com/en/article/visibility-groups" target="_blank" rel="noopener noreferrer">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> */
visible_to?: string;
};
};
};
};
/** Marks an organization as deleted. After 30 days, the organization will be permanently deleted. */
deleteOrganization: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the organization that was deleted */
id?: number;
};
};
};
};
};
};
/** Lists activities associated with an organization. */
getOrganizationActivities: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. */
done?: 0 | 1;
/** A comma-separated string of activity IDs to exclude from result */
exclude?: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of activities */
data?: ({
/**
* Format: date
* @description The due date of the activity. Format: YYYY-MM-DD
*/
due_date?: string;
/** @description The due time of the activity in UTC. Format: HH:MM */
due_time?: string;
/** @description The duration of the activity. Format: HH:MM */
duration?: string;
/** @description The ID of the deal this activity is associated with */
deal_id?: number;
/** @description The ID of the lead this activity is associated with */
lead_id?: string;
/** @description The ID of the person this activity is associated with */
person_id?: number;
/** @description The ID of the organization this activity is associated with */
org_id?: number;
/** @description The note of the activity (HTML format) */
note?: string;
/** @description The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. */
location?: string;
/** @description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. */
public_description?: string;
} & {
/** @description The activity ID, generated when the activity was created */
id?: number;
/** @description Whether the activity is done or not */
done?: boolean;
/** @description The subject of the activity */
subject?: string;
/** @description The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. */
type?: string;
/** @description The ID of the user whom the activity is assigned to */
user_id?: number;
/** @description List of multiple persons (participants) this activity is associated with */
participants?: { [key: string]: unknown }[] | null;
/**
* @description Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time.
* @enum {boolean}
*/
busy_flag?: true | false;
/** @description The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. */
attendees?: { [key: string]: unknown }[] | null;
/** @description The user's company ID */
company_id?: number;
/** @description If the activity references some other object, it is indicated here. For example, value `Salesphone` refers to activities created with Caller. */
reference_type?: string;
/** @description Together with the `reference_type`, gives the ID of the other object */
reference_id?: number;
/** @description The ID of Marketplace app, which is connected to this activity */
conference_meeting_client?: string;
/** @description The link to join the meeting which is associated with this activity */
conference_meeting_url?: string;
/** @description The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity */
conference_meeting_id?: string;
/** @description The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. */
marked_as_done_time?: string;
/** @description The date and time of latest notifications sent about this activity to the participants or the attendees of this activity */
last_notification_time?: string;
/** @description The ID of the user who triggered the sending of the latest notifications about this activity to the participants or the attendees of this activity */
last_notification_user_id?: number;
/** @description The ID of the language the notifications are sent in */
notification_language_id?: number;
/**
* Format: uuid
* @description The ID of the lead in the UUID format this activity is associated with
*/
lead_id?: string;
/** @description Whether the activity is active or not */
active_flag?: boolean;
/** @description The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
/** @description The ID of the user who was the last to update this activity */
update_user_id?: number;
/** @description For the activity which syncs to Google calendar, this is the Google event ID. NB! This field is related to old Google calendar sync and will be deprecated soon. */
gcal_event_id?: string;
/** @description The Google calendar ID that this activity syncs to. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_id?: string;
/** @description The Google calendar API etag (version) that is used for syncing this activity. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_etag?: string;
/** @description For activities that sync to an external calendar, this setting indicates if the activity syncs with context (what are the deals, persons, organizations this activity is related to) */
calendar_sync_include_context?: string;
/** @description The timezone the activity was created in an external calendar */
source_timezone?: string;
/** @description The rule for the recurrence of the activity. Is important for activities synced into Pipedrive from an external calendar. Example: "RRULE:FREQ=WEEKLY;BYDAY=WE" */
rec_rule?: string;
/** @description Additional rules for the recurrence of the activity, extend the `rec_rule`. Is important for activities synced into Pipedrive from an external calendar. */
rec_rule_extension?: string;
/** @description The ID of parent activity for a recurrent activity if the current activity is an exception to recurrence rules */
rec_master_activity_id?: number;
/** @description The list of recurring activity instances. It is in a structure as follows: `[{due_date: "2020-06-24", due_time: "10:00:00"}]` */
series?: { [key: string]: unknown }[];
/** @description The ID of the user who created the activity */
created_by_user_id?: number;
/** @description Subfield of location field. Indicates apartment/suite number. */
location_subpremise?: string;
/** @description Subfield of location field. Indicates house number. */
location_street_number?: string;
/** @description Subfield of location field. Indicates street name. */
location_route?: string;
/** @description Subfield of location field. Indicates district/sublocality. */
location_sublocality?: string;
/** @description Subfield of location field. Indicates city/town/village/locality. */
location_locality?: string;
/** @description Subfield of location field. Indicates state/county. */
location_admin_area_level_1?: string;
/** @description Subfield of location field. Indicates region. */
location_admin_area_level_2?: string;
/** @description Subfield of location field. Indicates country. */
location_country?: string;
/** @description Subfield of location field. Indicates ZIP/postal code. */
location_postal_code?: string;
/** @description Subfield of location field. Indicates full/combined address. */
location_formatted_address?: string;
/** @description Subfield of location field. Indicates latitude. */
location_lat?: number;
/** @description Subfield of location field. Indicates longitude. */
location_long?: number;
/** @description The name of the organization this activity is associated with */
org_name?: string;
/** @description The name of the person this activity is associated with */
person_name?: string;
/** @description The name of the deal this activity is associated with */
deal_title?: string;
/** @description The name of the user this activity is owned by */
owner_name?: string;
/** @description The BCC email address of the person */
person_dropbox_bcc?: string;
/** @description The BCC email address of the deal */
deal_dropbox_bcc?: string;
/** @description The ID of the user to whom the activity is assigned to. Equal to `user_id`. */
assigned_to_user_id?: number;
/** @description The file that is attached to this activity. For example, this can be a reference to an audio note file generated with Pipedrive mobile app. */
file?: { [key: string]: unknown };
})[];
/** activityDistributionDataWithAdditionalData */
additional_data?: {
/** @description The distribution of activities related to the organization grouped by the user ID */
activity_distribution?: {
/** @description The ID of the user */
ASSIGNED_TO_USER_ID?: {
/** @description The count of activities related to the user grouped by activity type */
activities?: {
/** @description The count of activities related to a specific type */
ACTIVITY_TYPE_NAME?: number;
};
/** @description The name of the user */
name?: string;
/** @description The overall count of activities for the user */
activity_count?: number;
/** @description The percentage of activities belongs to the user */
share?: number;
};
};
} & {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Lists deals associated with an organization. */
getOrganizationDeals: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** Only fetch deals with a specific status. If omitted, all not deleted deals are fetched. */
status?: 'open' | 'won' | 'lost' | 'deleted' | 'all_not_deleted';
/** 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). */
sort?: string;
/** If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. */
only_primary_association?: 0 | 1;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of deals */
data?: ({
/** @description The ID of the deal */
id?: number;
/** @description The creator of the deal */
creator_user_id?: {
/** @description The ID of the deal creator */
id?: number;
/** @description The name of the deal creator */
name?: string;
/** @description The email of the deal creator */
email?: string;
/** @description If the creator has a picture or not */
has_pic?: boolean;
/** @description The creator picture hash */
pic_hash?: string | null;
/** @description Whether the creator is active or not */
active_flag?: boolean;
/** @description The ID of the deal creator */
value?: number;
};
/** dealUserDataWithId */
user_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the user */
value?: number;
};
/** dealPersonDataWithId */
person_id?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
} & {
/** @description The ID of the person associated with the deal */
value?: number;
};
/** dealOrganizationDataWithId */
org_id?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
} & {
/** @description The ID of the organization associated with the deal */
value?: number;
};
} & {
/** @description The ID of the deal stage */
stage_id?: number;
/** @description The title of the deal */
title?: string;
/** @description The value of the deal */
value?: number;
/** @description The currency associated with the deal */
currency?: string;
/** @description The creation date and time of the deal */
add_time?: string;
/** @description The last updated date and time of the deal */
update_time?: string;
/** @description The last updated date and time of the deal stage */
stage_change_time?: string;
/** @description Whether the deal is active or not */
active?: boolean;
/** @description Whether the deal is deleted or not */
deleted?: boolean;
/** @description The status of the deal */
status?: string;
/** @description The success probability percentage of the deal */
probability?: number | null;
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
/** @description The reason for losing the deal */
lost_reason?: string | null;
/** @description The visibility of the deal */
visible_to?: string;
/** @description The date and time of closing the deal */
close_time?: string | null;
/** @description The ID of pipeline associated with the deal */
pipeline_id?: number;
/** @description The date and time of changing the deal status as won */
won_time?: string;
/** @description The date and time of the first time changing the deal status as won */
first_won_time?: string;
/** @description The date and time of changing the deal status as lost */
lost_time?: string;
/** @description The number of products associated with the deal */
products_count?: number;
/** @description The number of files associated with the deal */
files_count?: number;
/** @description The number of notes associated with the deal */
notes_count?: number;
/** @description The number of followers associated with the deal */
followers_count?: number;
/** @description The number of emails associated with the deal */
email_messages_count?: number;
/** @description The number of activities associated with the deal */
activities_count?: number;
/** @description The number of completed activities associated with the deal */
done_activities_count?: number;
/** @description The number of incomplete activities associated with the deal */
undone_activities_count?: number;
/** @description The number of participants associated with the deal */
participants_count?: number;
/**
* Format: date
* @description The expected close date of the deal
*/
expected_close_date?: string;
/** @description The date and time of the last incoming email associated with the deal */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the deal */
last_outgoing_mail_time?: string;
/** @description The label assigned to the deal */
label?: string;
/** @description The order number of the deal stage associated with the deal */
stage_order_nr?: number;
/** @description The name of the person associated with the deal */
person_name?: string;
/** @description The name of the organization associated with the deal */
org_name?: string;
/** @description The subject of the next activity associated with the deal */
next_activity_subject?: string;
/** @description The type of the next activity associated with the deal */
next_activity_type?: string;
/** @description The duration of the next activity associated with the deal */
next_activity_duration?: string;
/** @description The note of the next activity associated with the deal */
next_activity_note?: string;
/** @description The deal value formatted with selected currency. E.g. US$500 */
formatted_value?: string;
/** @description Probability times deal value. Probability can either be deal probability or if not set, then stage probability. */
weighted_value?: number;
/** @description The weighted_value formatted with selected currency. E.g. US$500 */
formatted_weighted_value?: string;
/** @description The currency associated with the deal */
weighted_value_currency?: string;
/** @description The date and time of changing the deal status as rotten */
rotten_time?: string | null;
/** @description The name of the deal owner */
owner_name?: string;
/** @description The BCC email of the deal */
cc_email?: string;
/** @description If the organization that is associated with the deal is hidden or not */
org_hidden?: boolean;
/** @description If the person that is associated with the deal is hidden or not */
person_hidden?: boolean;
})[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
} & ({
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
});
};
person?: {
/** @description The ID of the person associated with the item */
PERSON_ID?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the person associated with the item */
id?: number;
/** @description The name of the person associated with the item */
name?: string;
/** @description The emails of the person associated with the item */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description Whether this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the item */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the item */
value?: string;
/** @description Whether this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the item */
owner_id?: number;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
stage?: {
/** @description The ID of the stage */
id?: number;
/** @description Defines the order of the stage */
order_nr?: number;
/** @description The name of the stage */
name?: string;
/** @description Whether the stage is active or deleted */
active_flag?: boolean;
/** @description The success probability percentage of the deal. Used/shown when the deal weighted values are used. */
deal_probability?: number;
/** @description The ID of the pipeline to add the stage to */
pipeline_id?: number;
/**
* @description Whether deals in this stage can become rotten
* @enum {boolean}
*/
rotten_flag?: true | false;
/** @description The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is set. */
rotten_days?: number;
/** @description The stage creation time. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The stage update time. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
};
pipeline?: {
/** @description The ID of the pipeline */
id?: number;
/** @description The name of the pipeline */
name?: string;
/** @description The pipeline title displayed in the URL */
url_title?: string;
/** @description Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. */
order_nr?: number;
/** @description Whether this pipeline will be made inactive (hidden) or active */
active?: boolean;
/** @description Whether deal probability is disabled or enabled for this pipeline */
deal_probability?: boolean;
/** @description The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
};
};
};
};
};
};
};
/** Lists files associated with an organization. */
getOrganizationFiles: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** 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`. */
sort?: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of files */
data?: {
/** @description The ID of the file */
id?: number;
/** @description The ID of the user to associate the file with */
user_id?: number;
/** @description The ID of the deal to associate the file with */
deal_id?: number;
/** @description The ID of the person to associate the file with */
person_id?: number;
/** @description The ID of the organization to associate the file with */
org_id?: number;
/** @description The ID of the product to associate the file with */
product_id?: number;
/** @description The ID of the activity to associate the file with */
activity_id?: number;
/** @description The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The original name of the file */
file_name?: string;
/** @description The size of the file */
file_size?: number;
/** @description Whether the user is active or not. false = Not activated, true = Activated */
active_flag?: boolean;
/** @description Whether the file was uploaded as inline or not */
inline_flag?: boolean;
/** @description The location type to send the file to. Only googledrive is supported at the moment. */
remote_location?: string;
/** @description The ID of the remote item */
remote_id?: string;
/** @description The ID of the inline attachment */
cid?: string;
/** @description The location of the cloud storage */
s3_bucket?: string;
/** @description The ID of the mail message to associate the file with */
mail_message_id?: string;
/** @description The ID of the mail template to associate the file with */
mail_template_id?: string;
/** @description The name of the deal associated with the dile */
deal_name?: string;
/** @description The name of the person associated with the file */
person_name?: string;
/** @description The name of the organization associated with the file */
org_name?: string;
/** @description The name of the product associated with the file */
product_name?: string;
/** @description The URL of the download file */
url?: string;
/** @description The visible name of the file */
name?: string;
/** @description The description of the file */
description?: string;
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Lists updates about an organization. */
getOrganizationUpdates: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** Whether to show custom field updates or not. 1 = Include custom field changes. If omitted, returns changes without custom field updates. */
all_changes?: 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) */
items?: string;
};
};
responses: {
/** Get the organization updates */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The type of the person update. (Possible object types - organizationChange, dealChange, file, activity) */
object?: string;
/** @description The creation date and time of the update */
timestamp?: string;
/** @description The data related to the update */
data?: { [key: string]: unknown };
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
};
};
};
};
};
};
/** Lists the followers of an organization. */
getOrganizationFollowers: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
/** @description The array of followers */
data?: ({
/** @description The ID of the organization */
org_id?: number;
} & {
/** @description The user ID of the follower related to the item */
user_id?: number;
/** @description The ID of the follower */
id?: number;
/**
* Format: date-time
* @description The date and time of adding the follower to the item
*/
add_time?: string;
})[];
additional_data?: {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
};
};
};
};
};
/** Adds a follower to an organization. */
addOrganizationFollower: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the organization */
org_id?: number;
} & {
/** @description The user ID of the follower related to the item */
user_id?: number;
/** @description The ID of the follower */
id?: number;
/**
* Format: date-time
* @description The date and time of adding the follower to the item
*/
add_time?: string;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The ID of the user */
user_id: number;
};
};
};
};
/** Deletes a follower from an organization. You can retrieve the `follower_id` from the <a href="https://developers.pipedrive.com/docs/api/v1/Organizations#getOrganizationFollowers">List followers of an organization</a> endpoint. */
deleteOrganizationFollower: {
parameters: {
path: {
/** The ID of the organization */
id: number;
/** The ID of the follower */
follower_id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the follower that was deleted from the organization */
id?: number;
};
};
};
};
};
};
/** Lists mail messages associated with an organization. */
getOrganizationMailMessages: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of mail messages */
data?: {
/** @description The type of the data item */
object?: string;
/** @description The date and time when the item was created */
timestamp?: string;
/** mailMessageItemForList */
data?: {
/** @description ID of the mail message. */
id?: number;
/** @description The array of mail message sender (object) */
from?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message receiver (object) */
to?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message copies (object) */
cc?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message blind copies (object) */
bcc?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The mail message body URL */
body_url?: string;
/** @description The connection account ID */
account_id?: string;
/** @description ID of the user whom mail message will be assigned to */
user_id?: number;
/** @description ID of the mail message thread */
mail_thread_id?: number;
/** @description The subject of mail message */
subject?: string;
/** @description The snippet of mail message. Snippet length is up to 225 characters. */
snippet?: string;
/**
* @description The status of tracking mail message. Value is `null` if tracking is not enabled.
* @enum {string|null}
*/
mail_tracking_status?: ('opened' | 'not opened') | null;
/** @description Whether the link tracking in mail message body is enabled. */
mail_link_tracking_enabled_flag?: 0 | 1;
/** @description Whether the mail message is read or not by the user */
read_flag?: 0 | 1;
/** @description If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. */
draft?: string;
/** @description Whether the mail message is a draft or not */
draft_flag?: 0 | 1;
/** @description Whether the mail message is synced with the provider or not */
synced_flag?: 0 | 1;
/** @description Whether the mail message is deleted or not */
deleted_flag?: 0 | 1;
/** @description Whether the mail message has a body or not */
has_body_flag?: 0 | 1;
/** @description Whether the mail message has been sent or not */
sent_flag?: 0 | 1;
/** @description Whether the mail message has been sent from Pipedrive app or not */
sent_from_pipedrive_flag?: 0 | 1;
/** @description Whether the mail message has been created by Smart Email BCC feature or not */
smart_bcc_flag?: 0 | 1;
/**
* Format: date-time
* @description Creation or receival time of the mail message
*/
message_time?: string;
/**
* Format: date-time
* @description The insertion into the database time of the mail message
*/
add_time?: string;
/**
* Format: date-time
* @description The updating time in the database of the mail message
*/
update_time?: string;
/** @description Whether the mail message has an attachment or not */
has_attachments_flag?: 0 | 1;
/** @description Whether the mail message has an inline attachment or not */
has_inline_attachments_flag?: 0 | 1;
/** @description Whether the mail message has an attachment (which is not inline) or not */
has_real_attachments_flag?: 0 | 1;
} & {
/** @description The Mail Message ID assigned by the sync provider */
nylas_id?: string;
/** @description The name of the S3 bucket */
s3_bucket?: string;
/** @description The path of the S3 bucket */
s3_bucket_path?: string;
/** @description If the Mail Message has been deleted on the provider side or not */
external_deleted_flag?: boolean;
/** @description The Mail Message ID assigned by the mail user agent */
mua_message_id?: string;
/** @description The ID of the mail template */
template_id?: number;
/** @description The add date and time of the Mail Message */
timestamp?: string;
/** @description The type of the data item */
item_type?: string;
/** @description The ID of the company */
company_id?: number;
};
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Merges an organization with another organization. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/merging-two-organizations" target="_blank" rel="noopener noreferrer">merging two organizations</a>. */
mergeOrganizations: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description The ID of the merged organization */
id?: number;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The ID of the organization that the organization will be merged with */
merge_with_id: number;
};
};
};
};
/** List users permitted to access an organization. */
getOrganizationUsers: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The list of permitted user IDs */
data?: number[];
};
};
};
};
};
/** Lists persons associated with an organization.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. */
getOrganizationPersons: {
parameters: {
path: {
/** The ID of the organization */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of persons */
data?: ({
/** @description The ID of the person */
id?: number;
/** @description The ID of the company related to the person */
company_id?: number;
/** @description Whether the person is active or not */
active_flag?: boolean;
/** @description List of phone data related to the person */
phone?: {
/** @description The phone number */
value?: string;
/** @description Boolean that indicates if phone number is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) */
label?: string;
}[];
/** @description List of email data related to the person */
email?: {
/** @description Email */
value?: string;
/** @description Boolean that indicates if email is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the email. (Possible values - work, home or other) */
label?: string;
}[];
/** @description The primary email of the person */
primary_email?: string;
/** @description The first letter of the name of the person */
first_char?: string;
/** @description The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The visibility group ID of who can see the person */
visible_to?: string;
picture_id?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The label assigned to the person */
label?: number;
/** @description The name of the organization associated with the person */
org_name?: string;
/** @description The name of the owner associated with the person */
owner_name?: string;
/** @description The BCC email associated with the person */
cc_email?: string;
} & (({
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** relationshipOrganizationInfoItemWithActiveFlag */
org_id?: ({
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
}) & {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
};
} & {
/** @description The name of the person */
name?: string;
/** @description The first name of the person */
first_name?: string;
/** @description The last name of the person */
last_name?: string;
}) &
(({
/** @description The count of email messages related to the person */
email_messages_count?: number;
/** @description The count of activities related to the person */
activities_count?: number;
/** @description The count of done activities related to the person */
done_activities_count?: number;
/** @description The count of undone activities related to the person */
undone_activities_count?: number;
/** @description The count of files related to the person */
files_count?: number;
/** @description The count of notes related to the person */
notes_count?: number;
/** @description The count of followers related to the person */
followers_count?: number;
} & {
/** @description The date and time of the last incoming email associated with the person */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the person */
last_outgoing_mail_time?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
}))))[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
} & ({
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
});
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
};
};
};
};
};
};
/** Returns data about all organization fields. */
getOrganizationFields: {
parameters: {
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Adds a new organization field. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-new-custom-field" target="_blank" rel="noopener noreferrer">adding a new custom field</a>. */
addOrganizationField: {
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the field */
name: string;
/** @description When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. Example: `[{"label":"New Item"}]` */
options?: string;
/**
* @description Whether the field is available in the 'add new' modal or not (both in the web and mobile app)
* @default true
* @enum {boolean}
*/
add_visible_flag?: true | false;
} & {
/**
* @description The type of the field<table><tr><th>Value</th><th>Description</th></tr><tr><td>`address`</td><td>Address field (has multiple subfields, autocompleted by Google Maps)</td></tr><tr><td>`date`</td><td>Date (format YYYY-MM-DD)</td></tr><tr><td>`daterange`</td><td>Date-range field (has a start date and end date value, both YYYY-MM-DD)</td></tr><tr><td>`double`</td><td>Numeric value</td></tr><tr><td>`enum`</td><td>Options field with a single possible chosen option</td></tr><tr></tr><tr><td>`monetary`</td><td>Monetary field (has a numeric value and a currency value)</td></tr><tr><td>`org`</td><td>Organization field (contains an organization ID which is stored on the same account)</td></tr><tr><td>`people`</td><td>Person field (contains a person ID which is stored on the same account)</td></tr><tr><td>`phone`</td><td>Phone field (up to 255 numbers and/or characters)</td></tr><tr><td>`set`</td><td>Options field with a possibility of having multiple chosen options</td></tr><tr><td>`text`</td><td>Long text (up to 65k characters)</td></tr><tr><td>`time`</td><td>Time field (format HH:MM:SS)</td></tr><tr><td>`timerange`</td><td>Time-range field (has a start time and end time value, both HH:MM:SS)</td></tr><tr><td>`user`</td><td>User field (contains a user ID of another Pipedrive user)</td></tr><tr><td>`varchar`</td><td>Text (up to 255 characters)</td></tr><tr><td>`varchar_auto`</td><td>Autocomplete text (up to 255 characters)</td></tr><tr><td>`visible_to`</td><td>System field that keeps item's visibility setting</td></tr></table>
* @enum {string}
*/
field_type:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
};
};
};
};
/** Marks multiple fields as deleted. */
deleteOrganizationFields: {
parameters: {
query: {
/** The comma-separated field IDs to delete */
ids: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The list of deleted field IDs */
id?: number[];
};
};
};
};
};
};
/** Returns data about a specific organization field. */
getOrganizationField: {
parameters: {
path: {
/** The ID of the field */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
};
};
};
};
};
};
/** Updates an organization field. For more information, see the tutorial for <a href=" https://pipedrive.readme.io/docs/updating-custom-field-value " target="_blank" rel="noopener noreferrer">updating custom fields' values</a>. */
updateOrganizationField: {
parameters: {
path: {
/** The ID of the field */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the field */
name?: string;
/** @description When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: `[{"id":123,"label":"Existing Item"},{"label":"New Item"}]` */
options?: string;
/**
* @description Whether the field is available in 'add new' modal or not (both in web and mobile app)
* @default true
* @enum {boolean}
*/
add_visible_flag?: true | false;
};
};
};
};
/** Marks a field as deleted. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/deleting-a-custom-field" target="_blank" rel="noopener noreferrer">deleting a custom field</a>. */
deleteOrganizationField: {
parameters: {
path: {
/** The ID of the field */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field that was deleted */
id?: number;
};
};
};
};
};
};
/** Gets all of the relationships for a supplied organization ID. */
getOrganizationRelationships: {
parameters: {
query: {
/** The ID of the organization to get relationships for */
org_id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of organization relationships */
data?: (({
/** @description The ID of the organization relationship */
id?: number;
/** @description The type of the relationship */
type?: string;
/** relationshipOrganizationInfoItem */
rel_owner_org_id?: {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
};
/** relationshipOrganizationInfoItem */
rel_linked_org_id?: {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
};
/** @description The creation date and time of the relationship */
add_time?: string;
/** @description The last updated date and time of the relationship */
update_time?: string;
/** @description Whether the relationship is active or not */
active_flag?: string;
} & {
/** @description The calculated type of the relationship with the linked organization */
calculated_type?: string;
/** @description The ID of the linked organization */
calculated_related_org_id?: number;
}) & {
/** @description The name of the linked organization */
related_organization_name?: string;
})[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
};
};
};
};
};
};
/** Creates and returns an organization relationship. */
addOrganizationRelationship: {
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the organization relationship */
id?: number;
/** @description The type of the relationship */
type?: string;
/** relationshipOrganizationInfoItem */
rel_owner_org_id?: {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
};
/** relationshipOrganizationInfoItem */
rel_linked_org_id?: {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
};
/** @description The creation date and time of the relationship */
add_time?: string;
/** @description The last updated date and time of the relationship */
update_time?: string;
/** @description Whether the relationship is active or not */
active_flag?: string;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The ID of the base organization for the returned calculated values */
org_id?: number;
/**
* @description The type of organization relationship
* @enum {string}
*/
type: 'parent' | 'related';
/** @description The owner of the relationship. If type is `parent`, then the owner is the parent and the linked organization is the daughter. */
rel_owner_org_id: number;
/** @description The linked organization in the relationship. If type is `parent`, then the linked organization is the daughter. */
rel_linked_org_id: number;
};
};
};
};
/** Finds and returns an organization relationship from its ID. */
getOrganizationRelationship: {
parameters: {
path: {
/** The ID of the organization relationship */
id: number;
};
query: {
/** The ID of the base organization for the returned calculated values */
org_id?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** organizationRelationshipWithCalculatedFields */
data?: {
/** @description The ID of the organization relationship */
id?: number;
/** @description The type of the relationship */
type?: string;
/** relationshipOrganizationInfoItem */
rel_owner_org_id?: {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
};
/** relationshipOrganizationInfoItem */
rel_linked_org_id?: {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
};
/** @description The creation date and time of the relationship */
add_time?: string;
/** @description The last updated date and time of the relationship */
update_time?: string;
/** @description Whether the relationship is active or not */
active_flag?: string;
} & {
/** @description The calculated type of the relationship with the linked organization */
calculated_type?: string;
/** @description The ID of the linked organization */
calculated_related_org_id?: number;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
};
};
};
};
};
};
/** Updates and returns an organization relationship. */
updateOrganizationRelationship: {
parameters: {
path: {
/** The ID of the organization relationship */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the organization relationship */
id?: number;
/** @description The type of the relationship */
type?: string;
/** relationshipOrganizationInfoItem */
rel_owner_org_id?: {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
};
/** relationshipOrganizationInfoItem */
rel_linked_org_id?: {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
};
/** @description The creation date and time of the relationship */
add_time?: string;
/** @description The last updated date and time of the relationship */
update_time?: string;
/** @description Whether the relationship is active or not */
active_flag?: string;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The ID of the base organization for the returned calculated values */
org_id?: number;
/**
* @description The type of organization relationship
* @enum {string}
*/
type?: 'parent' | 'related';
/** @description The owner of this relationship. If type is `parent`, then the owner is the parent and the linked organization is the daughter. */
rel_owner_org_id?: number;
/** @description The linked organization in this relationship. If type is `parent`, then the linked organization is the daughter. */
rel_linked_org_id?: number;
};
};
};
};
/** Deletes an organization relationship and returns the deleted ID. */
deleteOrganizationRelationship: {
parameters: {
path: {
/** The ID of the organization relationship */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the deleted organization relationship */
id?: number;
};
};
};
};
};
};
/** Returns data about all permission sets. */
getPermissionSets: {
parameters: {
query: {
/** The app to filter the permission sets by */
app?:
| 'sales'
| 'projects'
| 'campaigns'
| 'global'
| 'account_settings';
};
};
responses: {
/** Get all permissions */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of permission set */
data?: {
/** @description The ID of user permission set */
id?: string;
/** @description The name of the permission set */
name?: string;
/** @description The description of the permission set */
description?: string;
/**
* @description The app that permission set belongs to
* @enum {string}
*/
app?:
| 'sales'
| 'projects'
| 'campaigns'
| 'global'
| 'account_settings';
/**
* @description The type of permission set
* @enum {string}
*/
type?: 'admin' | 'manager' | 'regular' | 'custom';
/** @description The number of users assigned to this permission set */
assignment_count?: number;
}[];
};
};
};
};
};
/** Returns data about a specific permission set. */
getPermissionSet: {
parameters: {
path: {
/** The ID of the permission set */
id: string;
};
};
responses: {
/** The permission set of a specific user ID */
200: {
content: {
'application/json': {
/** @description The ID of user permission set */
id?: string;
/** @description The name of the permission set */
name?: string;
/** @description The description of the permission set */
description?: string;
/**
* @description The app that permission set belongs to
* @enum {string}
*/
app?:
| 'sales'
| 'projects'
| 'campaigns'
| 'global'
| 'account_settings';
/**
* @description The type of permission set
* @enum {string}
*/
type?: 'admin' | 'manager' | 'regular' | 'custom';
/** @description The number of users assigned to this permission set */
assignment_count?: number;
} & {
/** @description A permission assigned to this permission set */
contents?: string[];
};
};
};
/** If the user ID has no assignments, then it will return NotFound */
404: {
content: {
'application/json': unknown;
};
};
};
};
/** Returns the list of assignments for a permission set. */
getPermissionSetAssignments: {
parameters: {
path: {
/** The ID of the permission set */
id: string;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** The assignments of a specific user ID */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description An array of the assignments of the user */
data?: {
/** @description The ID of the user in the permission set */
user_id?: number;
/** @description The ID of the permission set */
permission_set_id?: string;
/** @description The name of the permission set */
name?: string;
}[];
};
};
};
/** If the user ID has no assignments, then it will return NotFound */
404: {
content: {
'application/json': unknown;
};
};
};
};
/** Returns all persons. */
getPersons: {
parameters: {
query: {
/** If supplied, only persons owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. */
user_id?: number;
/** The ID of the filter to use */
filter_id?: number;
/** If supplied, only persons whose name starts with the specified letter will be returned (case insensitive) */
first_char?: string;
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** 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). */
sort?: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of persons */
data?: ({
/** @description The ID of the person */
id?: number;
/** @description The ID of the company related to the person */
company_id?: number;
/** @description Whether the person is active or not */
active_flag?: boolean;
/** @description List of phone data related to the person */
phone?: {
/** @description The phone number */
value?: string;
/** @description Boolean that indicates if phone number is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) */
label?: string;
}[];
/** @description List of email data related to the person */
email?: {
/** @description Email */
value?: string;
/** @description Boolean that indicates if email is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the email. (Possible values - work, home or other) */
label?: string;
}[];
/** @description The primary email of the person */
primary_email?: string;
/** @description The first letter of the name of the person */
first_char?: string;
/** @description The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The visibility group ID of who can see the person */
visible_to?: string;
picture_id?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The label assigned to the person */
label?: number;
/** @description The name of the organization associated with the person */
org_name?: string;
/** @description The name of the owner associated with the person */
owner_name?: string;
/** @description The BCC email associated with the person */
cc_email?: string;
} & (({
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** relationshipOrganizationInfoItemWithActiveFlag */
org_id?: ({
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
}) & {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
};
} & {
/** @description The name of the person */
name?: string;
/** @description The first name of the person */
first_name?: string;
/** @description The last name of the person */
last_name?: string;
}) &
(({
/** @description The count of email messages related to the person */
email_messages_count?: number;
/** @description The count of activities related to the person */
activities_count?: number;
/** @description The count of done activities related to the person */
done_activities_count?: number;
/** @description The count of undone activities related to the person */
undone_activities_count?: number;
/** @description The count of files related to the person */
files_count?: number;
/** @description The count of notes related to the person */
notes_count?: number;
/** @description The count of followers related to the person */
followers_count?: number;
} & {
/** @description The date and time of the last incoming email associated with the person */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the person */
last_outgoing_mail_time?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
}))))[];
additional_data?: {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
/** @description The picture that is associated with the item */
picture?: {
/** @description The ID of the picture */
PICTURE_ID?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
};
};
};
};
};
};
};
/** 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.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `data.marketing_status` field. */
addPerson: {
responses: {
/** Success */
201: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** personItem */
data?: {
/** @description The ID of the person */
id?: number;
/** @description The ID of the company related to the person */
company_id?: number;
/** @description Whether the person is active or not */
active_flag?: boolean;
/** @description List of phone data related to the person */
phone?: {
/** @description The phone number */
value?: string;
/** @description Boolean that indicates if phone number is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) */
label?: string;
}[];
/** @description List of email data related to the person */
email?: {
/** @description Email */
value?: string;
/** @description Boolean that indicates if email is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the email. (Possible values - work, home or other) */
label?: string;
}[];
/** @description The primary email of the person */
primary_email?: string;
/** @description The first letter of the name of the person */
first_char?: string;
/** @description The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The visibility group ID of who can see the person */
visible_to?: string;
picture_id?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The label assigned to the person */
label?: number;
/** @description The name of the organization associated with the person */
org_name?: string;
/** @description The name of the owner associated with the person */
owner_name?: string;
/** @description The BCC email associated with the person */
cc_email?: string;
} & (({
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** relationshipOrganizationInfoItemWithActiveFlag */
org_id?: ({
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
}) & {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
};
} & {
/** @description The name of the person */
name?: string;
/** @description The first name of the person */
first_name?: string;
/** @description The last name of the person */
last_name?: string;
}) &
(({
/** @description The count of email messages related to the person */
email_messages_count?: number;
/** @description The count of activities related to the person */
activities_count?: number;
/** @description The count of done activities related to the person */
done_activities_count?: number;
/** @description The count of undone activities related to the person */
undone_activities_count?: number;
/** @description The count of files related to the person */
files_count?: number;
/** @description The count of notes related to the person */
notes_count?: number;
/** @description The count of followers related to the person */
followers_count?: number;
} & {
/** @description The date and time of the last incoming email associated with the person */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the person */
last_outgoing_mail_time?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
})));
related_objects?: {
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the person */
name: string;
} & {
/** @description The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used. */
owner_id?: number;
/** @description The ID of the organization this person will belong to */
org_id?: number;
/** @description List of email data related to the person */
email?: {
/** @description The email */
value?: string;
/** @description Boolean that indicates if email is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the email. (Possible values - work, home or other) */
label?: string;
}[];
/** @description The primary email of the person */
primary_email?: string;
/** @description List of phone data related to the person */
phone?: {
/** @description The phone number */
value?: string;
/** @description Boolean that indicates if phone number is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) */
label?: string;
}[];
/** @description The visibility of the person. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href="https://support.pipedrive.com/en/article/visibility-groups" target="_blank" rel="noopener noreferrer">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> */
visible_to?: string;
/** @description If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`no_consent`</td><td>The customer has not given consent to receive any marketing communications</td></tr><tr><td>`unsubscribed`</td><td>The customers have unsubscribed from ALL marketing communications</td></tr><tr><td>`subscribed`</td><td>The customers are subscribed and are counted towards marketing caps</td></tr><tr><td>`archived`</td><td>The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for</td></tr></table> */
marketing_status?:
| 'no_consent'
| 'unsubscribed'
| 'subscribed'
| 'archived';
/** @description The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
};
};
};
};
/** Marks multiple persons as deleted. After 30 days, the persons will be permanently deleted. */
deletePersons: {
parameters: {
query: {
/** The comma-separated IDs that will be deleted */
ids: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The list of deleted persons IDs */
id?: number[];
};
};
};
};
};
};
/** Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of <a href="https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem">/v1/itemSearch</a> with a narrower OAuth scope. Found persons can be filtered by organization ID. */
searchPersons: {
parameters: {
query: {
/** The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). */
term: string;
/** A comma-separated string array. The fields to perform the search from. Defaults to all of them. */
fields?: 'custom_fields' | 'email' | 'notes' | 'phone' | 'name';
/** When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. */
exact_match?: true | false;
/** Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. */
organization_id?: number;
/** Supports including optional fields in the results which are not provided by default */
include_fields?: 'person.picture';
/** Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The array of found items */
items?: {
/** @description Search result relevancy */
result_score?: number;
item?: {
/** @description The ID of the person */
id?: number;
/** @description The type of the item */
type?: string;
/** @description The name of the person */
name?: string;
/** @description An array of phone numbers */
phones?: string[];
/** @description An array of email addresses */
emails?: string[];
/** @description The visibility of the person */
visible_to?: number;
owner?: {
/** @description The ID of the owner of the person */
id?: number;
};
organization?: {
/** @description The ID of the organization the person is associated with */
id?: number;
/** @description The name of the organization the person is associated with */
name?: string;
};
/** @description Custom fields */
custom_fields?: string[];
/** @description An array of notes */
notes?: string[];
};
}[];
};
additional_data?: {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
};
};
};
};
};
/** Returns the 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.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. */
getPerson: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** personItem */
data?: {
/** @description The ID of the person */
id?: number;
/** @description The ID of the company related to the person */
company_id?: number;
/** @description Whether the person is active or not */
active_flag?: boolean;
/** @description List of phone data related to the person */
phone?: {
/** @description The phone number */
value?: string;
/** @description Boolean that indicates if phone number is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) */
label?: string;
}[];
/** @description List of email data related to the person */
email?: {
/** @description Email */
value?: string;
/** @description Boolean that indicates if email is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the email. (Possible values - work, home or other) */
label?: string;
}[];
/** @description The primary email of the person */
primary_email?: string;
/** @description The first letter of the name of the person */
first_char?: string;
/** @description The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The visibility group ID of who can see the person */
visible_to?: string;
picture_id?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The label assigned to the person */
label?: number;
/** @description The name of the organization associated with the person */
org_name?: string;
/** @description The name of the owner associated with the person */
owner_name?: string;
/** @description The BCC email associated with the person */
cc_email?: string;
} & (({
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** relationshipOrganizationInfoItemWithActiveFlag */
org_id?: ({
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
}) & {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
};
} & {
/** @description The name of the person */
name?: string;
/** @description The first name of the person */
first_name?: string;
/** @description The last name of the person */
last_name?: string;
}) &
(({
/** @description The count of email messages related to the person */
email_messages_count?: number;
/** @description The count of activities related to the person */
activities_count?: number;
/** @description The count of done activities related to the person */
done_activities_count?: number;
/** @description The count of undone activities related to the person */
undone_activities_count?: number;
/** @description The count of files related to the person */
files_count?: number;
/** @description The count of notes related to the person */
notes_count?: number;
/** @description The count of followers related to the person */
followers_count?: number;
} & {
/** @description The date and time of the last incoming email associated with the person */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the person */
last_outgoing_mail_time?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
})));
additional_data?: {
/** @description Dropbox email for the person */
dropbox_email?: string;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
/** @description The picture that is associated with the item */
picture?: {
/** @description The ID of the picture */
PICTURE_ID?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
};
};
};
};
};
};
};
/** Updates the properties of a person. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/updating-a-person" target="_blank" rel="noopener noreferrer">updating a person</a>.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `data.marketing_status` field. */
updatePerson: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** personItem */
data?: {
/** @description The ID of the person */
id?: number;
/** @description The ID of the company related to the person */
company_id?: number;
/** @description Whether the person is active or not */
active_flag?: boolean;
/** @description List of phone data related to the person */
phone?: {
/** @description The phone number */
value?: string;
/** @description Boolean that indicates if phone number is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) */
label?: string;
}[];
/** @description List of email data related to the person */
email?: {
/** @description Email */
value?: string;
/** @description Boolean that indicates if email is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the email. (Possible values - work, home or other) */
label?: string;
}[];
/** @description The primary email of the person */
primary_email?: string;
/** @description The first letter of the name of the person */
first_char?: string;
/** @description The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The visibility group ID of who can see the person */
visible_to?: string;
picture_id?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The label assigned to the person */
label?: number;
/** @description The name of the organization associated with the person */
org_name?: string;
/** @description The name of the owner associated with the person */
owner_name?: string;
/** @description The BCC email associated with the person */
cc_email?: string;
} & (({
/** owner */
owner_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the owner */
value?: number;
};
/** relationshipOrganizationInfoItemWithActiveFlag */
org_id?: ({
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
} & {
/** @description The ID of the organization */
value?: number;
}) & {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
};
} & {
/** @description The name of the person */
name?: string;
/** @description The first name of the person */
first_name?: string;
/** @description The last name of the person */
last_name?: string;
}) &
(({
/** @description The count of email messages related to the person */
email_messages_count?: number;
/** @description The count of activities related to the person */
activities_count?: number;
/** @description The count of done activities related to the person */
done_activities_count?: number;
/** @description The count of undone activities related to the person */
undone_activities_count?: number;
/** @description The count of files related to the person */
files_count?: number;
/** @description The count of notes related to the person */
notes_count?: number;
/** @description The count of followers related to the person */
followers_count?: number;
} & {
/** @description The date and time of the last incoming email associated with the person */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the person */
last_outgoing_mail_time?: string;
}) &
({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
})));
related_objects?: {
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the person */
name?: string;
} & {
/** @description The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used. */
owner_id?: number;
/** @description The ID of the organization this person will belong to */
org_id?: number;
/** @description List of email data related to the person */
email?: {
/** @description The email */
value?: string;
/** @description Boolean that indicates if email is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the email. (Possible values - work, home or other) */
label?: string;
}[];
/** @description The primary email of the person */
primary_email?: string;
/** @description List of phone data related to the person */
phone?: {
/** @description The phone number */
value?: string;
/** @description Boolean that indicates if phone number is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) */
label?: string;
}[];
/** @description The visibility of the person. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href="https://support.pipedrive.com/en/article/visibility-groups" target="_blank" rel="noopener noreferrer">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style="width:40px">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> */
visible_to?: string;
/** @description If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`no_consent`</td><td>The customer has not given consent to receive any marketing communications</td></tr><tr><td>`unsubscribed`</td><td>The customers have unsubscribed from ALL marketing communications</td></tr><tr><td>`subscribed`</td><td>The customers are subscribed and are counted towards marketing caps</td></tr><tr><td>`archived`</td><td>The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for</td></tr></table> */
marketing_status?:
| 'no_consent'
| 'unsubscribed'
| 'subscribed'
| 'archived';
/** @description The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
};
};
};
};
/** Marks a person as deleted. After 30 days, the person will be permanently deleted. */
deletePerson: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the deleted person */
id?: number;
};
};
};
};
};
};
/** Lists activities associated with a person. */
getPersonActivities: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. */
done?: 0 | 1;
/** A comma-separated string of activity IDs to exclude from result */
exclude?: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of activities */
data?: ({
/**
* Format: date
* @description The due date of the activity. Format: YYYY-MM-DD
*/
due_date?: string;
/** @description The due time of the activity in UTC. Format: HH:MM */
due_time?: string;
/** @description The duration of the activity. Format: HH:MM */
duration?: string;
/** @description The ID of the deal this activity is associated with */
deal_id?: number;
/** @description The ID of the lead this activity is associated with */
lead_id?: string;
/** @description The ID of the person this activity is associated with */
person_id?: number;
/** @description The ID of the organization this activity is associated with */
org_id?: number;
/** @description The note of the activity (HTML format) */
note?: string;
/** @description The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. */
location?: string;
/** @description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. */
public_description?: string;
} & {
/** @description The activity ID, generated when the activity was created */
id?: number;
/** @description Whether the activity is done or not */
done?: boolean;
/** @description The subject of the activity */
subject?: string;
/** @description The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. */
type?: string;
/** @description The ID of the user whom the activity is assigned to */
user_id?: number;
/** @description List of multiple persons (participants) this activity is associated with */
participants?: { [key: string]: unknown }[] | null;
/**
* @description Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time.
* @enum {boolean}
*/
busy_flag?: true | false;
/** @description The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. */
attendees?: { [key: string]: unknown }[] | null;
/** @description The user's company ID */
company_id?: number;
/** @description If the activity references some other object, it is indicated here. For example, value `Salesphone` refers to activities created with Caller. */
reference_type?: string;
/** @description Together with the `reference_type`, gives the ID of the other object */
reference_id?: number;
/** @description The ID of Marketplace app, which is connected to this activity */
conference_meeting_client?: string;
/** @description The link to join the meeting which is associated with this activity */
conference_meeting_url?: string;
/** @description The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity */
conference_meeting_id?: string;
/** @description The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. */
marked_as_done_time?: string;
/** @description The date and time of latest notifications sent about this activity to the participants or the attendees of this activity */
last_notification_time?: string;
/** @description The ID of the user who triggered the sending of the latest notifications about this activity to the participants or the attendees of this activity */
last_notification_user_id?: number;
/** @description The ID of the language the notifications are sent in */
notification_language_id?: number;
/**
* Format: uuid
* @description The ID of the lead in the UUID format this activity is associated with
*/
lead_id?: string;
/** @description Whether the activity is active or not */
active_flag?: boolean;
/** @description The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
/** @description The ID of the user who was the last to update this activity */
update_user_id?: number;
/** @description For the activity which syncs to Google calendar, this is the Google event ID. NB! This field is related to old Google calendar sync and will be deprecated soon. */
gcal_event_id?: string;
/** @description The Google calendar ID that this activity syncs to. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_id?: string;
/** @description The Google calendar API etag (version) that is used for syncing this activity. NB! This field is related to old Google calendar sync and will be deprecated soon. */
google_calendar_etag?: string;
/** @description For activities that sync to an external calendar, this setting indicates if the activity syncs with context (what are the deals, persons, organizations this activity is related to) */
calendar_sync_include_context?: string;
/** @description The timezone the activity was created in an external calendar */
source_timezone?: string;
/** @description The rule for the recurrence of the activity. Is important for activities synced into Pipedrive from an external calendar. Example: "RRULE:FREQ=WEEKLY;BYDAY=WE" */
rec_rule?: string;
/** @description Additional rules for the recurrence of the activity, extend the `rec_rule`. Is important for activities synced into Pipedrive from an external calendar. */
rec_rule_extension?: string;
/** @description The ID of parent activity for a recurrent activity if the current activity is an exception to recurrence rules */
rec_master_activity_id?: number;
/** @description The list of recurring activity instances. It is in a structure as follows: `[{due_date: "2020-06-24", due_time: "10:00:00"}]` */
series?: { [key: string]: unknown }[];
/** @description The ID of the user who created the activity */
created_by_user_id?: number;
/** @description Subfield of location field. Indicates apartment/suite number. */
location_subpremise?: string;
/** @description Subfield of location field. Indicates house number. */
location_street_number?: string;
/** @description Subfield of location field. Indicates street name. */
location_route?: string;
/** @description Subfield of location field. Indicates district/sublocality. */
location_sublocality?: string;
/** @description Subfield of location field. Indicates city/town/village/locality. */
location_locality?: string;
/** @description Subfield of location field. Indicates state/county. */
location_admin_area_level_1?: string;
/** @description Subfield of location field. Indicates region. */
location_admin_area_level_2?: string;
/** @description Subfield of location field. Indicates country. */
location_country?: string;
/** @description Subfield of location field. Indicates ZIP/postal code. */
location_postal_code?: string;
/** @description Subfield of location field. Indicates full/combined address. */
location_formatted_address?: string;
/** @description Subfield of location field. Indicates latitude. */
location_lat?: number;
/** @description Subfield of location field. Indicates longitude. */
location_long?: number;
/** @description The name of the organization this activity is associated with */
org_name?: string;
/** @description The name of the person this activity is associated with */
person_name?: string;
/** @description The name of the deal this activity is associated with */
deal_title?: string;
/** @description The name of the user this activity is owned by */
owner_name?: string;
/** @description The BCC email address of the person */
person_dropbox_bcc?: string;
/** @description The BCC email address of the deal */
deal_dropbox_bcc?: string;
/** @description The ID of the user to whom the activity is assigned to. Equal to `user_id`. */
assigned_to_user_id?: number;
/** @description The file that is attached to this activity. For example, this can be a reference to an audio note file generated with Pipedrive mobile app. */
file?: { [key: string]: unknown };
})[];
/** activityDistributionDataWithAdditionalData */
additional_data?: {
/** @description The distribution of activities related to the organization grouped by the user ID */
activity_distribution?: {
/** @description The ID of the user */
ASSIGNED_TO_USER_ID?: {
/** @description The count of activities related to the user grouped by activity type */
activities?: {
/** @description The count of activities related to a specific type */
ACTIVITY_TYPE_NAME?: number;
};
/** @description The name of the user */
name?: string;
/** @description The overall count of activities for the user */
activity_count?: number;
/** @description The percentage of activities belongs to the user */
share?: number;
};
};
} & {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Lists deals associated with a person. */
getPersonDeals: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** Only fetch deals with a specific status. If omitted, all not deleted deals are fetched. */
status?: 'open' | 'won' | 'lost' | 'deleted' | 'all_not_deleted';
/** 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). */
sort?: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of deals */
data?: ({
/** @description The ID of the deal */
id?: number;
/** @description The creator of the deal */
creator_user_id?: {
/** @description The ID of the deal creator */
id?: number;
/** @description The name of the deal creator */
name?: string;
/** @description The email of the deal creator */
email?: string;
/** @description If the creator has a picture or not */
has_pic?: boolean;
/** @description The creator picture hash */
pic_hash?: string | null;
/** @description Whether the creator is active or not */
active_flag?: boolean;
/** @description The ID of the deal creator */
value?: number;
};
/** dealUserDataWithId */
user_id?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description If the user has a picture or not */
has_pic?: boolean;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the user */
value?: number;
};
/** dealPersonDataWithId */
person_id?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
/** @description The name of the person associated with the deal */
name?: string;
/** @description The emails of the person associated with the deal */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description If this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the deal */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the deal */
value?: string;
/** @description If this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the deal */
owner_id?: number;
} & {
/** @description The ID of the person associated with the deal */
value?: number;
};
/** dealOrganizationDataWithId */
org_id?: {
/** @description The name of the organization associated with the deal */
name?: string;
/** @description The number of people connected with the organization that is associated with the deal */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the deal */
owner_id?: number;
/** @description The address of the organization that is associated with the deal */
address?: string;
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
/** @description The BCC email of the organization associated with the deal */
cc_email?: string;
} & {
/** @description The ID of the organization associated with the deal */
value?: number;
};
} & {
/** @description The ID of the deal stage */
stage_id?: number;
/** @description The title of the deal */
title?: string;
/** @description The value of the deal */
value?: number;
/** @description The currency associated with the deal */
currency?: string;
/** @description The creation date and time of the deal */
add_time?: string;
/** @description The last updated date and time of the deal */
update_time?: string;
/** @description The last updated date and time of the deal stage */
stage_change_time?: string;
/** @description Whether the deal is active or not */
active?: boolean;
/** @description Whether the deal is deleted or not */
deleted?: boolean;
/** @description The status of the deal */
status?: string;
/** @description The success probability percentage of the deal */
probability?: number | null;
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
/** @description The reason for losing the deal */
lost_reason?: string | null;
/** @description The visibility of the deal */
visible_to?: string;
/** @description The date and time of closing the deal */
close_time?: string | null;
/** @description The ID of pipeline associated with the deal */
pipeline_id?: number;
/** @description The date and time of changing the deal status as won */
won_time?: string;
/** @description The date and time of the first time changing the deal status as won */
first_won_time?: string;
/** @description The date and time of changing the deal status as lost */
lost_time?: string;
/** @description The number of products associated with the deal */
products_count?: number;
/** @description The number of files associated with the deal */
files_count?: number;
/** @description The number of notes associated with the deal */
notes_count?: number;
/** @description The number of followers associated with the deal */
followers_count?: number;
/** @description The number of emails associated with the deal */
email_messages_count?: number;
/** @description The number of activities associated with the deal */
activities_count?: number;
/** @description The number of completed activities associated with the deal */
done_activities_count?: number;
/** @description The number of incomplete activities associated with the deal */
undone_activities_count?: number;
/** @description The number of participants associated with the deal */
participants_count?: number;
/**
* Format: date
* @description The expected close date of the deal
*/
expected_close_date?: string;
/** @description The date and time of the last incoming email associated with the deal */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the deal */
last_outgoing_mail_time?: string;
/** @description The label assigned to the deal */
label?: string;
/** @description The order number of the deal stage associated with the deal */
stage_order_nr?: number;
/** @description The name of the person associated with the deal */
person_name?: string;
/** @description The name of the organization associated with the deal */
org_name?: string;
/** @description The subject of the next activity associated with the deal */
next_activity_subject?: string;
/** @description The type of the next activity associated with the deal */
next_activity_type?: string;
/** @description The duration of the next activity associated with the deal */
next_activity_duration?: string;
/** @description The note of the next activity associated with the deal */
next_activity_note?: string;
/** @description The deal value formatted with selected currency. E.g. US$500 */
formatted_value?: string;
/** @description Probability times deal value. Probability can either be deal probability or if not set, then stage probability. */
weighted_value?: number;
/** @description The weighted_value formatted with selected currency. E.g. US$500 */
formatted_weighted_value?: string;
/** @description The currency associated with the deal */
weighted_value_currency?: string;
/** @description The date and time of changing the deal status as rotten */
rotten_time?: string | null;
/** @description The name of the deal owner */
owner_name?: string;
/** @description The BCC email of the deal */
cc_email?: string;
/** @description If the organization that is associated with the deal is hidden or not */
org_hidden?: boolean;
/** @description If the person that is associated with the deal is hidden or not */
person_hidden?: boolean;
})[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
related_objects?: {
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description Whether the associated organization is active or not */
active_flag?: boolean;
} & ({
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
});
};
person?: {
/** @description The ID of the person associated with the item */
PERSON_ID?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the person associated with the item */
id?: number;
/** @description The name of the person associated with the item */
name?: string;
/** @description The emails of the person associated with the item */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description Whether this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the item */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the item */
value?: string;
/** @description Whether this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the item */
owner_id?: number;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
stage?: {
/** @description The ID of the stage */
id?: number;
/** @description Defines the order of the stage */
order_nr?: number;
/** @description The name of the stage */
name?: string;
/** @description Whether the stage is active or deleted */
active_flag?: boolean;
/** @description The success probability percentage of the deal. Used/shown when the deal weighted values are used. */
deal_probability?: number;
/** @description The ID of the pipeline to add the stage to */
pipeline_id?: number;
/**
* @description Whether deals in this stage can become rotten
* @enum {boolean}
*/
rotten_flag?: true | false;
/** @description The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is set. */
rotten_days?: number;
/** @description The stage creation time. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The stage update time. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
};
pipeline?: {
/** @description The ID of the pipeline */
id?: number;
/** @description The name of the pipeline */
name?: string;
/** @description The pipeline title displayed in the URL */
url_title?: string;
/** @description Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. */
order_nr?: number;
/** @description Whether this pipeline will be made inactive (hidden) or active */
active?: boolean;
/** @description Whether deal probability is disabled or enabled for this pipeline */
deal_probability?: boolean;
/** @description The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
};
};
};
};
};
};
};
/** Lists files associated with a person. */
getPersonFiles: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** 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`. */
sort?: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of files */
data?: {
/** @description The ID of the file */
id?: number;
/** @description The ID of the user to associate the file with */
user_id?: number;
/** @description The ID of the deal to associate the file with */
deal_id?: number;
/** @description The ID of the person to associate the file with */
person_id?: number;
/** @description The ID of the organization to associate the file with */
org_id?: number;
/** @description The ID of the product to associate the file with */
product_id?: number;
/** @description The ID of the activity to associate the file with */
activity_id?: number;
/** @description The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The original name of the file */
file_name?: string;
/** @description The size of the file */
file_size?: number;
/** @description Whether the user is active or not. false = Not activated, true = Activated */
active_flag?: boolean;
/** @description Whether the file was uploaded as inline or not */
inline_flag?: boolean;
/** @description The location type to send the file to. Only googledrive is supported at the moment. */
remote_location?: string;
/** @description The ID of the remote item */
remote_id?: string;
/** @description The ID of the inline attachment */
cid?: string;
/** @description The location of the cloud storage */
s3_bucket?: string;
/** @description The ID of the mail message to associate the file with */
mail_message_id?: string;
/** @description The ID of the mail template to associate the file with */
mail_template_id?: string;
/** @description The name of the deal associated with the dile */
deal_name?: string;
/** @description The name of the person associated with the file */
person_name?: string;
/** @description The name of the organization associated with the file */
org_name?: string;
/** @description The name of the product associated with the file */
product_name?: string;
/** @description The URL of the download file */
url?: string;
/** @description The visible name of the file */
name?: string;
/** @description The description of the file */
description?: string;
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Lists updates about a person.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint's response will also include updates for the `marketing_status` field. */
getPersonUpdates: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
/** Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. */
all_changes?: 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) */
items?: string;
};
};
responses: {
/** Get the person updates */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The type of the person update. (Possible object types - personChange, note, activity, file) */
object?: string;
/** @description The creation date and time of the update */
timestamp?: string;
/** @description The data related to the update */
data?: { [key: string]: unknown };
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
related_objects?: {
deal?: {
/** @description The ID of the deal which is associated with the item */
DEAL_ID?: {
/** @description The ID of the deal associated with the item */
id?: number;
/** @description The title of the deal associated with the item */
title?: string;
/** @description The status of the deal associated with the item */
status?: string;
/** @description The value of the deal that is associated with the item */
value?: number;
/** @description The currency of the deal value */
currency?: string;
/** @description The ID of the stage the deal is currently at */
stage_id?: number;
/** @description The ID of the pipeline the deal is in */
pipeline_id?: number;
};
};
organization?: {
/** @description The ID of the organization associated with the item */
ORGANIZATION_ID?: {
/** @description The ID of the organization associated with the item */
id?: number;
} & {
/** @description The name of the organization associated with the item */
name?: string;
/** @description The number of people connected with the organization that is associated with the item */
people_count?: number;
/** @description The ID of the owner of the organization that is associated with the item */
owner_id?: number;
/** @description The address of the organization */
address?: string;
/** @description The BCC email of the organization associated with the item */
cc_email?: string;
};
};
user?: {
/** userDataWithId */
USER_ID?: {
/** @description The ID of the user */
id?: number;
/** @description The name of the user */
name?: string;
/** @description The email of the user */
email?: string;
/** @description Whether the user has picture or not. 0 = No picture, 1 = Has picture. */
has_pic?: number;
/** @description The user picture hash */
pic_hash?: string | null;
/** @description Whether the user is active or not */
active_flag?: boolean;
} & { [key: string]: unknown };
};
person?: {
/** @description The ID of the person associated with the item */
PERSON_ID?: {
/** @description Whether the associated person is active or not */
active_flag?: boolean;
} & {
/** @description The ID of the person associated with the item */
id?: number;
/** @description The name of the person associated with the item */
name?: string;
/** @description The emails of the person associated with the item */
email?: {
/** @description The type of the email */
label?: string;
/** @description The email of the associated person */
value?: string;
/** @description Whether this is the primary email or not */
primary?: boolean;
}[];
/** @description The phone numbers of the person associated with the item */
phone?: {
/** @description The type of the phone number */
label?: string;
/** @description The phone number of the person associated with the item */
value?: string;
/** @description Whether this is the primary phone number or not */
primary?: boolean;
}[];
/** @description The ID of the owner of the person that is associated with the item */
owner_id?: number;
};
};
};
};
};
};
};
};
/** Lists the followers of a person. */
getPersonFollowers: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The list of followers */
data?: {
/** @description The ID of the user */
user_id?: number;
/** @description The ID of the user follower */
id?: number;
/** @description The ID of the person */
person_id?: number;
/** @description The date and time when the follower was added to the person */
add_time?: string;
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Adds a follower to a person. */
addPersonFollower: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the user who was added as a follower to a person */
user_id?: number;
/** @description The ID of the follower */
id?: number;
/** @description The ID of the person to whom the follower was added */
person_id?: number;
/** @description The date and time when the follower was added to a person. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The ID of the user */
user_id: number;
};
};
};
};
/** Deletes a follower from a person. */
deletePersonFollower: {
parameters: {
path: {
/** The ID of the person */
id: number;
/** The ID of the follower */
follower_id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the deleted person */
id?: number;
};
};
};
};
};
};
/** Lists mail messages associated with a person. */
getPersonMailMessages: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of mail messages */
data?: {
/** @description The type of the data item */
object?: string;
/** @description The date and time when the item was created */
timestamp?: string;
/** mailMessageItemForList */
data?: {
/** @description ID of the mail message. */
id?: number;
/** @description The array of mail message sender (object) */
from?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message receiver (object) */
to?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message copies (object) */
cc?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The array of mail message blind copies (object) */
bcc?: {
/** @description ID of the mail participant */
id?: number;
/** @description Mail address of the mail participant */
email_address?: string;
/** @description Name of the mail participant */
name?: string;
/** @description ID of the linked person to the mail message */
linked_person_id?: number;
/** @description Name of the linked person to the mail message */
linked_person_name?: string;
/** @description ID of the mail message participant */
mail_message_party_id?: number;
}[];
/** @description The mail message body URL */
body_url?: string;
/** @description The connection account ID */
account_id?: string;
/** @description ID of the user whom mail message will be assigned to */
user_id?: number;
/** @description ID of the mail message thread */
mail_thread_id?: number;
/** @description The subject of mail message */
subject?: string;
/** @description The snippet of mail message. Snippet length is up to 225 characters. */
snippet?: string;
/**
* @description The status of tracking mail message. Value is `null` if tracking is not enabled.
* @enum {string|null}
*/
mail_tracking_status?: ('opened' | 'not opened') | null;
/** @description Whether the link tracking in mail message body is enabled. */
mail_link_tracking_enabled_flag?: 0 | 1;
/** @description Whether the mail message is read or not by the user */
read_flag?: 0 | 1;
/** @description If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. */
draft?: string;
/** @description Whether the mail message is a draft or not */
draft_flag?: 0 | 1;
/** @description Whether the mail message is synced with the provider or not */
synced_flag?: 0 | 1;
/** @description Whether the mail message is deleted or not */
deleted_flag?: 0 | 1;
/** @description Whether the mail message has a body or not */
has_body_flag?: 0 | 1;
/** @description Whether the mail message has been sent or not */
sent_flag?: 0 | 1;
/** @description Whether the mail message has been sent from Pipedrive app or not */
sent_from_pipedrive_flag?: 0 | 1;
/** @description Whether the mail message has been created by Smart Email BCC feature or not */
smart_bcc_flag?: 0 | 1;
/**
* Format: date-time
* @description Creation or receival time of the mail message
*/
message_time?: string;
/**
* Format: date-time
* @description The insertion into the database time of the mail message
*/
add_time?: string;
/**
* Format: date-time
* @description The updating time in the database of the mail message
*/
update_time?: string;
/** @description Whether the mail message has an attachment or not */
has_attachments_flag?: 0 | 1;
/** @description Whether the mail message has an inline attachment or not */
has_inline_attachments_flag?: 0 | 1;
/** @description Whether the mail message has an attachment (which is not inline) or not */
has_real_attachments_flag?: 0 | 1;
} & {
/** @description The Mail Message ID assigned by the sync provider */
nylas_id?: string;
/** @description The name of the S3 bucket */
s3_bucket?: string;
/** @description The path of the S3 bucket */
s3_bucket_path?: string;
/** @description If the Mail Message has been deleted on the provider side or not */
external_deleted_flag?: boolean;
/** @description The Mail Message ID assigned by the mail user agent */
mua_message_id?: string;
/** @description The ID of the mail template */
template_id?: number;
/** @description The add date and time of the Mail Message */
timestamp?: string;
/** @description The type of the data item */
item_type?: string;
/** @description The ID of the company */
company_id?: number;
};
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Merges a person with another person. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/merging-two-persons" target="_blank" rel="noopener noreferrer">merging two persons</a>. */
mergePersons: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** mergePersonItem */
data?: {
/** @description The ID of the person */
id?: number;
/** @description The ID of the company related to the person */
company_id?: number;
/** @description Whether the person is active or not */
active_flag?: boolean;
/** @description List of phone data related to the person */
phone?: {
/** @description The phone number */
value?: string;
/** @description Boolean that indicates if phone number is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) */
label?: string;
}[];
/** @description List of email data related to the person */
email?: {
/** @description Email */
value?: string;
/** @description Boolean that indicates if email is primary for the person or not */
primary?: boolean;
/** @description The label that indicates the type of the email. (Possible values - work, home or other) */
label?: string;
}[];
/** @description The primary email of the person */
primary_email?: string;
/** @description The first letter of the name of the person */
first_char?: string;
/** @description The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS */
add_time?: string;
/** @description The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS */
update_time?: string;
/** @description The visibility group ID of who can see the person */
visible_to?: string;
picture_id?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
/** @description The label assigned to the person */
label?: number;
/** @description The name of the organization associated with the person */
org_name?: string;
/** @description The name of the owner associated with the person */
owner_name?: string;
/** @description The BCC email associated with the person */
cc_email?: string;
} & (({
/** @description The ID of the owner related to the person */
owner_id?: number;
/** @description The ID of the organization related to the person */
org_id?: number;
/** @description The ID of the person with what the main person was merged */
merge_what_id?: number;
} & ({
/** @description The name of the person */
name?: string;
/** @description The first name of the person */
first_name?: string;
/** @description The last name of the person */
last_name?: string;
} & ({
/** @description The count of email messages related to the person */
email_messages_count?: number;
/** @description The count of activities related to the person */
activities_count?: number;
/** @description The count of done activities related to the person */
done_activities_count?: number;
/** @description The count of undone activities related to the person */
undone_activities_count?: number;
/** @description The count of files related to the person */
files_count?: number;
/** @description The count of notes related to the person */
notes_count?: number;
/** @description The count of followers related to the person */
followers_count?: number;
} & {
/** @description The date and time of the last incoming email associated with the person */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the person */
last_outgoing_mail_time?: string;
}))) &
(({
/** @description The count of open deals related with the item */
open_deals_count?: number;
/** @description The count of related open deals related with the item */
related_open_deals_count?: number;
/** @description The count of closed deals related with the item */
closed_deals_count?: number;
/** @description The count of related closed deals related with the item */
related_closed_deals_count?: number;
/** @description The count of won deals related with the item */
won_deals_count?: number;
/** @description The count of related won deals related with the item */
related_won_deals_count?: number;
/** @description The count of lost deals related with the item */
lost_deals_count?: number;
/** @description The count of related lost deals related with the item */
related_lost_deals_count?: number;
} & {
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
}) & {
/** @description The count of open participant deals related with the item */
participant_open_deals_count?: number;
/** @description The count of closed participant deals related with the item */
participant_closed_deals_count?: number;
}));
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description 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. */
merge_with_id: number;
};
};
};
};
/** List users permitted to access a person. */
getPersonUsers: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The list of permitted user IDs */
data?: number[];
};
};
};
};
};
/** Adds 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. */
addPersonPicture: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The picture that is associated with the item */
data?: {
/** @description The ID of the picture */
PICTURE_ID?: {
/** @description The ID of the picture associated with the item */
id?: number;
} & {
/** @description The type of item the picture is related to */
item_type?: string;
/** @description The ID of related item */
item_id?: number;
/** @description Whether the associated picture is active or not */
active_flag?: boolean;
/** @description The add time of the picture */
add_time?: string;
/** @description The update time of the picture */
update_time?: string;
/** @description The ID of the user who added the picture */
added_by_user_id?: number;
pictures?: {
/** @description The URL of the 128*128 picture */
'128'?: string;
/** @description The URL of the 512*512 picture */
'512'?: string;
};
};
};
};
};
};
};
requestBody: {
content: {
'multipart/form-data': {
/**
* Format: binary
* @description One image supplied in the multipart/form-data encoding
*/
file: string;
/** @description X coordinate to where start cropping form (in pixels) */
crop_x?: number;
/** @description Y coordinate to where start cropping form (in pixels) */
crop_y?: number;
/** @description The width of the cropping area (in pixels) */
crop_width?: number;
/** @description The height of the cropping area (in pixels) */
crop_height?: number;
};
};
};
};
/** Deletes a person’s picture. */
deletePersonPicture: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the deleted person */
id?: number;
};
};
};
};
};
};
/** Lists products associated with a person. */
getPersonProducts: {
parameters: {
path: {
/** The ID of the person */
id: number;
};
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The array of deal products */
data?: {
DEAL_ID?: {
deal?: {
/** @description The ID of the deal */
id?: number;
/** @description The ID of the company */
company_id?: number;
/** @description The ID of the deal creator */
creator_user_id?: number;
/** @description The ID of the user */
user_id?: number;
/** @description The ID of the person associated with the deal */
person_id?: number;
/** @description The ID of the organization associated with the deal */
org_id?: number;
/** @description The ID of the deal stage */
stage_id?: number;
/** @description The title of the deal */
title?: string;
/** @description The value of the deal */
value?: number;
/** @description The currency associated with the deal */
currency?: string;
/** @description The creation date and time of the deal */
add_time?: string;
/** @description The first creation date and time of the deal */
first_add_time?: string;
/** @description The last updated date and time of the deal */
update_time?: string;
/** @description The last updated date and time of the deal stage */
stage_change_time?: string;
/** @description Whether the deal is active or not */
active?: boolean;
/** @description Whether the deal is deleted or not */
deleted?: boolean;
/** @description The status of the deal */
status?: string;
/** @description The success probability percentage of the deal */
probability?: number | null;
/** @description The date of the next activity associated with the deal */
next_activity_date?: string;
/** @description The time of the next activity associated with the deal */
next_activity_time?: string;
/** @description The ID of the next activity associated with the deal */
next_activity_id?: number | null;
/** @description The ID of the last activity associated with the deal */
last_activity_id?: number | null;
/** @description The date of the last activity associated with the deal */
last_activity_date?: string | null;
/** @description The reason for losing the deal */
lost_reason?: string | null;
/** @description The visibility of the deal */
visible_to?: string;
/** @description The date and time of closing the deal */
close_time?: string | null;
/** @description The ID of pipeline associated with the deal */
pipeline_id?: number;
/** @description The date and time of changing the deal status as won */
won_time?: string;
/** @description The date and time of the first time changing the deal status as won */
first_won_time?: string;
/** @description The date and time of changing the deal status as lost */
lost_time?: string;
/** @description The number of products associated with the deal */
products_count?: number;
/** @description The number of files associated with the deal */
files_count?: number;
/** @description The number of notes associated with the deal */
notes_count?: number;
/** @description The number of followers associated with the deal */
followers_count?: number;
/** @description The number of emails associated with the deal */
email_messages_count?: number;
/** @description The number of activities associated with the deal */
activities_count?: number;
/** @description The number of completed activities associated with the deal */
done_activities_count?: number;
/** @description The number of incomplete activities associated with the deal */
undone_activities_count?: number;
/** @description The number of participants associated with the deal */
participants_count?: number;
/**
* Format: date
* @description The expected close date of the deal
*/
expected_close_date?: string;
/** @description The date and time of the last incoming email associated with the deal */
last_incoming_mail_time?: string;
/** @description The date and time of the last outgoing email associated with the deal */
last_outgoing_mail_time?: string;
/** @description The label assigned to the deal */
label?: string;
};
product?: {
/** @description The ID of the product */
id?: number;
/** @description The ID of the company */
company_id?: number;
/** @description The name of the product */
name?: string;
/** @description The product code */
code?: string;
/** @description The description of the product */
description?: string;
/** @description The unit in which this product is sold */
unit?: string;
/**
* @description The tax percentage
* @default 0
*/
tax?: number;
/** @description The category of the product */
category?: string;
/**
* numberBooleanDefault1
* @description Whether this product will be made active or not
* @default 1
* @enum {number}
*/
active_flag?: 0 | 1;
/**
* numberBooleanDefault1
* @description Whether this product can be selected in deals or not
* @default 1
* @enum {number}
*/
selectable?: 0 | 1;
/** @description The first letter of the product name */
first_char?: string;
/** @description The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers (private)</td></tr><tr><td>`3`</td><td>Entire company (shared)</td></tr></table> */
visible_to?: '1' | '3' | '5' | '7';
/** @description The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used. */
owner_id?: number;
/** @description The count of files */
files_count?: number;
/** @description The count of followers */
followers_count?: number;
/** @description The date and time when the product was added to the deal */
add_time?: string;
/** @description The date and time when the product was updated to the deal */
update_time?: string;
/** @description The ID of the deal */
deal_id?: number;
};
};
}[];
additional_data?: {
/** @description Pagination details of the list */
pagination?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description Whether there are more list items in the collection than displayed */
more_items_in_collection?: boolean;
/** @description Next pagination start */
next_start?: number;
};
};
};
};
};
};
};
/** Returns data about all person fields.<br>If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. */
getPersonFields: {
parameters: {
query: {
/** Pagination start */
start?: number;
/** Items shown per page */
limit?: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
}[];
/** @description The additional data of the list */
additional_data?: {
/** @description Pagination start */
start?: number;
/** @description Items shown per page */
limit?: number;
/** @description If there are more list items in the collection than displayed or not */
more_items_in_collection?: boolean;
};
};
};
};
};
};
/** Adds a new person field. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-new-custom-field" target="_blank" rel="noopener noreferrer">adding a new custom field</a>. */
addPersonField: {
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the field */
name: string;
/** @description When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. Example: `[{"label":"New Item"}]` */
options?: string;
/**
* @description Whether the field is available in the 'add new' modal or not (both in the web and mobile app)
* @default true
* @enum {boolean}
*/
add_visible_flag?: true | false;
} & {
/**
* @description The type of the field<table><tr><th>Value</th><th>Description</th></tr><tr><td>`address`</td><td>Address field (has multiple subfields, autocompleted by Google Maps)</td></tr><tr><td>`date`</td><td>Date (format YYYY-MM-DD)</td></tr><tr><td>`daterange`</td><td>Date-range field (has a start date and end date value, both YYYY-MM-DD)</td></tr><tr><td>`double`</td><td>Numeric value</td></tr><tr><td>`enum`</td><td>Options field with a single possible chosen option</td></tr><tr></tr><tr><td>`monetary`</td><td>Monetary field (has a numeric value and a currency value)</td></tr><tr><td>`org`</td><td>Organization field (contains an organization ID which is stored on the same account)</td></tr><tr><td>`people`</td><td>Person field (contains a person ID which is stored on the same account)</td></tr><tr><td>`phone`</td><td>Phone field (up to 255 numbers and/or characters)</td></tr><tr><td>`set`</td><td>Options field with a possibility of having multiple chosen options</td></tr><tr><td>`text`</td><td>Long text (up to 65k characters)</td></tr><tr><td>`time`</td><td>Time field (format HH:MM:SS)</td></tr><tr><td>`timerange`</td><td>Time-range field (has a start time and end time value, both HH:MM:SS)</td></tr><tr><td>`user`</td><td>User field (contains a user ID of another Pipedrive user)</td></tr><tr><td>`varchar`</td><td>Text (up to 255 characters)</td></tr><tr><td>`varchar_auto`</td><td>Autocomplete text (up to 255 characters)</td></tr><tr><td>`visible_to`</td><td>System field that keeps item's visibility setting</td></tr></table>
* @enum {string}
*/
field_type:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
};
};
};
};
/** Marks multiple fields as deleted. */
deletePersonFields: {
parameters: {
query: {
/** The comma-separated field IDs to delete */
ids: string;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The list of deleted field IDs */
id?: number[];
};
};
};
};
};
};
/** Returns data about a specific person field. */
getPersonField: {
parameters: {
path: {
/** The ID of the field */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
};
};
};
};
};
};
/** Updates a person field. For more information, see the tutorial for <a href=" https://pipedrive.readme.io/docs/updating-custom-field-value " target="_blank" rel="noopener noreferrer">updating custom fields' values</a>. */
updatePersonField: {
parameters: {
path: {
/** The ID of the field */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field. Value is `null` in case of subfields. */
id?: number;
/** @description The key of the field. For custom fields this is generated upon creation. */
key?: string;
/** @description The name of the field */
name?: string;
/** @description The order number of the field */
order_nr?: number;
field_type?:
| 'address'
| 'date'
| 'daterange'
| 'double'
| 'enum'
| 'monetary'
| 'org'
| 'people'
| 'phone'
| 'set'
| 'text'
| 'time'
| 'timerange'
| 'user'
| 'varchar'
| 'varchar_auto'
| 'visible_to';
/**
* Format: datetime
* @description The creation time of the field
*/
add_time?: string;
/**
* Format: datetime
* @description The update time of the field
*/
update_time?: string;
/** @description The ID of the user who created or most recently updated the field, only applicable for custom fields */
last_updated_by_user_id?: number;
/** @description The active flag of the field */
active_flag?: boolean;
/** @description The edit flag of the field */
edit_flag?: boolean;
/** @description Not used */
index_visible_flag?: boolean;
/** @description Not used */
details_visible_flag?: boolean;
/** @description Not used */
add_visible_flag?: boolean;
/** @description Not used */
important_flag?: boolean;
/** @description Whether or not the field of an item can be edited in bulk */
bulk_edit_allowed?: boolean;
/** @description Whether or not items can be searched by this field */
searchable_flag?: boolean;
/** @description Whether or not items can be filtered by this field */
filtering_allowed?: boolean;
/** @description Whether or not items can be sorted by this field */
sortable_flag?: boolean;
/** @description Whether or not the field is mandatory */
mandatory_flag?: boolean;
/** @description The options of the field. When there are no options, `null` is returned. */
options?: { [key: string]: unknown }[] | null;
/** @description The deleted options of the field. Only present when there is at least 1 deleted option. */
options_deleted?: { [key: string]: unknown }[];
/** @description Whether or not the field is a subfield of another field. Only present if field is subfield. */
is_subfield?: boolean;
/** @description The subfields of the field. Only present when the field has subfields. */
subfields?: { [key: string]: unknown }[];
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the field */
name?: string;
/** @description When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: `[{"id":123,"label":"Existing Item"},{"label":"New Item"}]` */
options?: string;
/**
* @description Whether the field is available in 'add new' modal or not (both in web and mobile app)
* @default true
* @enum {boolean}
*/
add_visible_flag?: true | false;
};
};
};
};
/** Marks a field as deleted. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/deleting-a-custom-field" target="_blank" rel="noopener noreferrer">deleting a custom field</a>. */
deletePersonField: {
parameters: {
path: {
/** The ID of the field */
id: number;
};
};
responses: {
/** Success */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
data?: {
/** @description The ID of the field that was deleted */
id?: number;
};
};
};
};
};
};
/** Returns data about all pipelines. */
getPipelines: {
responses: {
/** Get all pipelines */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description Pipelines array */
data?: ({
/** @description The ID of the pipeline */
id?: number;
/** @description The name of the pipeline */
name?: string;
/** @description The pipeline title displayed in the URL */
url_title?: string;
/** @description Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. */
order_nr?: number;
/** @description Whether this pipeline will be made inactive (hidden) or active */
active?: boolean;
/** @description Whether deal probability is disabled or enabled for this pipeline */
deal_probability?: boolean;
/** @description The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
} & {
/** @description A boolean that shows if the pipeline is selected from a filter or not */
selected?: boolean;
})[];
};
};
};
};
};
/** Adds a new pipeline. */
addPipeline: {
responses: {
/** Add pipeline */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The pipeline object */
data?: {
/** @description The ID of the pipeline */
id?: number;
/** @description The name of the pipeline */
name?: string;
/** @description The pipeline title displayed in the URL */
url_title?: string;
/** @description Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. */
order_nr?: number;
/** @description Whether this pipeline will be made inactive (hidden) or active */
active?: boolean;
/** @description Whether deal probability is disabled or enabled for this pipeline */
deal_probability?: boolean;
/** @description The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the pipeline */
name: string;
/** @description Whether deal probability is disabled or enabled for this pipeline */
deal_probability?: 0 | 1;
/** @description Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. */
order_nr?: number;
/** @description Whether this pipeline will be made inactive (hidden) or active */
active?: 0 | 1;
};
};
};
};
/** Returns data about a specific pipeline. Also returns the summary of the deals in this pipeline across its stages. */
getPipeline: {
parameters: {
path: {
/** The ID of the pipeline */
id: number;
};
query: {
/** The 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. */
totals_convert_currency?: string;
};
};
responses: {
/** Get pipeline */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/**
* pipelineDetails
* @description The pipeline object
*/
data?: ({
/** @description The ID of the pipeline */
id?: number;
/** @description The name of the pipeline */
name?: string;
/** @description The pipeline title displayed in the URL */
url_title?: string;
/** @description Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. */
order_nr?: number;
/** @description Whether this pipeline will be made inactive (hidden) or active */
active?: boolean;
/** @description Whether deal probability is disabled or enabled for this pipeline */
deal_probability?: boolean;
/** @description The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
} & {
/** @description A boolean that shows if the pipeline is selected from a filter or not */
selected?: boolean;
}) & {
/** @description Deals summary */
deals_summary?: {
/** @description The stage objects containing deals currency information */
per_stages?: {
/** @description The currency summaries per stage. This parameter is dynamic and changes according to `stage_id` value. */
STAGE_ID?: {
/** @description The currency summary. This parameter is dynamic and changes according to `currency_id` value. */
CURRENCY_ID?: {
/** @description Deals count per currency */
count?: number;
/** @description Deals value per currency */
value?: number;
/** @description Deals value formatted per currency */
value_formatted?: string;
/** @description Deals weighted value per currency */
weighted_value?: number;
/** @description Deals weighted value formatted per currency */
weighted_value_formatted?: string;
};
};
};
/** @description The currency count summary */
per_currency?: {
/** @description Deals count per currency. This parameter is dynamic and changes according to `currency_id` value. */
CURRENCY_ID?: number;
};
/** @description Deals count */
total_count?: number;
/** @description Full currency summaries */
per_currency_full?: {
/** @description The currency summary. This parameter is dynamic and changes according to `currency_id` value. */
CURRENCY_ID?: {
/** @description Deals count per currency */
count?: number;
/** @description Deals value per currency */
value?: number;
};
};
};
};
};
};
};
};
};
/** Updates the properties of a pipeline. */
updatePipeline: {
parameters: {
path: {
/** The ID of the pipeline */
id: number;
};
};
responses: {
/** Edit pipeline */
200: {
content: {
'application/json': {
/** @description If the response is successful or not */
success?: boolean;
} & {
/** @description The pipeline object */
data?: {
/** @description The ID of the pipeline */
id?: number;
/** @description The name of the pipeline */
name?: string;
/** @description The pipeline title displayed in the URL */
url_title?: string;
/** @description Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. */
order_nr?: number;
/** @description Whether this pipeline will be made inactive (hidden) or active */
active?: boolean;
/** @description Whether deal probability is disabled or enabled for this pipeline */
deal_probability?: boolean;
/** @description The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. */
add_time?: string;
/** @description The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. */
update_time?: string;
} & {
/** @description A boolean that shows if the pipeline is selected from a filter or not */
selected?: boolean;
};
};
};
};
};
requestBody: {
content: {
'application/json': {
/** @description The name of the pipeline */
name?: string;
/** @description Whether deal probability is disabled or enabled for this pipeline */
deal_probability?: 0 | 1;
/** @description Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. */
order_nr?: number;
/** @description Whether this pipeline will be made inactive (hidden) or active */
active?: 0 | 1;
};
};
};
};
/** Marks a pipeline as deleted. */
deletePipeline: {
parameters: {
path: {
/** The ID of the pipeline */
id: number;
};
};
responses: {
/** Delete pipeline */
200: {
content: {
'application/json': {
/** @description If the request was successful or not */
success?: boolean;
data?: {
/** @description Deleted Pipeline ID */
id?: number;
};
};
};
};
};
};
/** Returns all stage-to-stage conversion and pipeline-to-close rates for the given time period. */
getPipelineConversionStatistics: {
parameters: {
path: {
/** The ID of the pipeline */
id: number;
};
query: {
/** The start of the period. Date in format of YYYY-MM-DD. */
start_date: string;
/** The end of the period. Date in format of YYYY-MM-DD. */
end_date: string;
/** The ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. */
user_id?: number;
};
};
responses: {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment