Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ The file format of it is based on [Keep a Changelog](http://keepachangelog.com/e
For public Changelog covering all changes done to Pipedrive’s API, webhooks and app extensions platforms, see [public Changelog](https://pipedrive.readme.io/docs/changelog) with discussion area in [Developers Community](https://devcommunity.pipedrive.com/c/documentation/changelog/19).

## [Unreleased]
### Added
- Added `GET /v1/leadFields` endpoint for fetching all lead fields

## [30.4.0] - 2025-11-18
### Added
Expand Down
1 change: 1 addition & 0 deletions docs/v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ GoalsApi | getGoals | **GET** /goals/find | Find goals
GoalsApi | updateGoal | **PUT** /goals/{id} | Update existing goal
ItemSearchApi | searchItem | **GET** /itemSearch | Perform a search from multiple item types
ItemSearchApi | searchItemByField | **GET** /itemSearch/field | Perform a search using a specific field from an item type
LeadFieldsApi | getLeadFields | **GET** /leadFields | Get all lead fields
LeadLabelsApi | addLeadLabel | **POST** /leadLabels | Add a lead label
LeadLabelsApi | deleteLeadLabel | **DELETE** /leadLabels/{id} | Delete a lead label
LeadLabelsApi | getLeadLabels | **GET** /leadLabels | Get all lead labels
Expand Down
1 change: 1 addition & 0 deletions src/versions/v1/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export * from './api/files-api';
export * from './api/filters-api';
export * from './api/goals-api';
export * from './api/item-search-api';
export * from './api/lead-fields-api';
export * from './api/lead-labels-api';
export * from './api/lead-sources-api';
export * from './api/leads-api';
Expand Down
164 changes: 164 additions & 0 deletions src/versions/v1/api/lead-fields-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
/* tslint:disable */
/* eslint-disable */
/**
* Pipedrive API v1
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
// @ts-ignore
import { GetFieldsResponse } from '../models';
/**
* LeadFieldsApi - axios parameter creator
* @export
*/
export const LeadFieldsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Returns data about all lead fields.
* @summary Get all lead fields
* @param {number} [start] Pagination start
* @param {number} [limit] Items shown per page

* @throws {RequiredError}
*/
getLeadFields: async (start?: number, limit?: number, ): Promise<RequestArgs> => {
const localVarPath = `/leadFields`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'GET', ...baseOptions };
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration)

// authentication oauth2 required
// oauth required
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["leads:read", "leads:full", "admin"], configuration)

if (start !== undefined) {
localVarQueryParameter['start'] = start;
}

if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}



setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, };

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};


/**
* LeadFieldsApi - functional programming interface
* @export
*/
export const LeadFieldsApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = LeadFieldsApiAxiosParamCreator(configuration)
return {
/**
* Returns data about all lead fields.
* @summary Get all lead fields
* @param {number} [start] Pagination start
* @param {number} [limit] Items shown per page

* @throws {RequiredError}
*/
async getLeadFields(start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetFieldsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadFields(start, limit, );
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};

/**
* LeadFieldsApi - factory interface
* @export
*/
export const LeadFieldsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = LeadFieldsApiFp(configuration)
return {
/**
* Returns data about all lead fields.
* @summary Get all lead fields
* @param {LeadFieldsApiGetLeadFieldsRequest} requestParameters Request parameters.

* @throws {RequiredError}
*/
getLeadFields(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ): Promise<GetFieldsResponse> {
return localVarFp.getLeadFields(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath));
},
};
};

/**
* Request parameters for getLeadFields operation in LeadFieldsApi.
* @export
* @interface LeadFieldsApiGetLeadFieldsRequest
*/
export interface LeadFieldsApiGetLeadFieldsRequest {
/**
* Pagination start
* @type {number}
* @memberof LeadFieldsApiGetLeadFields
*/
readonly start?: number

/**
* Items shown per page
* @type {number}
* @memberof LeadFieldsApiGetLeadFields
*/
readonly limit?: number
}

/**
* LeadFieldsApi - object-oriented interface
* @export
* @class LeadFieldsApi
* @extends {BaseAPI}
*/
export class LeadFieldsApi extends BaseAPI {
/**
* Returns data about all lead fields.
* @summary Get all lead fields
* @param {LeadFieldsApiGetLeadFieldsRequest} requestParameters Request parameters.

* @throws {RequiredError}
* @memberof LeadFieldsApi
*/
public getLeadFields(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ) {
return LeadFieldsApiFp(this.configuration).getLeadFields(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath));
}
}
23 changes: 18 additions & 5 deletions src/versions/v2/api/persons-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati
* @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
* @param {number} [owner_id] If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored.
* @param {number} [org_id] If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored.
* @param {number} [deal_id] If supplied, only persons linked to the specified deal are returned. If filter_id is provided, this is ignored.
* @param {string} [updated_since] If set, only persons with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
* @param {string} [updated_until] If set, only persons with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
* @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
Expand All @@ -392,7 +393,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati

* @throws {RequiredError}
*/
getPersons: async (filter_id?: number, ids?: string, owner_id?: number, org_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, limit?: number, cursor?: string, ): Promise<RequestArgs> => {
getPersons: async (filter_id?: number, ids?: string, owner_id?: number, org_id?: number, deal_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, limit?: number, cursor?: string, ): Promise<RequestArgs> => {
const localVarPath = `/persons`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
Expand Down Expand Up @@ -428,6 +429,10 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati
localVarQueryParameter['org_id'] = org_id;
}

if (deal_id !== undefined) {
localVarQueryParameter['deal_id'] = deal_id;
}

if (updated_since !== undefined) {
localVarQueryParameter['updated_since'] = updated_since;
}
Expand Down Expand Up @@ -693,6 +698,7 @@ export const PersonsApiFp = function(configuration?: Configuration) {
* @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
* @param {number} [owner_id] If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored.
* @param {number} [org_id] If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored.
* @param {number} [deal_id] If supplied, only persons linked to the specified deal are returned. If filter_id is provided, this is ignored.
* @param {string} [updated_since] If set, only persons with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
* @param {string} [updated_until] If set, only persons with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
* @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
Expand All @@ -704,8 +710,8 @@ export const PersonsApiFp = function(configuration?: Configuration) {

* @throws {RequiredError}
*/
async getPersons(filter_id?: number, ids?: string, owner_id?: number, org_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetPersonsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPersons(filter_id, ids, owner_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor, );
async getPersons(filter_id?: number, ids?: string, owner_id?: number, org_id?: number, deal_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetPersonsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPersons(filter_id, ids, owner_id, org_id, deal_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor, );
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
Expand Down Expand Up @@ -825,7 +831,7 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa
* @throws {RequiredError}
*/
getPersons(requestParameters: PersonsApiGetPersonsRequest = {}, ): Promise<GetPersonsResponse> {
return localVarFp.getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath));
return localVarFp.getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.deal_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath));
},
/**
* 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.
Expand Down Expand Up @@ -1038,6 +1044,13 @@ export interface PersonsApiGetPersonsRequest {
*/
readonly org_id?: number

/**
* If supplied, only persons linked to the specified deal are returned. If filter_id is provided, this is ignored.
* @type {number}
* @memberof PersonsApiGetPersons
*/
readonly deal_id?: number

/**
* If set, only persons with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
* @type {string}
Expand Down Expand Up @@ -1272,7 +1285,7 @@ export class PersonsApi extends BaseAPI {
* @memberof PersonsApi
*/
public getPersons(requestParameters: PersonsApiGetPersonsRequest = {}, ) {
return PersonsApiFp(this.configuration).getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath));
return PersonsApiFp(this.configuration).getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.deal_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath));
}

/**
Expand Down
Loading