API7 Docs
API7 GatewayAPI7 Enterprise Admin APIsGet a role

Get a role

GET /api/roles/{role_id}

GET /api/roles/{role_id}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Path Parameters

role_id*string

Role ID.

Length1 <= length

Response Body

application/json

curl -X GET "$API_BASE_URL/api/roles/4b9b56d1-147e-49ef-bcaa-88cc5bcf403f"

Successfully retrieved the role.

{
  "value": {
    "id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
    "name": "View Consumer",
    "desc": "This role allows users to view comsumers.",
    "labels": {
      "version": "v2",
      "env": "prod"
    },
    "type": "custom",
    "policies": [
      "super-admin-permission-policy"
    ],
    "created_at": 1742288232,
    "updated_at": 1742288235
  }
}
Complete operation details and schema variants

GET /api/roles/{role_id}

Get a role

Get detailed information for a specific RBAC role. This includes role metadata used to grant permissions through user-role assignments. Required IAM Permission: Action iam:GetRole, Resource arn:api7:iam:role/%s

Parameters

  • role_id (path, string, required): Role ID.

Responses

  • 200: Successfully retrieved the role.
  • allOf variant 1
  • value (object, optional): The specific resource.
  • allOf variant 2
  • value (object, optional): The specification of the role of the user.
  • value.id (string, optional): The object ID.
  • value.name (string, optional): The role name.
  • value.desc (string, optional): The object description.
  • value.labels (object, optional): Key-value pairs of labels.
  • value.type (string, optional): Type of the role.
  • value.policies (array, optional): The policies of the role.
  • 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/roles/{role_id}'