- Getting started
- Authentication
- Scopes and permissions
- Platform Management APIs
Get Tenant Consumption Summary
POST endpoint for retrieving the consumption summary for all tenants in an organization, grouped by tenant with tenant-pool and organization-pool breakdown.
As an organization admin, use this endpoint to retrieve the consumption summary for all tenants in your organization.
API endpoint
POST {accessURL}/lease_/api/usage/{organizationId}/tenants/consumption-summary
Replace {accessURL} in all endpoint paths with the base URL for your cloud platform:
| Cloud platform | Access URL |
|---|---|
| Test Cloud | https://cloud.uipath.com/ |
| Test Cloud Public Sector | https://govcloud.uipath.us/ |
| Test Cloud Dedicated | https://{customURL}.dedicated.uipath.com/ |
Your organization's name appears in the URL right after the access URL when you're logged into the product, for example {accessURL}/{organizationName}/....
Request headers
--header 'Authorization: Bearer <your-access-token>'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer <your-access-token>'
--header 'Content-Type: application/json'
To obtain the <your-access-token>, make sure to authenticate through the ROPC method described here.
Path parameters
| Path param | Data type | Description |
|---|---|---|
organizationId (required) | String (GUID) | The ID of the organization for which to retrieve the consumption summary. |
Request body
The request body specifies the date range and the consumable code for which to retrieve the summary. For a detailed list of consumable codes, refer to Consumables.
{
"startDate": 0,
"endDate": 0,
"consumableCode": "string",
"tenantId": "string",
"includeTopUpBreakdown": false,
"includeAllocation": false
}
{
"startDate": 0,
"endDate": 0,
"consumableCode": "string",
"tenantId": "string",
"includeTopUpBreakdown": false,
"includeAllocation": false
}
startDateandendDateare Unix timestamps in seconds. Both bounds are inclusive. Values provided in milliseconds are rejected with a400 Bad Requesterror indicating that seconds are expected.tenantIdis optional. When provided, limits the summary to this tenant.includeTopUpBreakdownis optional (default:false). When set totrue, the response includes the consumption drawn from top-up units (consumedByTopUpfields).includeAllocationis optional (default:false). When set totruetogether withtenantId, the response includes that tenant's allocated quantity for the queried consumable (allocatedfield). WithouttenantId,allocatedisnull, because a request across all tenants has no single allocation to report.
Responses
200 OK
Returns the consumption summary across all tenants in the organization.
Example request
The call should resemble the following example (cURL):
curl --location --request POST 'https://cloud.uipath.com/lease_/api/usage/11111111-1111-1111-1111-111111111111/tenants/consumption-summary' \
--header 'Authorization: Bearer <your-access-token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"startDate": 1704067200,
"endDate": 1706745600,
"consumableCode": "consumption_unit_code"
}'
curl --location --request POST 'https://cloud.uipath.com/lease_/api/usage/11111111-1111-1111-1111-111111111111/tenants/consumption-summary' \
--header 'Authorization: Bearer <your-access-token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"startDate": 1704067200,
"endDate": 1706745600,
"consumableCode": "consumption_unit_code"
}'
Here's the response body for a successful consumption summary retrieval:
consumedByTopUpis included at the top level and within eachtenantConsumptionItemsentry only whenincludeTopUpBreakdownistrue.allocatedis included at the top level only whenincludeAllocationistrue, and isnullunlesstenantIdis also provided. Handlenullas unknown, not as zero, because it means the allocation can't be determined.
{
"consumedFromOrgWithoutTenant": 0,
"consumedByTopUp": 0,
"allocated": null,
"tenantConsumptionItems": [
{
"tenantId": "string",
"consumedFromTenantPool": 0,
"consumedFromOrgPool": 0,
"consumedByTopUp": 0
},
{
"tenantId": "string",
"consumedFromTenantPool": 0,
"consumedFromOrgPool": 0,
"consumedByTopUp": 0
}
]
}
{
"consumedFromOrgWithoutTenant": 0,
"consumedByTopUp": 0,
"allocated": null,
"tenantConsumptionItems": [
{
"tenantId": "string",
"consumedFromTenantPool": 0,
"consumedFromOrgPool": 0,
"consumedByTopUp": 0
},
{
"tenantId": "string",
"consumedFromTenantPool": 0,
"consumedFromOrgPool": 0,
"consumedByTopUp": 0
}
]
}