---
title: Read Active Identity Counts by License
description: "The GET /organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts operation returns the number of active users per license for a specified time period. The time period and grouping of results is derived from two query parameters: aggregatedBy and limit. All results start on the first day of the license period."
component: pingone-api
page_id: pingone-api:platform:active-identity-counts/read-active-identity-counts-by-license
canonical_url: https://developer.pingidentity.com/pingone-api/platform/active-identity-counts/read-active-identity-counts-by-license.html
section_ids:
  path-parameters: Path Parameters
  response-codes: Response codes
  headers: Headers
  example-request: Example Request
  example-response: Example Response
---

# Read Active Identity Counts by License

##

```none
GET {{apiPath}}/v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate
```

The `GET /organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts` operation returns the number of active users per license for a specified time period. The time period and grouping of results is derived from two query parameters: `aggregatedBy` and `limit`. All results start on the first day of the license period.

|   |                                                                                                                                                                                |
| - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|   | Currently, the active identity count does not return product-specific counts (such as, for PingOne SSO, MFA, or Protect), nor does it count active users when DaVinci is used. |

The `aggregatedBy` query parameter is required. If `aggregatedBy` = `licenseYear`, the request returns the number of active users grouped by year. If `aggregatedBy` = `calendarMonth`, the request returns the number of active users grouped by month.

The number of groupings returned is determined by the `limit` query parameter. For example, if the license period started on January 1, 2020, `aggregatedBy` = `calendarMonth`, and `limit` = 2, the results would include two groups. The first group would be for the number of active users January 1, 2020 to January 31, 2020. The second group would be for the number of active users February 1, 2020 to February 29, 2020. If the number of groupings surpasses the current date, the last (or first, depending on the sort order) grouping ends on the current date.

### Path Parameters

| Parameter   | Type   | Required? | Description |                                                                                                            |
| ----------- | ------ | --------- | ----------- | ---------------------------------------------------------------------------------------------------------- |
| `orgID`     | String | Required  | Immutable   | The specific organization the client is interested in.                                                     |
| `licenseID` | String | Required  | Immutable   | The specific license for which the client wants the number of annual active users or monthly active users. |

> **Collapse: Query parameters**
>
> | Parameter      | Description                                                                                                                                                                                                               |
> | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
> | `aggregatedBy` | **Required**. Possible values are `licenseYear` and `calendarMonth`. If `licenseYear`, the request returns the number of annual active users. If `calendarMonth`, the request returns the number of monthly active users. |
> | `limit`        | The number of counts in a response. This value is a number from `1` to `1000`. If not specified, the default value is `12`.                                                                                               |
> | `order`        | Defines the sort order of results. Possible values are `startDate` (ascending) and `-startDate` (descending). If not specified, the default value is `startDate`.                                                         |
> | `cursor`       | Indicates the first item to retrieve.                                                                                                                                                                                     |

### Response codes

| Code | Message                                                               |
| ---- | --------------------------------------------------------------------- |
| 200  | Successful operation.                                                 |
| 400  | The request could not be completed.                                   |
| 401  | You do not have access to this resource.                              |
| 403  | You do not have permissions or are not licensed to make this request. |
| 404  | The requested resource was not found.                                 |
| 500  | Internal server error.                                                |

### Headers

Authorization      Bearer {{accessToken}}

##

### Example Request

* cURL

* C#

* Go

* HTTP

* Java

* jQuery

* NodeJS

* Python

* PHP

* Ruby

* Swift

```shell
curl --location --globoff '{{apiPath}}/v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate' \
--header 'Authorization: Bearer {{accessToken}}'
```

```csharp
var options = new RestClientOptions("{{apiPath}}/v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{accessToken}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
```

```golang
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {

  url := "{{apiPath}}/v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{accessToken}}")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

```http
GET /v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate HTTP/1.1
Host: {{apiPath}}
Authorization: Bearer {{accessToken}}
```

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("{{apiPath}}/v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate")
  .method("GET", body)
  .addHeader("Authorization", "Bearer {{accessToken}}")
  .build();
Response response = client.newCall(request).execute();
```

```javascript
var settings = {
  "url": "{{apiPath}}/v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer {{accessToken}}"
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

```javascript
var request = require('request');
var options = {
  'method': 'GET',
  'url': '{{apiPath}}/v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate',
  'headers': {
    'Authorization': 'Bearer {{accessToken}}'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

```python
import requests

url = "{{apiPath}}/v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate"

payload = {}
headers = {
  'Authorization': 'Bearer {{accessToken}}'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer {{accessToken}}'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

```ruby
require "uri"
require "net/http"

url = URI("{{apiPath}}/v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer {{accessToken}}"

response = http.request(request)
puts response.read_body
```

```swift
var request = URLRequest(url: URL(string: "{{apiPath}}/v1/organizations/{{orgID}}/licenses/{{licenseID}}/metrics/activeIdentityCounts?aggregatedBy=calendarMonth&limit=1-1000&order=-startDate")!,timeoutInterval: Double.infinity)
request.addValue("Bearer {{accessToken}}", forHTTPHeaderField: "Authorization")

request.httpMethod = "GET"

let task = URLSession.shared.dataTask(with: request) { data, response, error in
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
```

### Example Response

200 OK

```json
{
    "_links": {
        "next": {
            "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84/metrics/activeIdentityCounts?limit=1-1000&aggregatedBy=calendarMonth&order=-startDate&cursor=MTI%3D"
        },
        "self": {
            "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84/metrics/activeIdentityCounts?limit=1-1000&aggregatedBy=calendarMonth&order=-startDate"
        }
    },
    "_embedded": {
        "activeIdentityCounts": [
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 0,
                "startDate": "2025-11-01T00:00:00Z",
                "endDate": "2025-11-03T23:59:59.999Z"
            },
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 1,
                "startDate": "2025-10-01T00:00:00Z",
                "endDate": "2025-10-31T23:59:59.999Z"
            },
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 1,
                "startDate": "2025-09-01T00:00:00Z",
                "endDate": "2025-09-30T23:59:59.999Z"
            },
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 0,
                "startDate": "2025-08-01T00:00:00Z",
                "endDate": "2025-08-31T23:59:59.999Z"
            },
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 1,
                "startDate": "2025-07-01T00:00:00Z",
                "endDate": "2025-07-31T23:59:59.999Z"
            },
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 1,
                "startDate": "2025-06-01T00:00:00Z",
                "endDate": "2025-06-30T23:59:59.999Z"
            },
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 1,
                "startDate": "2025-05-01T00:00:00Z",
                "endDate": "2025-05-31T23:59:59.999Z"
            },
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 1,
                "startDate": "2025-04-01T00:00:00Z",
                "endDate": "2025-04-30T23:59:59.999Z"
            },
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 1,
                "startDate": "2025-03-01T00:00:00Z",
                "endDate": "2025-03-31T23:59:59.999Z"
            },
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 1,
                "startDate": "2025-02-01T00:00:00Z",
                "endDate": "2025-02-28T23:59:59.999Z"
            },
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 4,
                "startDate": "2025-01-01T00:00:00Z",
                "endDate": "2025-01-31T23:59:59.999Z"
            },
            {
                "_links": {
                    "license": {
                        "href": "https://api.pingone.com/v1/organizations/bed432e6-676a-4ebe-b5a5-6b3b54e46bda/licenses/3f06970a-3235-46cb-b46f-cf6dfee2bb84"
                    }
                },
                "activeUsers": 0,
                "startDate": "2024-12-01T00:00:00Z",
                "endDate": "2024-12-31T23:59:59.999Z"
            }
        ]
    },
    "count": 65,
    "size": 12
}
```
