API7 Docs

Check if a user has permissions on specific resources

POST /api/allow_access

POST /api/allow_access

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Request Body

application/json

Response Body

application/json

curl -X POST "$API_BASE_URL/api/allow_access" \  -H "Content-Type: application/json" \  -d '{    "hasAccess": {      "resource": "arn:api7:iam:role/767ff422-614b-4c0c-a4ea-287c26c773ba",      "action": "iam:UpdateCustomRole",      "context": {        "role_label": {          "platform": "external"        }      }    }  }'

Successfully checked whether the user has the specified access permissions.

{
  "value": {
    "hasAccess": true
  }
}
Complete operation details and schema variants

POST /api/allow_access

Check if a user has permissions on specific resources

Evaluate whether a user is allowed to perform specified actions on given resources based on current RBAC and policy configuration.

Parameters

Request body

Content type: application/json

  • .*.resource (string, required): An ARN-style identifier that specifies one or multiple resources.
  • .*.action (string, required): A specific permission that defines what operation can be performed on the resource.
  • .*.context (object, optional): Additional conditions or labels used to further narrow down which resources the action applies to, in combination with the resource definition.
  • anyOf variant 1: Context for Gateway Group
  • .*.context.gateway_group_label (object, optional): Gateway group label.
  • anyOf variant 2: Context for Service
  • .*.context.service_label (object, optional): Service label.
  • anyOf variant 3: Context for Service
  • .*.context.gateway_group_label (object, optional): Gateway group label.
  • .*.context.service_label (object, optional): Service label.
  • anyOf variant 4: Context for Role
  • .*.context.role_label (object, optional): Role label.
  • anyOf variant 5: Context for Permission Policy
  • .*.context.permission_policy_label (object, optional): Permission policy label.
  • anyOf variant 6: Context for User
  • .*.context.user_label (object, optional): User label.
  • .*.context.permission_boundaries (array, optional): A list of permission boundaries.
  • anyOf variant 7: Context for Consumer
  • .*.context.gateway_group_label (object, optional): Gateway group label.
  • .*.context.consumer_label (object, optional): Consumer label.
  • anyOf variant 8: Context for Secret
  • .*.context.gateway_group_label (object, optional): Gateway group label.
  • .*.context.secret_provider_label (object, optional): Secret provider label.
  • anyOf variant 9: Context for Contact Point
  • .*.context.contact_point_label (object, optional): Contact point label.
  • anyOf variant 10: Context for Alert Policy
  • .*.context.alert_policy_label (object, optional): Alert policy label.
  • anyOf variant 11: Context for Developer
  • .*.context.developer_label (object, optional): Developer label.
  • anyOf variant 12: Context for API Product
  • .*.context.api_product_label (object, optional): API product label.
  • anyOf variant 13: Context for CA Certificate
  • .*.context.ca_certificate_label (object, optional): CA certificate label.
  • anyOf variant 14: Context for Certificate
  • .*.context.certificate_label (object, optional): Certificate label.
  • anyOf variant 15: Context for SNI
  • .*.context.sni_label (object, optional): SNI label.
  • anyOf variant 16: Context for Portal
  • .*.context.portal_label (object, optional): Portal label.

Responses

  • 200: Successfully checked whether the user has the specified access permissions.
  • allOf variant 1
  • value (object, optional): The specific resource.
  • allOf variant 2
  • value (object, optional):
  • 400: Invalid arguments. Error details will be provided in the response.

cURL

curl -X POST '$API_BASE_URL/api/allow_access'