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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ 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 `updated_since` query parameter to `GET /v1/leads` endpoint to filter leads by their `update_time`
- Added `updated_since` query parameter to `GET /v1/notes` endpoint to filter notes by their `update_time`

## [31.0.0] - 2026-01-27
### Removed
Expand Down
23 changes: 18 additions & 5 deletions src/versions/v1/api/leads-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,12 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration
* @param {number} [person_id] If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied.
* @param {number} [organization_id] If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied.
* @param {number} [filter_id] The ID of the filter to use
* @param {string} [updated_since] If set, only leads with an `update_time` later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z.
* @param {'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'} [sort] 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).

* @throws {RequiredError}
*/
getLeads: async (limit?: number, start?: number, owner_id?: number, person_id?: number, organization_id?: number, filter_id?: number, sort?: 'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time', ): Promise<RequestArgs> => {
getLeads: async (limit?: number, start?: number, owner_id?: number, person_id?: number, organization_id?: number, filter_id?: number, updated_since?: string, sort?: 'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time', ): Promise<RequestArgs> => {
const localVarPath = `/leads`;
// 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 @@ -336,6 +337,10 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration
localVarQueryParameter['filter_id'] = filter_id;
}

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

if (sort !== undefined) {
localVarQueryParameter['sort'] = sort;
}
Expand Down Expand Up @@ -556,12 +561,13 @@ export const LeadsApiFp = function(configuration?: Configuration) {
* @param {number} [person_id] If supplied, only leads matching the given person will be returned. However, &#x60;filter_id&#x60; takes precedence over &#x60;person_id&#x60; when supplied.
* @param {number} [organization_id] If supplied, only leads matching the given organization will be returned. However, &#x60;filter_id&#x60; takes precedence over &#x60;organization_id&#x60; when supplied.
* @param {number} [filter_id] The ID of the filter to use
* @param {string} [updated_since] If set, only leads with an &#x60;update_time&#x60; later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z.
* @param {'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'} [sort] The field names and sorting mode separated by a comma (&#x60;field_name_1 ASC&#x60;, &#x60;field_name_2 DESC&#x60;). Only first-level field keys are supported (no nested keys).

* @throws {RequiredError}
*/
async getLeads(limit?: number, start?: number, owner_id?: number, person_id?: number, organization_id?: number, filter_id?: number, sort?: 'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time', ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetLeadsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getLeads(limit, start, owner_id, person_id, organization_id, filter_id, sort, );
async getLeads(limit?: number, start?: number, owner_id?: number, person_id?: number, organization_id?: number, filter_id?: number, updated_since?: string, sort?: 'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time', ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetLeadsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getLeads(limit, start, owner_id, person_id, organization_id, filter_id, updated_since, sort, );
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
Expand Down Expand Up @@ -662,7 +668,7 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath
* @throws {RequiredError}
*/
getLeads(requestParameters: LeadsApiGetLeadsRequest = {}, ): Promise<GetLeadsResponse> {
return localVarFp.getLeads(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.sort, ).then((request) => request(axios, basePath));
return localVarFp.getLeads(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.updated_since, requestParameters.sort, ).then((request) => request(axios, basePath));
},
/**
* 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.
Expand Down Expand Up @@ -847,6 +853,13 @@ export interface LeadsApiGetLeadsRequest {
*/
readonly filter_id?: number

/**
* If set, only leads with an &#x60;update_time&#x60; later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z.
* @type {string}
* @memberof LeadsApiGetLeads
*/
readonly updated_since?: string

/**
* The field names and sorting mode separated by a comma (&#x60;field_name_1 ASC&#x60;, &#x60;field_name_2 DESC&#x60;). Only first-level field keys are supported (no nested keys).
* @type {'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'}
Expand Down Expand Up @@ -1015,7 +1028,7 @@ export class LeadsApi extends BaseAPI {
* @memberof LeadsApi
*/
public getLeads(requestParameters: LeadsApiGetLeadsRequest = {}, ) {
return LeadsApiFp(this.configuration).getLeads(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.sort, ).then((request) => request(this.axios, this.basePath));
return LeadsApiFp(this.configuration).getLeads(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.updated_since, requestParameters.sort, ).then((request) => request(this.axios, this.basePath));
}

/**
Expand Down
25 changes: 20 additions & 5 deletions src/versions/v1/api/notes-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ export const NotesApiAxiosParamCreator = function (configuration?: Configuration
* @param {string} [sort] The field names and sorting mode separated by a comma (&#x60;field_name_1 ASC&#x60;, &#x60;field_name_2 DESC&#x60;). Only first-level field keys are supported (no nested keys). Supported fields: &#x60;id&#x60;, &#x60;user_id&#x60;, &#x60;deal_id&#x60;, &#x60;person_id&#x60;, &#x60;org_id&#x60;, &#x60;content&#x60;, &#x60;add_time&#x60;, &#x60;update_time&#x60;.
* @param {string} [start_date] The date in format of YYYY-MM-DD from which notes to fetch
* @param {string} [end_date] The date in format of YYYY-MM-DD until which notes to fetch to
* @param {string} [updated_since] If set, only notes 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 {0 | 1} [pinned_to_lead_flag] If set, the results are filtered by note to lead pinning state
* @param {0 | 1} [pinned_to_deal_flag] If set, the results are filtered by note to deal pinning state
* @param {0 | 1} [pinned_to_organization_flag] If set, the results are filtered by note to organization pinning state
Expand All @@ -376,7 +377,7 @@ export const NotesApiAxiosParamCreator = function (configuration?: Configuration

* @throws {RequiredError}
*/
getNotes: async (user_id?: number, lead_id?: string, deal_id?: number, person_id?: number, org_id?: number, project_id?: number, start?: number, limit?: number, sort?: string, start_date?: string, end_date?: string, pinned_to_lead_flag?: 0 | 1, pinned_to_deal_flag?: 0 | 1, pinned_to_organization_flag?: 0 | 1, pinned_to_person_flag?: 0 | 1, pinned_to_project_flag?: 0 | 1, ): Promise<RequestArgs> => {
getNotes: async (user_id?: number, lead_id?: string, deal_id?: number, person_id?: number, org_id?: number, project_id?: number, start?: number, limit?: number, sort?: string, start_date?: string, end_date?: string, updated_since?: string, pinned_to_lead_flag?: 0 | 1, pinned_to_deal_flag?: 0 | 1, pinned_to_organization_flag?: 0 | 1, pinned_to_person_flag?: 0 | 1, pinned_to_project_flag?: 0 | 1, ): Promise<RequestArgs> => {
const localVarPath = `/notes`;
// 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 @@ -444,6 +445,12 @@ export const NotesApiAxiosParamCreator = function (configuration?: Configuration
end_date;
}

if (updated_since !== undefined) {
localVarQueryParameter['updated_since'] = (updated_since as any instanceof Date) ?
(updated_since as any).toISOString() :
updated_since;
}

if (pinned_to_lead_flag !== undefined) {
localVarQueryParameter['pinned_to_lead_flag'] = pinned_to_lead_flag;
}
Expand Down Expand Up @@ -676,6 +683,7 @@ export const NotesApiFp = function(configuration?: Configuration) {
* @param {string} [sort] The field names and sorting mode separated by a comma (&#x60;field_name_1 ASC&#x60;, &#x60;field_name_2 DESC&#x60;). Only first-level field keys are supported (no nested keys). Supported fields: &#x60;id&#x60;, &#x60;user_id&#x60;, &#x60;deal_id&#x60;, &#x60;person_id&#x60;, &#x60;org_id&#x60;, &#x60;content&#x60;, &#x60;add_time&#x60;, &#x60;update_time&#x60;.
* @param {string} [start_date] The date in format of YYYY-MM-DD from which notes to fetch
* @param {string} [end_date] The date in format of YYYY-MM-DD until which notes to fetch to
* @param {string} [updated_since] If set, only notes 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 {0 | 1} [pinned_to_lead_flag] If set, the results are filtered by note to lead pinning state
* @param {0 | 1} [pinned_to_deal_flag] If set, the results are filtered by note to deal pinning state
* @param {0 | 1} [pinned_to_organization_flag] If set, the results are filtered by note to organization pinning state
Expand All @@ -684,8 +692,8 @@ export const NotesApiFp = function(configuration?: Configuration) {

* @throws {RequiredError}
*/
async getNotes(user_id?: number, lead_id?: string, deal_id?: number, person_id?: number, org_id?: number, project_id?: number, start?: number, limit?: number, sort?: string, start_date?: string, end_date?: string, pinned_to_lead_flag?: 0 | 1, pinned_to_deal_flag?: 0 | 1, pinned_to_organization_flag?: 0 | 1, pinned_to_person_flag?: 0 | 1, pinned_to_project_flag?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetNotesResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getNotes(user_id, lead_id, deal_id, person_id, org_id, project_id, start, limit, sort, start_date, end_date, pinned_to_lead_flag, pinned_to_deal_flag, pinned_to_organization_flag, pinned_to_person_flag, pinned_to_project_flag, );
async getNotes(user_id?: number, lead_id?: string, deal_id?: number, person_id?: number, org_id?: number, project_id?: number, start?: number, limit?: number, sort?: string, start_date?: string, end_date?: string, updated_since?: string, pinned_to_lead_flag?: 0 | 1, pinned_to_deal_flag?: 0 | 1, pinned_to_organization_flag?: 0 | 1, pinned_to_person_flag?: 0 | 1, pinned_to_project_flag?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetNotesResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getNotes(user_id, lead_id, deal_id, person_id, org_id, project_id, start, limit, sort, start_date, end_date, updated_since, pinned_to_lead_flag, pinned_to_deal_flag, pinned_to_organization_flag, pinned_to_person_flag, pinned_to_project_flag, );
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
Expand Down Expand Up @@ -801,7 +809,7 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath
* @throws {RequiredError}
*/
getNotes(requestParameters: NotesApiGetNotesRequest = {}, ): Promise<GetNotesResponse> {
return localVarFp.getNotes(requestParameters.user_id, requestParameters.lead_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.project_id, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.start_date, requestParameters.end_date, requestParameters.pinned_to_lead_flag, requestParameters.pinned_to_deal_flag, requestParameters.pinned_to_organization_flag, requestParameters.pinned_to_person_flag, requestParameters.pinned_to_project_flag, ).then((request) => request(axios, basePath));
return localVarFp.getNotes(requestParameters.user_id, requestParameters.lead_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.project_id, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.start_date, requestParameters.end_date, requestParameters.updated_since, requestParameters.pinned_to_lead_flag, requestParameters.pinned_to_deal_flag, requestParameters.pinned_to_organization_flag, requestParameters.pinned_to_person_flag, requestParameters.pinned_to_project_flag, ).then((request) => request(axios, basePath));
},
/**
* Updates a comment related to a note.
Expand Down Expand Up @@ -1042,6 +1050,13 @@ export interface NotesApiGetNotesRequest {
*/
readonly end_date?: string

/**
* If set, only notes 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}
* @memberof NotesApiGetNotes
*/
readonly updated_since?: string

/**
* If set, the results are filtered by note to lead pinning state
* @type {0 | 1}
Expand Down Expand Up @@ -1227,7 +1242,7 @@ export class NotesApi extends BaseAPI {
* @memberof NotesApi
*/
public getNotes(requestParameters: NotesApiGetNotesRequest = {}, ) {
return NotesApiFp(this.configuration).getNotes(requestParameters.user_id, requestParameters.lead_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.project_id, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.start_date, requestParameters.end_date, requestParameters.pinned_to_lead_flag, requestParameters.pinned_to_deal_flag, requestParameters.pinned_to_organization_flag, requestParameters.pinned_to_person_flag, requestParameters.pinned_to_project_flag, ).then((request) => request(this.axios, this.basePath));
return NotesApiFp(this.configuration).getNotes(requestParameters.user_id, requestParameters.lead_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.project_id, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.start_date, requestParameters.end_date, requestParameters.updated_since, requestParameters.pinned_to_lead_flag, requestParameters.pinned_to_deal_flag, requestParameters.pinned_to_organization_flag, requestParameters.pinned_to_person_flag, requestParameters.pinned_to_project_flag, ).then((request) => request(this.axios, this.basePath));
}

/**
Expand Down
Loading