UiPath Documentation
test-cloud
latest
false
Test Cloud API guide

Get Tenant Consumption Summary by Tenant

POST endpoint for retrieving the consumption summary for a specific tenant, with breakdown by tenant-pool and organization-pool usage and an optional allocated quantity.

Use this endpoint to retrieve the consumption summary for a specific tenant in your organization.

API endpoint​

POST {accessURL}/lease_/api/usage/{organizationId}/tenants/{tenantId}/consumption-summary

Replace {accessURL} in all endpoint paths with the base URL for your cloud platform:

Cloud platformAccess URL
Test Cloudhttps://cloud.uipath.com/
Test Cloud Public Sectorhttps://govcloud.uipath.us/
Test Cloud Dedicatedhttps://{customURL}.dedicated.uipath.com/
Note:

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'
Note:

To obtain the <your-access-token>, make sure to authenticate through the ROPC method described here.

Path parameters​

Path paramData typeDescription
organizationId (required)String (GUID)The ID of the organization in which your tenant resides.
tenantId (required)String (GUID)The ID of the tenant 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. The tenant is determined by the {tenantId} path parameter. For a detailed list of consumable codes, refer to Consumables.

{
  "startDate": 0,
  "endDate": 0,
  "consumableCode": "string",
  "includeAllocation": false
}
{
  "startDate": 0,
  "endDate": 0,
  "consumableCode": "string",
  "includeAllocation": false
}
FieldData typeDescription
startDate (required)LongStart of the date range, as a Unix timestamp in seconds. Values in milliseconds are rejected with a 400 Bad Request error.
endDate (required)LongEnd of the date range, as a Unix timestamp in seconds. Values in milliseconds are rejected with a 400 Bad Request error.
consumableCode (required)StringThe consumable to summarize. For robot units, use RU.
includeAllocationBooleanDefaults to false. When true, the response includes the tenant's allocated quantity for the consumable over the date range.
tenantIdString (GUID)Don't send this field. The {tenantId} path parameter determines the tenant and overrides any value in the body.
includeTopUpBreakdownBooleanNot supported on this endpoint and always treated as false. To retrieve top-up consumption, use Get Tenant Consumption Summary.

Responses​

200 OK​

Returns the consumption summary for the specified tenant and, when requested, the tenant's allocated quantity.

FieldData typeDescription
allocatedNumberThe tenant's allocated quantity for the consumable. Returned only when includeAllocation is true.
consumedFromOrgWithoutTenantNumberAlways 0 on this endpoint, because consumption without tenant context isn't attributed to any tenant.
consumedByTopUpNumberAlways null on this endpoint, because top-up breakdown isn't supported per tenant.
tenantConsumptionItems[].tenantIdString (GUID)The ID of the tenant.
tenantConsumptionItems[].consumedFromTenantPoolNumberUnits consumed from the tenant's allocation.
tenantConsumptionItems[].consumedFromOrgPoolNumberUnits consumed from the organization pool.
tenantConsumptionItems[].consumedByTopUpNumberAlways null on this endpoint.
Note:

Handle a null value in allocated as unknown, not as zero. allocated is null when the tenant has no license for the queried consumable, or when the date range spans more than one allocation period, such as a 90-day range when allocations are set monthly. A value of 0 means the tenant's allocation is zero.

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/22222222-2222-2222-2222-222222222222/consumption-summary' \
--header 'Authorization: Bearer <your-access-token>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "startDate": 1704067200,
  "endDate": 1706745600,
  "consumableCode": "consumption_unit_code",
  "includeAllocation": true
}'
curl --location --request POST 'https://cloud.uipath.com/lease_/api/usage/11111111-1111-1111-1111-111111111111/tenants/22222222-2222-2222-2222-222222222222/consumption-summary' \
--header 'Authorization: Bearer <your-access-token>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "startDate": 1704067200,
  "endDate": 1706745600,
  "consumableCode": "consumption_unit_code",
  "includeAllocation": true
}'

Here's the response body for a successful consumption summary retrieval:

{
  "consumedFromOrgWithoutTenant": 0,
  "consumedByTopUp": null,
  "allocated": 200,
  "tenantConsumptionItems": [
    {
      "tenantId": "string",
      "consumedFromTenantPool": 150,
      "consumedFromOrgPool": 0,
      "consumedByTopUp": null
    }
  ]
}
{
  "consumedFromOrgWithoutTenant": 0,
  "consumedByTopUp": null,
  "allocated": 200,
  "tenantConsumptionItems": [
    {
      "tenantId": "string",
      "consumedFromTenantPool": 150,
      "consumedFromOrgPool": 0,
      "consumedByTopUp": null
    }
  ]
}
  • API endpoint​
  • Request headers​
  • Path parameters​
  • Request body​
  • Responses​
  • 200 OK​
  • Example request​

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated