List all roles
GET /api/roles
GET /api/rolesInteractive request editor loads with JavaScript.
In: header
Query Parameters
Page number of the listed resources. Used together with page_size. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.
int321 <= valueNumber of resources listed per page. Used together with page. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.
int321 <= valueOrder to list the resources by. The sorting index follows the configuration of order_by.
"desc"Value in
- "asc"
- "desc"
Index to order resources by.
"updated_at"Value in
- "created_at"
- "updated_at"
Condition to search resources by.
Label(s) to filter resources by. The format is labels[key]=value and should be URL-encoded.
1 <= lengthResponse Body
application/json
curl -X GET "$API_BASE_URL/api/roles?search=version%253Dv2"Successfully retrieved the paginated list of roles.
{
"total": 1,
"list": [
{
"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
}
]
}Invalid arguments. Error details will be provided in the response.
Complete operation details and schema variants
GET /api/roles
List all roles
List RBAC roles with pagination and filtering. Results include built-in roles (Super Admin, Admin, Viewer) and custom roles.
Required IAM Permission: Action iam:GetRole, Resource arn:api7:iam:role/%s
Parameters
page(query, integer, optional): Page number of the listed resources. Used together withpage_size. For example, when there are 13 resources in total, if the query parameters arepage=1&page_size=10, the GET response will show the routetotalas13and display 10 resources in the first page. If the query parameters arepage=2&page_size=10, the GET response will show the routetotalas13and display 3 resources in the second page.page_size(query, integer, optional): Number of resources listed per page. Used together withpage. For example, when there are 13 resources in total, if the query parameters arepage=1&page_size=10, the GET response will show the routetotalas13and display 10 resources in the first page. If the query parameters arepage=2&page_size=10, the GET response will show the routetotalas13and display 3 resources in the second page.direction(query, string, optional): Order to list the resources by. The sorting index follows the configuration oforder_by.order_by(query, string, optional): Index to order resources by.search(query, string, optional): Condition to search resources by.labels(query, string, optional): Label(s) to filter resources by. The format islabels[key]=valueand should be URL-encoded.
Responses
200: Successfully retrieved the paginated list of roles.- allOf variant 1
list(array, optional): An array of resources.total(integer, optional): Total number of objects.- allOf variant 2
list(array, optional): An array of roles.list[].id(string, optional): The object ID.list[].name(string, optional): The role name.list[].desc(string, optional): The object description.list[].labels(object, optional): Key-value pairs of labels.list[].type(string, optional): Type of the role.list[].policies(array, optional): The policies of the role.list[].created_at(integer, optional): The object created timestamp.list[].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'