QueryUserUsageReport

Updated at:

Queries the connection status, last connection time, cumulative usage duration, and session persistence duration of users.

Operation description

Queries user usage reports. ProductType, StartDate, and EndDate are all required. The interval between the start and end times calculated by full months must not exceed 60 months.

The query aggregates data within the closed interval of calendar days between the start and end dates. Statistics for the same user under the same app instance group are merged. The results are paginated in descending order of cumulative usage duration, with a maximum of 1,500 records per page. You can combine ConnectionStatus, UserId, BizRegionId, and AppInstanceGroupId for filtering.

Response handling

A successful response may not contain Code and Message. Do not require these two fields to be 200 and success respectively. When no matching records are found, the response can normally return Count=0 and an empty UserUsageReportDataModel list. This does not indicate a request failure.

Example of a successful response when no matching records are found (HTTP status code: 200):

{
  "RequestId": "01A1F2C3-572F-544E-880D-B0E347E3DCB3",
  "PageSize": 1,
  "PageNumber": 1,
  "Count": 0,
  "UserUsageReportDataModel": []
}

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

appstreaming:QueryUserUsageReport

none

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

AppInstanceGroupId

string

No

The ID of the app instance group, which is used to filter data for a specified app instance group. You can call the ListAppInstanceGroup operation to obtain the ID. If you do not specify this parameter, data is not filtered by app instance group. To skip this filter, omit the parameter. An empty string is different from an omitted parameter and is used as a filter value in the query.

aig-9ciijz60n4xsv****

PageSize

integer

No

The number of records per page. Default value: 200. If the value is greater than 1500, the actual query processes it as 1500. Specify a value from 1 to 1,500. The PageSize field in the response returns the echo request value, which does not necessarily mean that this value is adopted or that this number of records is actually returned.

100

PageNumber

integer

No

The page number to query. Specify a value starting from 1. If you do not specify this parameter, the service processes the request as the first page, but the response may echo 0.

1

BizRegionId

string

No

The ID of the business region, which is used to filter report data. You can call the ListRegions operation to obtain the ID. To skip this filter, omit the parameter. An empty string is different from an omitted parameter and is used as a filter value in the query.

cn-hangzhou

StartDate

string

No

The start time of the statistics. This parameter is required. You must specify both StartDate and EndDate. Format: yyyy-MM-dd HH:mm:ss. The time is in Beijing time (UTC+8). Specify the time in Beijing time without appending Z or a time zone offset. The operation filters calendar day data based on the provided calendar dates without time zone conversion. The hour, minute, and second parts are not involved in day-level filtering.

The interval between the start and end times calculated by full months must not exceed 60 months. Make sure that EndDate is not earlier than StartDate. The current operation does not independently verify the chronological order of the times. A reversed date range may return empty data. Do not rely on parameter errors to identify this situation.

If either time parameter is missing, the format is incorrect, or the range exceeds the limit, InvalidParameter.StartDate/EndDate (HTTP status code: 400) is returned.

2026-09-01 00:00:00

EndDate

string

No

The end time of the statistics. This parameter is required. You must specify both StartDate and EndDate. Format: yyyy-MM-dd HH:mm:ss. The time is in Beijing time (UTC+8). Specify the time in Beijing time without appending Z or a time zone offset. The operation filters calendar day data based on the provided calendar dates without time zone conversion. The hour, minute, and second parts are not involved in day-level filtering.

The interval between the start and end times calculated by full months must not exceed 60 months. Make sure that EndDate is not earlier than StartDate. The current operation does not independently verify the chronological order of the times. A reversed date range may return empty data. Do not rely on parameter errors to identify this situation.

If either time parameter is missing, the format is incorrect, or the range exceeds the limit, InvalidParameter.StartDate/EndDate (HTTP status code: 400) is returned.

2026-09-02 00:00:00

ProductType

string

No

The product type. This parameter must be explicitly specified. The value is not case-sensitive. If this parameter is not provided or an unrecognized type is specified, InvalidParameter.ProductType (HTTP status code: 400) is returned.

Valid values:

  • CloudGame: Cloud gaming.

  • CloudApp: Wuying Cloud App.

  • CloudBrowser: Cloud browser.

  • CloudDesktop: Cloud desktop.

  • ImageBuilder: Image builder.

  • ImageValidate: Image validation.

  • AndroidCloud: Cloud phone.

  • GpuRender: GPU rendering.

  • AndroidGpuRender: Cloud phone GPU rendering.

  • WuyingServer: Enterprise workstation.

  • GpuProxy: GPU remote rendering proxy.

  • GpuCache: GPU remote rendering cache.

  • AIAgent: AI agent service.

  • HostedDesktop: Hosted computer.

  • WuyingWorkstation: Personal Edition container workstation.

  • WuyingWorkstationBusiness: Business Edition container workstation.

  • WuyingWorkstationTeam: Team Edition container workstation.

The query returns only existing statistical records for the current account within the specified product and time range. Specifying a recognized type does not necessarily mean that report data is available.

CloudApp

UserId

string

No

The ID of the end user, which is used to precisely filter users. If you do not specify this parameter, data is not filtered by user. To skip this filter, omit the parameter. An empty string is different from an omitted parameter and is used as a filter value in the query.

user01

ConnectionStatus

string

No

The filter condition for the user connection status. The value is not case-sensitive. An unrecognized value is equivalent to not filtering by connection status.

Valid values:

  • Connected: At least one currently connected session exists.

  • Disconnected: The session binding is retained, but no currently connected session exists.

  • Unbound: No session binding exists.

Connected

Response elements

Element

Type

Description

Example

object

The operation response.

Code

string

The business processing status code. A successful response may not contain this field. Do not use Code=200 as a necessary condition for success. This field is not equivalent to the HTTP status code. If the request fails, handle it based on the HTTP status code, error code, and error message.

200

Count

integer

The total number of records that meet the query conditions.

3

Message

string

The description of the business processing result. A successful response may not contain this field. Do not rely on the fixed success text. If the request fails, read the specific error message based on the error code.

success

PageNumber

integer

The page number corresponding to the current response.

1

PageSize

integer

The number of records per page in the request. If this parameter is not specified, the default value 200 is returned. If the requested value exceeds 1500, this field still returns the echo request value, but the actual query uses a maximum of 1500. Refer to the length of the data list for the actual number of returned records.

200

RequestId

string

The unique identifier of the request, which can be used to troubleshoot the request.

1CBAFFAB-B697-4049-A9B1-67E1FC5F****

UserUsageReportDataModel

array<object>

The list of user usage data, sorted in descending order of cumulative usage duration.

object

The user usage data object.

AppInstanceGroupId

string

The ID of the app instance group to which the user usage record belongs.

aig-9ciijz60n4xsv****

AppInstanceGroupName

string

The name of the app instance group to which the user usage record belongs.

R&D workstation group

ConnectionStatus

string

The current connection status of the user.

Valid values:

  • Connected: At least one currently connected session exists.

  • Disconnected: The session binding is retained, but no currently connected session exists.

  • Unbound: No session binding exists.

Connected

LastConnectedTime

string

The last connection time. Format: yyyy-MM-dd HH:mm:ss. If a current session binding record exists, the connection time of this record is used. Otherwise, the historical connection record is used. If no available connection time exists, - is returned. This time is not limited by the statistical date range in the request.

The time is in Beijing time (UTC+8). The returned string does not carry Z or a time zone offset. For example, 2026-09-01 10:00:00 indicates 10:00:00 on September 1, 2026, Beijing time. Do not parse it as UTC time.

2026-09-01 10:00:00

RegionId

string

The current version does not return a valid region ID. Callers should not rely on this field. To filter by business region, use the BizRegionId request parameter.

null

SessionsHoldDuration

number

The cumulative session persistence duration within the query range, which is the duration that the user occupies the session from attach to session release. Multiple sessions under the same app instance group are accumulated. Unit: hours.

3.5

UsageDuration

number

The cumulative user usage duration within the query range. The usage duration of the same user under the same app instance group is aggregated by day. Unit: hours.

2

UserId

string

The ID of the end user.

user01

Examples

Success response

JSON format

{
  "Code": "200",
  "Count": 3,
  "Message": "success",
  "PageNumber": 1,
  "PageSize": 200,
  "RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****",
  "UserUsageReportDataModel": [
    {
      "AppInstanceGroupId": "aig-9ciijz60n4xsv****",
      "AppInstanceGroupName": "R&D workstation group",
      "ConnectionStatus": "Connected",
      "LastConnectedTime": "2026-09-01 10:00:00",
      "RegionId": "null",
      "SessionsHoldDuration": 3.5,
      "UsageDuration": 2,
      "UserId": "user01"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.