UiPath Documentation
automation-cloud
latest
false
Automation Cloud API guide

Get Tenant Daily Consumption by Service

POST endpoint for retrieving a daily breakdown of consumption by service for a specific tenant, with optional folder and ownership filters.

Use this endpoint to retrieve a daily breakdown of consumption by service for a specific tenant.

API endpoint​

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

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

Cloud platformAccess URL
Automation Cloudhttps://cloud.uipath.com/
Automation Cloud Public Sectorhttps://govcloud.uipath.us/
Automation 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 filters. For a detailed list of consumable codes, refer to Consumables.

{
  "tenantId": "string",
  "startDate": 0,
  "endDate": 0,
  "consumableCode": "string",
  "aggregateByOwnership": false,
  "folderKeys": ["string"],
  "timeZoneId": "string"
}
{
  "tenantId": "string",
  "startDate": 0,
  "endDate": 0,
  "consumableCode": "string",
  "aggregateByOwnership": false,
  "folderKeys": ["string"],
  "timeZoneId": "string"
}
Note:
  • 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 owns the process rather than where it ran.
  • folderKeys is optional. Provide a list of folder GUIDs to filter results to specific folders only.
  • timeZoneId is optional (default: UTC). An IANA time zone ID (for example, Asia/Tokyo) used to group consumption into days. When omitted or set to UTC, days are UTC days. This does not affect startDate or endDate, which remain exact Unix-second instants. Unsupported values return a 400 Bad Request error.

Responses​

200 OK​

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

Note:

date values (format YYYY-MM-DD) represent days in the time zone requested via timeZoneId.

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/daily-consumption-by-service' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \
--data-raw '{
  "tenantId": "string",
  "startDate": 1704067200,
  "endDate": 1706745600,
  "consumableCode": "consumption_unit_code",
  "timeZoneId": "Asia/Tokyo"
}'
curl --location --request POST 'https://cloud.uipath.com/lease_/api/usage/11111111-1111-1111-1111-111111111111/tenants/daily-consumption-by-service' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \
--data-raw '{
  "tenantId": "string",
  "startDate": 1704067200,
  "endDate": 1706745600,
  "consumableCode": "consumption_unit_code",
  "timeZoneId": "Asia/Tokyo"
}'

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

{
  "items": [
    {
      "date": "2024-01-15",
      "service": "string",
      "consumedAmount": 0
    }
  ]
}
{
  "items": [
    {
      "date": "2024-01-15",
      "service": "string",
      "consumedAmount": 0
    }
  ]
}
  • 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