UiPath Documentation
test-cloud
latest
false
Test Cloud API guide

Get Tenant Consumption by Folder

Retrieves the consumption breakdown by folder for a specific tenant, with optional aggregation by folder ownership.

Use this endpoint to retrieve a consumption breakdown by folder for a specific tenant.

API endpoint​

POST {accessURL}/lease_/api/usage/{organizationId}/tenants/consumption-by-folder

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 {access_token}'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer {access_token}'
--header 'Content-Type: application/json'
Note:

To obtain the {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.

Request body​

The request body specifies the tenant, date range, consumable code, and optional aggregation mode. For a detailed list of consumable codes, refer to Consumables.

{
  "tenantId": "string",
  "startDate": 0,
  "endDate": 0,
  "consumableCode": "string",
  "aggregateByOwnership": false,
  "processPersonalWorkspaces": false,
  "alwaysIncludeFolderKeys": ["string"]
}
{
  "tenantId": "string",
  "startDate": 0,
  "endDate": 0,
  "consumableCode": "string",
  "aggregateByOwnership": false,
  "processPersonalWorkspaces": false,
  "alwaysIncludeFolderKeys": ["string"]
}
Note:
  • tenantId is required. The ID of the tenant for which to retrieve consumption.
  • startDate and endDate are Unix timestamps in seconds. Both bounds are inclusive. Values provided in milliseconds are rejected with a 400 Bad Request error indicating that seconds are expected.
  • aggregateByOwnership is optional (default: false). When set to true, consumption is aggregated by the folder that triggered the process execution rather than where it ran.
  • processPersonalWorkspaces is optional (default: false). When set to true, personal workspaces are included in the folder breakdown as individual items, grouped under a synthetic PersonalWorkspacesRoot parent. Only workspaces with consumption in the queried window are returned. Consumption in folders that no longer exist is returned as synthetic items flagged with isDeletedFolder.
  • alwaysIncludeFolderKeys is optional. Provide a list of folder GUIDs to include in the response even if they have zero consumption in the queried window. Unknown keys are ignored.

Responses​

200 OK​

Returns a list of consumption records grouped by folder for the specified tenant.

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-by-folder' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \
--data-raw '{
  "tenantId": "string",
  "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-by-folder' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \
--data-raw '{
  "tenantId": "string",
  "startDate": 1704067200,
  "endDate": 1706745600,
  "consumableCode": "consumption_unit_code"
}'

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

Note:
  • isPersonalWorkspace is true when the item is a personal workspace.
  • isDeletedFolder is true when the item represents consumption from a deleted folder.
{
  "items": [
    {
      "folderKey": "string",
      "folderName": "string",
      "parentFolderKey": "string",
      "consumedBySelf": 0,
      "processCountSelf": 0,
      "isPersonalWorkspace": false,
      "isDeletedFolder": false
    }
  ]
}
{
  "items": [
    {
      "folderKey": "string",
      "folderName": "string",
      "parentFolderKey": "string",
      "consumedBySelf": 0,
      "processCountSelf": 0,
      "isPersonalWorkspace": false,
      "isDeletedFolder": false
    }
  ]
}
  • 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