> 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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Close API
  version: 1.0.0
paths:
  /report/statuses/lead/{org_id}/:
    get:
      operationId: get-lead-statuses
      summary: Get lead status change report
      description: |-
        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.
      tags:
        - subpackage_reporting
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
        - name: date_start
          in: query
          required: false
          schema:
            type: string
        - name: date_end
          in: query
          required: false
          schema:
            type: string
        - name: query
          in: query
          required: false
          schema:
            type: string
        - name: smart_view_id
          in: query
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: Use your API key as the username and leave the password empty.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/reporting_getLeadStatuses_Response_200'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                description: Any type
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Not found
          content:
            application/json:
              schema:
                description: Any type
servers:
  - url: https://api.close.com/api/v1
components:
  schemas:
    reporting_getLeadStatuses_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: reporting_getLeadStatuses_Response_200
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: basic
      description: Use your API key as the username and leave the password empty.
    OAuth2:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python reporting_getLeadStatuses_example
import requests

url = "https://api.close.com/api/v1/report/statuses/lead/org_id/"

response = requests.get(url, auth=("<CLOSE_API_KEY>", ""))

print(response.json())
```

```javascript reporting_getLeadStatuses_example
const url = 'https://api.close.com/api/v1/report/statuses/lead/org_id/';
const credentials = btoa("<CLOSE_API_KEY>:");

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("<CLOSE_API_KEY>", "")

	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("<CLOSE_API_KEY>", "")

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<String> response = Unirest.get("https://api.close.com/api/v1/report/statuses/lead/org_id/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .asString();
```

```php reporting_getLeadStatuses_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.close.com/api/v1/report/statuses/lead/org_id/', [
  'headers' => [
  ],
    'auth' => ['<CLOSE_API_KEY>', ''],
]);

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("<CLOSE_API_KEY>", "");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```