GET/ deals-by-id/ :custom_id/ stage-changes/
Get deal stage changes by id
You can return deal stage changes by using a deal custom_id.
Attribute
Optional unless marked required
- custom_id
- The unique identifier for the deal which is provided by the client.
| Lookup | Description | Example usage |
|---|---|---|
| count_from | A date from when stats should be counted | ?count_from=2021-05-16 |
| count_to | A date utill stats should be counted | ?count_from=2022-05-16 |
Request
- cURL
- JavaScript
- PHP
- Python
curl -X GET "https://<your_app_subdomain>.user.com/api/public/deals-by-id/:custom_id/stage-changes/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/deals-by-id/:custom_id/stage-changes/",
{
method: "GET",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
},
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/deals-by-id/:custom_id/stage-changes/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.get(
"https://<your_app_subdomain>.user.com/api/public/deals-by-id/:custom_id/stage-changes/",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
)
print(response.json())
Response examples
- 200 OK
- 404 Not Found
{"count": 3,"next": null,"previous": null,"results": [{"id": 4,"deal": "Deal_56234","changed_by": null,"stage_name": "Negotiations","entered_at": "2024-04-19T12:01:37.084481Z","left_at": null,"stage": 5},{"id": 3,"deal": "Deal_56234","changed_by": "John Doe","stage_name": "Demo scheduled","entered_at": "2024-04-19T12:01:35.449037Z","left_at": "2024-04-19T12:01:37.084481Z","stage": 3},{"id": 2,"deal": "Deal_56234","changed_by": "John Doe","stage_name": "Contact made","entered_at": "2024-04-19T12:01:34.200751Z","left_at": "2024-04-19T12:01:35.449037Z","stage": 2}]}{
"detail": "Not found."
}
Response fields
Fields returned in the 200 OK response body.
- count
- Number of results across all pages. It can lag behind recent changes; see Response pagination.
- next
- URL of the next page of results. null on the last page.
- previous
- URL of the previous page of results. null on the first page.
- results
- Results on this page.
- results[].
id - A unique identifier for the deal which is given by User automatically.
- results[].
deal - Name of the deal whose stage changed.
- results[].
changed_by - Name of the agent who moved the deal out of this stage in the panel;
nullwhile the deal is still in the stage, or when the API or an automation moved it. - results[].
stage_name - Name of the stage the deal entered.
- results[].
entered_at - When the deal entered the stage, ISO 8601.
- results[].
left_at - When the deal left the stage, ISO 8601.
nullwhile the deal is still in it. - results[].
stage - An id of a stage of the pipeline the deal is currently at.
- results[].
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.