> For a complete page index, fetch https://developer.close.com/llms.txt # Get lead status change report GET https://api.close.com/api/v1/report/statuses/lead/{org_id}/ Get a lead status change report. The date range is optional. A report may be requested for a specific time period or overall. You can specify either a `query` or `smart_view_id` (but not both) to filter leads included in the report. The following fields are returned (when requesting an overall report, some inapplicable fields will not be returned): * `status_overview`: A list of all statuses with: * `status_id`, `status_label`, `status_is_deleted`: The ID and label of the status, and whether it was deleted. * `started`: Number of leads in this status at the start of the period. * `ended`: Number in this status at the end. * `change`: Net change during the period (`ended` minus `started`). * `change_percent`: Net change in percent. * `gained`: Number that were not in this status at the beginning but were at the end. * `lost`: Number that were in this status at the beginning but were not at the end. * `entered`: Number that entered this status at some point during the period. * `left`: Number that left this status at some point during the period. * `_queries`: A dictionary containing search queries for the different states (`started`, `ended`, `gained`, `lost`, `entered`, `left`). * `_leads_page_urls`: A dictionary containing paths to the lead search UI page. * `status_transitions`: A list of all status transitions (aggregated by start/end status) for the given period with: * `from_status_id`, `from_status_label`, `from_status_is_deleted`: Starting status (null for created leads). * `to_status_id`, `to_status_label`, `to_status_is_deleted`: Ending status. * `count`: The number that transitioned. * `_query`: The search query for those records. * `_leads_page_url`: Path to the search UI page. * `status_transitions_summary`: Status transitions summarized for the period. E.g. a lead that went A→B→C is counted as A→C. Reference: https://developer.close.com/api/resources/reporting/get-lead-statuses ## Authentication - `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty. - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `org_id` (string, required) ### Query parameters - `date_start` (string, optional) - `date_end` (string, optional) - `query` (string, optional) - `smart_view_id` (string, optional) ## Response ### 200 Successful response ## Errors ### 400 Bad Request Error Bad request - `any` ### 401 Unauthorized Error Unauthorized - `any` ### 404 Not Found Error Not found - `any` ## Examples **Response** ```json { "status_overview": [ { "_leads_page_urls": { "ended": "/search/lead_status%28status%3A%22Potential%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "entered": "/search/%28original_lead_status%3A%22Potential%22%20and%20created%20%3E%3D%20%222014-01-01%2008%3A00%3A00%22%20and%20created%20%3C%3D%20%222014-06-01%2006%3A59%3A59%22%29%20or%20lead_status_change%28new_status%3A%22Potential%22%20and%20date%20%3E%3D%20%222014-01-01%2008%3A00%3A00%22%20and%20date%20%3C%3D%20%222014-06-01%2006%3A59%3A59%22%29/", "gained": "/search/not%20lead_status%28status%3A%22Potential%22%20on%3A%222014-01-01%2008%3A00%3A00%22%29%20and%20lead_status%28status%3A%22Potential%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "left": "/search/lead_status_change%28old_status%3A%22Potential%22%20and%20date%20%3E%3D%20%222014-01-01%2008%3A00%3A00%22%20and%20date%20%3C%3D%20%222014-06-01%2006%3A59%3A59%22%29/", "lost": "/search/lead_status%28status%3A%22Potential%22%20on%3A%222014-01-01%2008%3A00%3A00%22%29%20and%20not%20lead_status%28status%3A%22Potential%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "started": "/search/lead_status%28status%3A%22Potential%22%20on%3A%222014-01-01%2008%3A00%3A00%22%29/" }, "_queries": { "ended": "lead_status(status:\"Potential\" on:\"2014-06-01 06:59:59\")", "entered": "(original_lead_status:\"Potential\" and created >= \"2014-01-01 08:00:00\" and created <= \"2014-06-01 06:59:59\") or lead_status_change(new_status:\"Potential\" and date >= \"2014-01-01 08:00:00\" and date <= \"2014-06-01 06:59:59\")", "gained": "not lead_status(status:\"Potential\" on:\"2014-01-01 08:00:00\") and lead_status(status:\"Potential\" on:\"2014-06-01 06:59:59\")", "left": "lead_status_change(old_status:\"Potential\" and date >= \"2014-01-01 08:00:00\" and date <= \"2014-06-01 06:59:59\")", "lost": "lead_status(status:\"Potential\" on:\"2014-01-01 08:00:00\") and not lead_status(status:\"Potential\" on:\"2014-06-01 06:59:59\")", "started": "lead_status(status:\"Potential\" on:\"2014-01-01 08:00:00\")" }, "change": 1268, "change_percent": 3, "ended": 49997, "entered": 1270, "gained": 1269, "left": 2, "lost": 1, "started": 48729, "status_id": "stat_a2RZn3jTsAA11zmBPpqQQ4ug8NqgUawkjyMdCu8yybX", "status_is_deleted": false, "status_label": "Potential" }, { "_leads_page_urls": { "ended": "/search/lead_status%28status%3A%22Bad%20Fit%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "entered": "/search/%28original_lead_status%3A%22Bad%20Fit%22%20and%20created%20%3E%3D%20%222014-01-01%2008%3A00%3A00%22%20and%20created%20%3C%3D%20%222014-06-01%2006%3A59%3A59%22%29%20or%20lead_status_change%28new_status%3A%22Bad%20Fit%22%20and%20date%20%3E%3D%20%222014-01-01%2008%3A00%3A00%22%20and%20date%20%3C%3D%20%222014-06-01%2006%3A59%3A59%22%29/", "gained": "/search/not%20lead_status%28status%3A%22Bad%20Fit%22%20on%3A%222014-01-01%2008%3A00%3A00%22%29%20and%20lead_status%28status%3A%22Bad%20Fit%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "left": "/search/lead_status_change%28old_status%3A%22Bad%20Fit%22%20and%20date%20%3E%3D%20%222014-01-01%2008%3A00%3A00%22%20and%20date%20%3C%3D%20%222014-06-01%2006%3A59%3A59%22%29/", "lost": "/search/lead_status%28status%3A%22Bad%20Fit%22%20on%3A%222014-01-01%2008%3A00%3A00%22%29%20and%20not%20lead_status%28status%3A%22Bad%20Fit%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "started": "/search/lead_status%28status%3A%22Bad%20Fit%22%20on%3A%222014-01-01%2008%3A00%3A00%22%29/" }, "_queries": { "ended": "lead_status(status:\"Bad Fit\" on:\"2014-06-01 06:59:59\")", "entered": "(original_lead_status:\"Bad Fit\" and created >= \"2014-01-01 08:00:00\" and created <= \"2014-06-01 06:59:59\") or lead_status_change(new_status:\"Bad Fit\" and date >= \"2014-01-01 08:00:00\" and date <= \"2014-06-01 06:59:59\")", "gained": "not lead_status(status:\"Bad Fit\" on:\"2014-01-01 08:00:00\") and lead_status(status:\"Bad Fit\" on:\"2014-06-01 06:59:59\")", "left": "lead_status_change(old_status:\"Bad Fit\" and date >= \"2014-01-01 08:00:00\" and date <= \"2014-06-01 06:59:59\")", "lost": "lead_status(status:\"Bad Fit\" on:\"2014-01-01 08:00:00\") and not lead_status(status:\"Bad Fit\" on:\"2014-06-01 06:59:59\")", "started": "lead_status(status:\"Bad Fit\" on:\"2014-01-01 08:00:00\")" }, "change": 0, "change_percent": 0, "ended": 35, "entered": 0, "gained": 0, "left": 0, "lost": 0, "started": 35, "status_id": "stat_7a4mksScaP453DJeur2wdn8qXg3zcN3IQbbDeFZywNw", "status_is_deleted": false, "status_label": "Bad Fit" }, { "_leads_page_urls": { "ended": "/search/lead_status%28status%3A%22Qualified%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "entered": "/search/%28original_lead_status%3A%22Qualified%22%20and%20created%20%3E%3D%20%222014-01-01%2008%3A00%3A00%22%20and%20created%20%3C%3D%20%222014-06-01%2006%3A59%3A59%22%29%20or%20lead_status_change%28new_status%3A%22Qualified%22%20and%20date%20%3E%3D%20%222014-01-01%2008%3A00%3A00%22%20and%20date%20%3C%3D%20%222014-06-01%2006%3A59%3A59%22%29/", "gained": "/search/not%20lead_status%28status%3A%22Qualified%22%20on%3A%222014-01-01%2008%3A00%3A00%22%29%20and%20lead_status%28status%3A%22Qualified%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "left": "/search/lead_status_change%28old_status%3A%22Qualified%22%20and%20date%20%3E%3D%20%222014-01-01%2008%3A00%3A00%22%20and%20date%20%3C%3D%20%222014-06-01%2006%3A59%3A59%22%29/", "lost": "/search/lead_status%28status%3A%22Qualified%22%20on%3A%222014-01-01%2008%3A00%3A00%22%29%20and%20not%20lead_status%28status%3A%22Qualified%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "started": "/search/lead_status%28status%3A%22Qualified%22%20on%3A%222014-01-01%2008%3A00%3A00%22%29/" }, "_queries": { "ended": "lead_status(status:\"Qualified\" on:\"2014-06-01 06:59:59\")", "entered": "(original_lead_status:\"Qualified\" and created >= \"2014-01-01 08:00:00\" and created <= \"2014-06-01 06:59:59\") or lead_status_change(new_status:\"Qualified\" and date >= \"2014-01-01 08:00:00\" and date <= \"2014-06-01 06:59:59\")", "gained": "not lead_status(status:\"Qualified\" on:\"2014-01-01 08:00:00\") and lead_status(status:\"Qualified\" on:\"2014-06-01 06:59:59\")", "left": "lead_status_change(old_status:\"Qualified\" and date >= \"2014-01-01 08:00:00\" and date <= \"2014-06-01 06:59:59\")", "lost": "lead_status(status:\"Qualified\" on:\"2014-01-01 08:00:00\") and not lead_status(status:\"Qualified\" on:\"2014-06-01 06:59:59\")", "started": "lead_status(status:\"Qualified\" on:\"2014-01-01 08:00:00\")" }, "change": 2, "change_percent": 8, "ended": 28, "entered": 2, "gained": 2, "left": 0, "lost": 0, "started": 26, "status_id": "stat_eQ5KZbBVePlxF7sUdiV7s0mDNBkUxGv7k4i0c7XsoqL", "status_is_deleted": false, "status_label": "Qualified" } ], "status_transitions": [ { "_leads_page_url": "/search/original_lead_status%3A%22Potential%22%20and%20created%20%3E%3D%20%222014-01-01%2008%3A00%3A00%22%20and%20created%20%3C%3D%20%222014-06-01%2006%3A59%3A59%22/", "_query": "original_lead_status:\"Potential\" and created >= \"2014-01-01 08:00:00\" and created <= \"2014-06-01 06:59:59\"", "count": 1270, "from_status_id": null, "from_status_is_deleted": null, "from_status_label": null, "to_status_id": "stat_a2RZn3jTsAA11zmBPpqQQ4ug8NqgUawkjyMdCu8yybX", "to_status_is_deleted": false, "to_status_label": "Potential" }, { "_leads_page_url": "/search/lead_status_change%28old_status%3A%22Potential%22%20new_status%3A%22Qualified%22%20and%20date%20%3E%3D%20%222014-01-01%2008%3A00%3A00%22%20and%20date%20%3C%3D%20%222014-06-01%2006%3A59%3A59%22%29/", "_query": "lead_status_change(old_status:\"Potential\" new_status:\"Qualified\" and date >= \"2014-01-01 08:00:00\" and date <= \"2014-06-01 06:59:59\")", "count": 2, "from_status_id": "stat_a2RZn3jTsAA11zmBPpqQQ4ug8NqgUawkjyMdCu8yybX", "from_status_is_deleted": false, "from_status_label": "Potential", "to_status_id": "stat_eQ5KZbBVePlxF7sUdiV7s0mDNBkUxGv7k4i0c7XsoqL", "to_status_is_deleted": false, "to_status_label": "Qualified" } ], "status_transitions_summary": [ { "_leads_page_url": "/search/created%20%3E%20%222014-01-01%2008%3A00%3A00%22%20and%20lead_status%28status%3A%22Potential%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "_query": "created > \"2014-01-01 08:00:00\" and lead_status(status:\"Potential\" on:\"2014-06-01 06:59:59\")", "count": 1269, "from_status_id": null, "from_status_is_deleted": null, "from_status_label": null, "to_status_id": "stat_a2RZn3jTsAA11zmBPpqQQ4ug8NqgUawkjyMdCu8yybX", "to_status_is_deleted": false, "to_status_label": "Potential" }, { "_leads_page_url": "/search/created%20%3E%20%222014-01-01%2008%3A00%3A00%22%20and%20lead_status%28status%3A%22Qualified%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "_query": "created > \"2014-01-01 08:00:00\" and lead_status(status:\"Qualified\" on:\"2014-06-01 06:59:59\")", "count": 1, "from_status_id": null, "from_status_is_deleted": null, "from_status_label": null, "to_status_id": "stat_eQ5KZbBVePlxF7sUdiV7s0mDNBkUxGv7k4i0c7XsoqL", "to_status_is_deleted": false, "to_status_label": "Qualified" }, { "_leads_page_url": "/search/lead_status%28status%3A%22Potential%22%20on%3A%222014-01-01%2008%3A00%3A00%22%29%20and%20lead_status%28status%3A%22Qualified%22%20on%3A%222014-06-01%2006%3A59%3A59%22%29/", "_query": "lead_status(status:\"Potential\" on:\"2014-01-01 08:00:00\") and lead_status(status:\"Qualified\" on:\"2014-06-01 06:59:59\")", "count": 1, "from_status_id": "stat_a2RZn3jTsAA11zmBPpqQQ4ug8NqgUawkjyMdCu8yybX", "from_status_is_deleted": false, "from_status_label": "Potential", "to_status_id": "stat_eQ5KZbBVePlxF7sUdiV7s0mDNBkUxGv7k4i0c7XsoqL", "to_status_is_deleted": false, "to_status_label": "Qualified" } ] } ``` **SDK Code** ```python reporting_getLeadStatuses_example import requests url = "https://api.close.com/api/v1/report/statuses/lead/org_id/" response = requests.get(url, auth=("", "")) print(response.json()) ``` ```javascript reporting_getLeadStatuses_example const url = 'https://api.close.com/api/v1/report/statuses/lead/org_id/'; const credentials = btoa(":"); const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go reporting_getLeadStatuses_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.close.com/api/v1/report/statuses/lead/org_id/" req, _ := http.NewRequest("GET", url, nil) req.SetBasicAuth("", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby reporting_getLeadStatuses_example require 'uri' require 'net/http' url = URI("https://api.close.com/api/v1/report/statuses/lead/org_id/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request.basic_auth("", "") response = http.request(request) puts response.read_body ``` ```java reporting_getLeadStatuses_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.close.com/api/v1/report/statuses/lead/org_id/") .basicAuth("", "") .asString(); ``` ```php reporting_getLeadStatuses_example request('GET', 'https://api.close.com/api/v1/report/statuses/lead/org_id/', [ 'headers' => [ ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp reporting_getLeadStatuses_example using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://api.close.com/api/v1/report/statuses/lead/org_id/"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ```