API7 Docs
API7 GatewayAPI7 Enterprise Admin APIsGet a permission policy

Get a permission policy

GET /api/permission_policies/{permission_policy_id}

GET /api/permission_policies/{permission_policy_id}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Path Parameters

permission_policy_id*string

Permission policy ID.

Length1 <= length

Response Body

application/json

curl -X GET "$API_BASE_URL/api/permission_policies/string"

Successfully retrieved the permission policy.

{
  "value": {
    "name": "sample-policy",
    "type": "built_in",
    "desc": "Object description.",
    "labels": {
      "version": "v2",
      "env": "prod"
    },
    "policy_document": {
      "statement": [
        {
          "effect": "allow",
          "resources": [
            "arn:api7:gateway:gatewaygroup/<.*>/service/<.*>"
          ],
          "actions": [
            "gateway:GetPublishedService"
          ],
          "conditions": {
            "gateway_group_label": {
              "type": "MatchLabel",
              "options": {
                "key": "env",
                "operator": "exact_match",
                "value": "prod"
              }
            }
          }
        }
      ]
    },
    "id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
    "created_at": 1742288232,
    "updated_at": 1742288235
  }
}
Complete operation details and schema variants

GET /api/permission_policies/{permission_policy_id}

Get a permission policy

Get a permission policy by ID, including all statements and metadata. Required IAM Permission: Action iam:GetPermissionPolicy, Resource arn:api7:iam:permissionpolicy/%s

Parameters

  • permission_policy_id (path, string, required): Permission policy ID.

Responses

  • 200: Successfully retrieved the permission policy.

  • allOf variant 1

  • value (object, optional): The specific resource.

  • allOf variant 2

  • value (object, optional):

  • allOf variant 1

  • value.name (string, required): The policy name.

  • value.type (string, optional): The permission policy type.

  • value.desc (string, optional): The description of the policy.

  • value.labels (object, optional): The labels of the policy.

  • value.policy_document (object, required): Policy document.

  • value.policy_document.statement (array, required): The statements of the policy.

  • value.policy_document.statement[].effect (string, required): The effect of the statement.

  • value.policy_document.statement[].resources (array, required): The resources for requests.

  • value.policy_document.statement[].actions (array, required): The actions for requests.

  • anyOf variant 1

  • value.policy_document.statement[].conditions (object, optional): Rules for matching requests. The key is the condition name, the value is the condition expression which specifies the function name and parameter structure of condition.

  • anyOf variant 1: Condition for Gateway Group

  • value.policy_document.statement[].conditions.gateway_group_label (object, optional): Condition for gateway group label.

  • value.policy_document.statement[].conditions.gateway_group_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.gateway_group_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.gateway_group_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.gateway_group_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.gateway_group_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 2: Condition for Service

  • value.policy_document.statement[].conditions.service_label (object, optional): Condition for service label.

  • value.policy_document.statement[].conditions.service_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.service_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.service_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.service_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.service_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 3: Condition for Permission Policy

  • value.policy_document.statement[].conditions.permission_policy_label (object, optional): Condition for permission policy label.

  • value.policy_document.statement[].conditions.permission_policy_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.permission_policy_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.permission_policy_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.permission_policy_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.permission_policy_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 4: Condition for Service

  • value.policy_document.statement[].conditions.gateway_group_label (object, optional): Condition for gateway group label.

  • value.policy_document.statement[].conditions.gateway_group_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.gateway_group_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.gateway_group_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.gateway_group_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.gateway_group_label.options.value (string, optional): The value to compare against the label.

  • value.policy_document.statement[].conditions.service_label (object, optional): Condition for service label.

  • value.policy_document.statement[].conditions.service_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.service_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.service_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.service_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.service_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 5: Condition for Role

  • value.policy_document.statement[].conditions.role_label (object, optional): Condition for role label.

  • value.policy_document.statement[].conditions.role_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.role_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.role_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.role_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.role_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 6: Condition for User

  • value.policy_document.statement[].conditions.user_label (object, optional): Condition for user label.

  • value.policy_document.statement[].conditions.user_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.user_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.user_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.user_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.user_label.options.value (string, optional): The value to compare against the label.

  • value.policy_document.statement[].conditions.permission_boundaries (object, optional): Condition for permission boundaries.

  • value.policy_document.statement[].conditions.permission_boundaries.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.permission_boundaries.options (array, optional): An array of options.

  • anyOf variant 7: Condition for Consumer

  • value.policy_document.statement[].conditions.gateway_group_label (object, optional): Condition for gateway group label.

  • value.policy_document.statement[].conditions.gateway_group_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.gateway_group_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.gateway_group_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.gateway_group_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.gateway_group_label.options.value (string, optional): The value to compare against the label.

  • value.policy_document.statement[].conditions.consumer_label (object, optional): Condition for consumer label.

  • value.policy_document.statement[].conditions.consumer_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.consumer_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.consumer_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.consumer_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.consumer_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 8: Condition for Secret

  • value.policy_document.statement[].conditions.gateway_group_label (object, optional): Condition for gateway group label.

  • value.policy_document.statement[].conditions.gateway_group_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.gateway_group_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.gateway_group_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.gateway_group_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.gateway_group_label.options.value (string, optional): The value to compare against the label.

  • value.policy_document.statement[].conditions.secret_provider_label (object, optional): Condition for secret provider label.

  • value.policy_document.statement[].conditions.secret_provider_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.secret_provider_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.secret_provider_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.secret_provider_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.secret_provider_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 9: Condition for Contact Point

  • value.policy_document.statement[].conditions.contact_point_label (object, optional): Condition for contact point label.

  • value.policy_document.statement[].conditions.contact_point_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.contact_point_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.contact_point_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.contact_point_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.contact_point_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 10: Condition for Alert Policy

  • value.policy_document.statement[].conditions.alert_policy_label (object, optional): Condition for alert policy label.

  • value.policy_document.statement[].conditions.alert_policy_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.alert_policy_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.alert_policy_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.alert_policy_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.alert_policy_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 11: Condition for Developer

  • value.policy_document.statement[].conditions.developer_label (object, optional): Condition for developer label.

  • value.policy_document.statement[].conditions.developer_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.developer_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.developer_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.developer_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.developer_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 12: Condition for API Product

  • value.policy_document.statement[].conditions.api_product_label (object, optional): Condition for API product label.

  • value.policy_document.statement[].conditions.api_product_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.api_product_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.api_product_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.api_product_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.api_product_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 13: Condition for CA Certificate

  • value.policy_document.statement[].conditions.ca_certificate_label (object, optional): Condition for CA certificate label.

  • value.policy_document.statement[].conditions.ca_certificate_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.ca_certificate_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.ca_certificate_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.ca_certificate_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.ca_certificate_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 14: Condition for Certificate

  • value.policy_document.statement[].conditions.certificate_label (object, optional): Condition for certificate label.

  • value.policy_document.statement[].conditions.certificate_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.certificate_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.certificate_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.certificate_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.certificate_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 15: Condition for SNI

  • value.policy_document.statement[].conditions.sni_label (object, optional): Condition for SNI label.

  • value.policy_document.statement[].conditions.sni_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.sni_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.sni_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.sni_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.sni_label.options.value (string, optional): The value to compare against the label.

  • anyOf variant 16: Condition for Portal

  • value.policy_document.statement[].conditions.portal_label (object, optional): Condition for portal label.

  • value.policy_document.statement[].conditions.portal_label.type (string, optional): Type of condition.

  • value.policy_document.statement[].conditions.portal_label.options (object, optional): Matching expressions.

  • value.policy_document.statement[].conditions.portal_label.options.key (string, optional): The label key to match against.

  • value.policy_document.statement[].conditions.portal_label.options.operator (string, optional): The comparison operator used for matching the label.

  • value.policy_document.statement[].conditions.portal_label.options.value (string, optional): The value to compare against the label.

  • allOf variant 2

  • value.id (string, optional): The policy ID.

  • value.created_at (integer, optional): The object created timestamp.

  • value.updated_at (integer, optional): The object updated timestamp.

  • 400: Invalid arguments. Error details will be provided in the response.

cURL

curl -X GET '$API_BASE_URL/api/permission_policies/{permission_policy_id}'