Last updated: 2019-12-14 11:41:26


1. API Description

API domain name:

This API (ListEntitiesForPolicy) queries the list of entities associated with a policy.

Default API request rate limit: 20 requests/sec.

2. Input Parameters

The following parameters are required for requesting this API, including action-specific parameters and common parameters. For more information about common parameters for all requests, see Common Request Parameters.

Parameter name Required Type Description
Action Yes String Common parameter; the name of this API: ListEntitiesForPolicy
Version Yes String Common parameter; the version of this API: 2019-01-16
Region No String Common parameter; optional for this API.
PolicyId Yes Integer Policy ID
Page No Integer Page number starting from 1; 1 by default
Rp No Integer Number of entries per page; 20 by default
EntityFilter No String Valid values: All, User, Group, and Role. "All" means all entity types will be returned; "User" means only sub-accounts will be returned; "Group" means only user groups will be returned; and "Role" means only roles will be returned. "All" is the default value.

3. Output Parameters

Parameter name Type Description
TotalNum Integer Total number of entities
Note: This field may return null, indicating that no valid values can be obtained.
List Array of AttachEntityOfPolicy Entity list
Note: This field may return null, indicating that no valid values can be obtained.
RequestId String The ID of the request. Each request returns a unique ID. The RequestId is required to troubleshoot issues.

4. Sample

Sample 1. Querying the List of Entities Associated with a Policy

Input Sample Code
&<Common request parameter>

Output Sample Code

  "Response": {
    "List": [
        "Id": "1133398",
        "RelatedType": 1,
        "Uin": 3449203261,
        "Name": "test1"
    "TotalNum": 10,
    "RequestId": "836d7034-9854-44f0-9d4a-ee57842f8644"

5. Developer Resources

API Explorer

This tool provides various capabilities such as online call, signature verification, SDK code generation, and quick API retrieval that significantly reduce the difficulty of using TencentCloud API.

6. Error Codes

The following error codes are API business logic-related. For other error codes, see Common Error Codes.

Error Code Description
InternalError.SystemError Internal error.
InvalidParameter.EntityFilterError The EntityFilter field is invalid.
InvalidParameter.ParamError Invalid input parameter.
InvalidParameter.PolicyIdError The input parameter PolicyId is invalid.