The following sample shows the GET /organizations/{organizationId}/licenses operation to return the complete list of license resources associated with the specified organization.

An organization can have several licenses, such as a TRIAL license and a STANDARD license. However, an organization can have only one active license. For organizations with more than one license, you can use a filter with the GET /organizations/{organizationId}/licenses operation to return the list of licenses in descending order, showing the active license first.

curl -X "GET" "https://api.pingone.com/v1/organizations/{organizationId}/licenses?filter=beginsAt lt "{now}"&order=-beginsAt" \
-H 'Authorization: Bearer jwtToken'

In the request, the {now} filter parameter variable represents a datetime value in the format 2019-06-25T16:55:44.225Z. The order=-beginsAt parameter orders the list showing the most recent license first.

In addition, you can use the filtering expression ?filter=status eq "active" to return licenses that have a status value of ACTIVE.

curl -X "GET" "https://api.pingone.com/v1/organizations/{organizationId}/licenses?filter=status eq "active" \
-H 'Authorization: Bearer jwtToken'