All Products
Search
Document Center

API Gateway:ListPolicies

Last Updated:Dec 17, 2025

Queries policies.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
apig:ListPoliciesnone
*All Resources
*
    none
none

Request syntax

GET /v1/policies HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
withAttachmentsbooleanNo

Specifies whether to return attachment information.

false
attachResourceIdstringNo

The attachment point ID.

api-cq7l5s5lhtgi6qasrdc0
attachResourceTypestringNo

The types of attachment points supported by the policy. Valid values:

  • HttpApi
  • Operation
  • GatewayRoute
  • GatewayService
  • GatewayServicePort
  • Domain
  • Gateway
HttpApi
environmentIdstringNo

The environment ID.

env-cq7l5s5lhtgi6qasrdc0
gatewayIdstringNo

The gateway ID.

gw-cq2fm65lhtgm9nrrl7ag
withSystemPolicybooleanNo

Specifies whether it is a system policy.

true

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

requestIdstring

The request ID for API call tracing.

393E2630-DBE7-5221-AB35-9E740675491A
codestring

The status code.

Ok
messagestring

The status message.

success
dataobject

The response payload.

pageNumberinteger

The page number.

1
pageSizeinteger

The page size.

10
totalSizeinteger

The total number of entries returned.

18
itemsarray

The list of policies.

policyInfoPolicyInfo

The details of a policy.

Examples

Sample success responses

JSONformat

{
  "requestId": "393E2630-DBE7-5221-AB35-9E740675491A",
  "code": "Ok",
  "message": "success",
  "data": {
    "pageNumber": 1,
    "pageSize": 10,
    "totalSize": 18,
    "items": [
      {
        "policyId": "p-cq7l5s5lhtgi6qasrdc0",
        "direction": "InBound",
        "className": "",
        "classAlias": "",
        "config": {
          "enable": false
        },
        "attachments": [
          {
            "policyAttachmentId": "pr-cq7l5s5lhtgi6qasrdc0",
            "attachResourceIds": [
              "api-cq7l5s5lhtgi6qasrdc0"
            ],
            "attachResourceType": "HttpApi",
            "environmentId": "env-cq7l5s5lhtgi6qasrdc0",
            "gatewayId": "gw-cpr4f9dlhtgq5ksfgmb0"
          }
        ],
        "name": "test-policy",
        "type": "",
        "executeStage": "PluginPost",
        "executePriority": 310
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.