All Products
Search
Document Center

API Gateway:ListConsumerAuthorizationRules

Last Updated:Mar 26, 2026

Obtains a list of consumer authentication rules.

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:ListConsumerAuthorizationRulesnone
*Domain
acs:apig:{#regionId}:{#accountId}:consumer/{#ConsumerId}
    none
none

Request syntax

GET /v1/consumers/{consumerId}/authorization-rules HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
apiNameLikestringNo

API name for fuzzy search.

qwen3
pageNumberintegerNo

The page number.

1
pageSizeintegerNo

The number of entries returned on each page. If you do not specify this parameter, the default value is 10.

10
consumerIdstringNo

The consumer ID.

cs-csgdi45lhtggrjcpriug

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

requestIdstring

Id of the request

294382D9-EE60-5735-A4CD-F2AC2840423D
codestring

The status code.

Ok
messagestring

The response message.

success
dataobject

The response data.

totalSizestring

The total number.

9
pageNumberinteger

The page number.

1
pageSizeinteger

The number of entries per page.

10
itemsarray<object>

The list of consumer authorization information.

itemobject

The authorization information of the consumer.

consumerAuthorizationRuleIdstring

The ID of the consumer authorization rule.

car-csgeka5lhtggrjcprok0
consumerIdstring

The consumer ID.

cs-csheiftlhtgmp0j0hp4g
apiInfoHttpApiApiInfo

The API information.

environmentInfoEnvironmentInfo

The environment information.

gatewayInfoGatewayInfo

The gateway information.

resourceIdstring

The resource ID.

2351944
resourceTypestring

The resource type.

HttpApiRoute
expireStatusstring

The rule status.

InEffect
expireModestring

The expiry mode. Valid values: LongTerm and ShortTerm.

ShortTerm
expireTimestamplong

The time when the rule expires.

172086834548
createTimestamplong

The creation timestamp.

1719386834548
updateTimestamplong

The update timestamp. Unit: milliseconds.

1721116090326
deployStatusstring

The deployment status of the API in the current environment.

{}

Examples

Sample success responses

JSONformat

{
  "requestId": "294382D9-EE60-5735-A4CD-F2AC2840423D",
  "code": "Ok",
  "message": "success",
  "data": {
    "totalSize": 9,
    "pageNumber": 1,
    "pageSize": 10,
    "items": [
      {
        "consumerAuthorizationRuleId": "car-csgeka5lhtggrjcprok0",
        "consumerId": "cs-csheiftlhtgmp0j0hp4g",
        "apiInfo": {
          "httpApiId": "api-xxx",
          "name": "test",
          "basePath": "/v1",
          "description": "for test only",
          "versionInfo": {
            "enable": true,
            "scheme": "Query",
            "headerName": "my-version",
            "queryName": "myVersion",
            "version": "v1"
          },
          "ingressInfo": {
            "sourceId": "src-xxx",
            "ingressClass": "mse",
            "watchNamespace": "default",
            "environmentInfo": {
              "environmentId": "env-xxx"
            },
            "k8sClusterInfo": {
              "clusterId": "ca435c77cba1547cca9311957bcxxxxxx"
            },
            "overrideIngressIp": true
          },
          "type": "Rest",
          "resourceGroupId": "rg-xxx",
          "enabelAuth": true,
          "authConfig": {
            "authType": "Jwt",
            "authMode": "NoAuth"
          },
          "gatewayId": "gw-cpv4sqdl****",
          "modelCategory": "Text",
          "protocols": [
            "HTTP"
          ],
          "environments": [
            {
              "environmentId": "env-xxx",
              "backendScene": "SingleService",
              "backendType": "Service",
              "serviceConfigs": [
                {
                  "gatewayServiceId": "gs-xxx",
                  "name": "demo-service",
                  "protocol": "HTTP",
                  "port": 8080,
                  "weight": 100,
                  "version": "v1",
                  "match": {
                    "default": true,
                    "conditions": [
                      {
                        "type": "Query",
                        "key": "color",
                        "value": "gray",
                        "operator": "equal"
                      }
                    ]
                  },
                  "serviceId": "svc-xxx"
                }
              ],
              "customDomains": [
                {
                  "domainId": "d-xxx",
                  "name": "www.example.com",
                  "protocol": "HTTP"
                }
              ],
              "name": "test",
              "alias": "test",
              "gatewayInfo": {
                "gatewayId": "gw-xxx",
                "name": "test"
              },
              "deployStatus": "Deployed",
              "subDomains": [
                {
                  "domainId": "d-xxx",
                  "name": "www.example.com",
                  "protocol": "HTTP",
                  "networkType": "Internet"
                }
              ]
            }
          ],
          "aiProtocols": [
            "OpenAI/v1"
          ],
          "deployConfigs": [
            {
              "environmentId": "env-xxx",
              "backendScene": "SingleService",
              "autoDeploy": true,
              "gatewayId": "gw-xx",
              "routeBackend": {
                "scene": "Single",
                "services": [
                  {
                    "serviceId": "service-cq2bmmdlhtgj***",
                    "name": "item-service",
                    "protocol": "HTTP",
                    "port": 0,
                    "weight": 49,
                    "version": "v1"
                  }
                ]
              },
              "gatewayInfo": {
                "gatewayId": "gw-cq7og15lhtgi6qasrj60",
                "name": "apitest-gw",
                "vpcInfo": {
                  "vpcId": "vpc-uf664nyle5kh***",
                  "name": "test-vpc"
                },
                "engineVersion": "2.0.7"
              },
              "mock": {
                "enable": false,
                "responseCode": 200,
                "responseContent": "Mock content."
              },
              "gatewayType": "API",
              "customDomainIds": [
                "d-xxx"
              ],
              "serviceConfigs": [
                {
                  "serviceId": "svc-xxx",
                  "weight": 100,
                  "modelNamePattern": "qwen-*",
                  "modelName": "qwen-max",
                  "intentCode": "INQUIRY",
                  "match": {
                    "default": true,
                    "conditions": [
                      {
                        "type": "Query",
                        "key": "color",
                        "value": "gray",
                        "operator": "equal"
                      }
                    ]
                  },
                  "port": 80,
                  "protocol": "HTTP",
                  "gatewayServiceId": "gw-svc-abc123",
                  "name": "Qwen-Max-Service",
                  "version": "v2",
                  "multiServiceRouteStrategy": "ByWeight",
                  "observabilityRouteConfig": {
                    "mode": "LeastBusy",
                    "rateLimit": 0.8,
                    "queueSize": 100
                  }
                }
              ],
              "policyConfigs": [
                {
                  "type": "AiFallback",
                  "enable": true,
                  "aiFallbackConfig": {
                    "serviceConfigs": [
                      {
                        "serviceId": "svc-******",
                        "targetModelName": "gpt-4/llama3-70b"
                      }
                    ]
                  },
                  "aiSecurityGuardConfig": {
                    "serviceAddress": "https://api.example.com/v1",
                    "checkRequest": true,
                    "checkResponse": true,
                    "checkRequestImage": true,
                    "checkResponseImage": true,
                    "requestCheckService": "https://checker.example.com/validate-request",
                    "responseCheckService": "https://checker.example.com/validate-response",
                    "requestImageCheckService": "https://image-checker.example.com/scan",
                    "responseImageCheckService": "https://image-checker.example.com/scan-response",
                    "riskAlertLevel": "low/medium/high",
                    "riskConfig": [
                      {
                        "type": "K8S",
                        "level": "Critical",
                        "consumerRules": {
                          "pattern": "first",
                          "matchType": "term"
                        }
                      }
                    ],
                    "bufferLimit": 50,
                    "consumerRequestCheckService": [
                      {
                        "name": "API",
                        "requestCheckService": "https://checker.example.com/validate",
                        "requestImageCheckService": "https://image-check.example.com/scan",
                        "matchType": "exact/prefix",
                        "modalityType": "text/image"
                      }
                    ],
                    "consumerResponseCheckService": [
                      {
                        "name": "AI_API",
                        "responseCheckService": "https://checker.example.com/validate-response",
                        "responseImageCheckService": "https://image-check.example.com/scan-response",
                        "matchType": "term",
                        "modalityType": "text/image"
                      }
                    ],
                    "consumerRiskLevel": [
                      {
                        "name": "APIG-UI",
                        "matchType": "term",
                        "type": "K8S",
                        "level": "Critical"
                      }
                    ]
                  },
                  "aiTokenRateLimitConfig": {
                    "rules": [
                      {
                        "limitType": "request/token",
                        "matchKey": "user_id/api_path",
                        "matchType": "term",
                        "matchValue": "user123",
                        "limitMode": "local",
                        "limitValue": 100
                      }
                    ],
                    "globalRules": [
                      {
                        "limitType": "request",
                        "matchKey": "user_id",
                        "matchType": "term",
                        "matchValue": "user123",
                        "limitMode": "local",
                        "limitValue": 100
                      }
                    ],
                    "enableGlobalRules": true
                  }
                }
              ],
              "customDomainInfos": [
                {
                  "domainId": "d-cshee6dlhtgkf4muio3g",
                  "name": "hello-server.com",
                  "protocol": "HTTP"
                }
              ],
              "subDomains": [
                {
                  "domainId": "d-csmn42um1hksudfk9eng",
                  "name": "test",
                  "protocol": "HTTP",
                  "networkType": "Intranet"
                }
              ]
            }
          ],
          "deployCntMap": {
            "key": {
              "deployedCnt": 3,
              "Cnt": 5
            }
          },
          "agentProtocols": [
            "DashScope"
          ]
        },
        "environmentInfo": {
          "environmentId": "env-cq7l5s5lhtgi6qasrdc0",
          "name": "test",
          "alias": "test-env",
          "description": "This is a test environment.",
          "gatewayInfo": {
            "gatewayId": "gw-cq7og15lhtgi6qasrj60",
            "name": "apitest-gw",
            "vpcInfo": {
              "vpcId": "vpc-uf664nyle5kh***",
              "name": "test-vpc"
            },
            "engineVersion": "2.0.7"
          },
          "subDomainInfos": [
            {
              "domainId": "d-cpudb0llhtgl2djvq2sg",
              "name": "abc.com",
              "protocol": "HTTP",
              "networkType": "Intranet"
            }
          ],
          "default": false,
          "createTimestamp": 1721116090326,
          "updateTimestamp": 1721116090326,
          "resourceGroupId": "rg-xxxx"
        },
        "gatewayInfo": {
          "gatewayId": "gw-cq7og15lhtgi6qasrj60",
          "name": "apitest-gw",
          "vpcInfo": {
            "vpcId": "vpc-uf664nyle5kh***",
            "name": "test-vpc"
          },
          "engineVersion": "2.0.7"
        },
        "resourceId": 2351944,
        "resourceType": "HttpApiRoute",
        "expireStatus": "InEffect",
        "expireMode": "ShortTerm",
        "expireTimestamp": 172086834548,
        "createTimestamp": 1719386834548,
        "updateTimestamp": 1721116090326,
        "deployStatus": {}
      }
    ]
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
2026-01-05Add OperationView Change Details