Skip to content
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `DELETE /v1/stages`
Please use the single delete endpoints instead, for example `DELETE /api/v2/activities/{id}`.

### 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`

## [15.1.0](https://github.com/pipedrive/client-php/compare/15.0.0...15.1.0) (2026-01-27)

## [15.0.0](https://github.com/pipedrive/client-php/compare/14.9.0...15.0.0) (2026-01-27)

## [14.9.0](https://github.com/pipedrive/client-php/compare/14.8.0...14.9.0) (2026-01-27)
Expand Down
6 changes: 4 additions & 2 deletions docs/versions/v1/Api/LeadsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ Name | Type | Description | Notes
## `getLeads()`

```php
getLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort): \Pipedrive\versions\v1\Model\GetLeadsResponse
getLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort): \Pipedrive\versions\v1\Model\GetLeadsResponse
```

Get all leads
Expand Down Expand Up @@ -389,10 +389,11 @@ $owner_id = 1; // int | If supplied, only leads matching the given user will be
$person_id = 1; // int | If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied.
$organization_id = 1; // int | If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied.
$filter_id = 1; // int | The ID of the filter to use
$updated_since = 2025-01-01T10:20:00Z; // string | 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.
$sort = 'sort_example'; // string | 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).

try {
$result = $apiInstance->getLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort);
$result = $apiInstance->getLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LeadsApi->getLeads: ', $e->getMessage(), PHP_EOL;
Expand All @@ -409,6 +410,7 @@ Name | Type | Description | Notes
**person_id** | **int**| If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. | [optional]
**organization_id** | **int**| If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. | [optional]
**filter_id** | **int**| The ID of the filter to use | [optional]
**updated_since** | **string**| 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. | [optional]
**sort** | **string**| 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). | [optional]

### Return type
Expand Down
6 changes: 4 additions & 2 deletions docs/versions/v1/Api/NotesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ Name | Type | Description | Notes
## `getNotes()`

```php
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): \Pipedrive\versions\v1\Model\GetNotes
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): \Pipedrive\versions\v1\Model\GetNotes
```

Get all notes
Expand Down Expand Up @@ -524,14 +524,15 @@ $limit = 56; // int | Items shown per page
$sort = 'sort_example'; // string | 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`.
$start_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The date in format of YYYY-MM-DD from which notes to fetch
$end_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The date in format of YYYY-MM-DD until which notes to fetch to
$updated_since = 2025-01-01T10:20Z; // \DateTime | If set, only notes with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
$pinned_to_lead_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to lead pinning state
$pinned_to_deal_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to deal pinning state
$pinned_to_organization_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to organization pinning state
$pinned_to_person_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to person pinning state
$pinned_to_project_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to project pinning state

try {
$result = $apiInstance->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);
$result = $apiInstance->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);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling NotesApi->getNotes: ', $e->getMessage(), PHP_EOL;
Expand All @@ -553,6 +554,7 @@ Name | Type | Description | Notes
**sort** | **string**| 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`. | [optional]
**start_date** | **\DateTime**| The date in format of YYYY-MM-DD from which notes to fetch | [optional]
**end_date** | **\DateTime**| The date in format of YYYY-MM-DD until which notes to fetch to | [optional]
**updated_since** | **\DateTime**| If set, only notes with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. | [optional]
**pinned_to_lead_flag** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to lead pinning state | [optional]
**pinned_to_deal_flag** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to deal pinning state | [optional]
**pinned_to_organization_flag** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to organization pinning state | [optional]
Expand Down
33 changes: 23 additions & 10 deletions lib/versions/v1/Api/LeadsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -1717,15 +1717,16 @@ public function getLeadUsersRequest($id): Request
* @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional)
* @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional)
* @param int|null $filter_id The ID of the filter to use (optional)
* @param string|null $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. (optional)
* @param string|null $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). (optional)
*
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return \Pipedrive\versions\v1\Model\GetLeadsResponse
*/
public function getLeads($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null)
public function getLeads($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $updated_since = null, $sort = null)
{
list($response) = $this->getLeadsWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort);
list($response) = $this->getLeadsWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort);
return $response;
}

Expand All @@ -1740,15 +1741,16 @@ public function getLeads($limit = null, $start = null, $owner_id = null, $person
* @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional)
* @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional)
* @param int|null $filter_id The ID of the filter to use (optional)
* @param string|null $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. (optional)
* @param string|null $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). (optional)
*
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return array<mixed> of \Pipedrive\versions\v1\Model\GetLeadsResponse, HTTP status code, HTTP response headers (array of strings)
*/
public function getLeadsWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null)
public function getLeadsWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $updated_since = null, $sort = null)
{
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort);
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort);

try {
$options = $this->createHttpClientOption();
Expand All @@ -1757,7 +1759,7 @@ public function getLeadsWithHttpInfo($limit = null, $start = null, $owner_id = n
} catch (RequestException $e) {
if ($e->getCode() === 401 && $this->config->isRefreshPossible()) {
$this->config->refreshToken();
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort);
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort);
$response = $this->client->send($request, $options);
} else {
throw new ApiException(
Expand Down Expand Up @@ -1847,14 +1849,15 @@ public function getLeadsWithHttpInfo($limit = null, $start = null, $owner_id = n
* @param int|null $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. (optional)
* @param int|null $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. (optional)
* @param int|null $filter_id The ID of the filter to use (optional)
* @param string|null $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. (optional)
* @param string|null $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). (optional)
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
*/
public function getLeadsAsync($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface
public function getLeadsAsync($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $updated_since = null, $sort = null): PromiseInterface
{
return $this->getLeadsAsyncWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort)
return $this->getLeadsAsyncWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort)
->then(
function ($response) {
return $response[0];
Expand All @@ -1873,15 +1876,16 @@ function ($response) {
* @param int|null $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. (optional)
* @param int|null $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. (optional)
* @param int|null $filter_id The ID of the filter to use (optional)
* @param string|null $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. (optional)
* @param string|null $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). (optional)
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
*/
public function getLeadsAsyncWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface
public function getLeadsAsyncWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $updated_since = null, $sort = null): PromiseInterface
{
$returnType = '\Pipedrive\versions\v1\Model\GetLeadsResponse';
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort);
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -1926,12 +1930,13 @@ function ($exception) {
* @param int|null $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. (optional)
* @param int|null $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. (optional)
* @param int|null $filter_id The ID of the filter to use (optional)
* @param string|null $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. (optional)
* @param string|null $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). (optional)
*
* @throws InvalidArgumentException|OAuthProviderException
* @return Request
*/
public function getLeadsRequest($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): Request
public function getLeadsRequest($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $updated_since = null, $sort = null): Request
{

$resourcePath = '/leads';
Expand Down Expand Up @@ -1991,6 +1996,14 @@ public function getLeadsRequest($limit = null, $start = null, $owner_id = null,
}
// query params
/* @phpstan-ignore-next-line */
if (is_array($updated_since)) {
$updated_since = ObjectSerializer::serializeCollection($updated_since, '', true);
}
if ($updated_since !== null) {
$queryParams['updated_since'] = $updated_since;
}
// query params
/* @phpstan-ignore-next-line */
if (is_array($sort)) {
$sort = ObjectSerializer::serializeCollection($sort, '', true);
}
Expand Down
Loading