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, including multiple active licenses (an environment can have one license only). 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.

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

In the request, the {now} filter parameter 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'