The parent parameter's value depends on the target resource for the request, namely roles, projects, or organizations. Each resource type's parent value format is described below:
roles.list: An empty string. This method doesn't require a resource; it simply returns all predefined roles in IAM. Example request URL: https://iam.googleapis.com/v1/roles
projects.roles.list: projects/{PROJECT_ID}. This method lists all project-level custom roles. Example request URL: https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles
organizations.roles.list: organizations/{ORGANIZATION_ID}. This method lists all organization-level custom roles. Example request URL: https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles
Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID.
Authorization requires the following IAM permission on the specified resource parent:
iam.roles.list
Query parameters
Parameters
pageSize
integer
Optional limit on the number of roles to include in the response.
The default is 300, and the maximum is 1,000.
pageToken
string
Optional pagination token returned in an earlier ListRolesResponse.
Optional view for the returned Role objects. When FULL is specified, the includedPermissions field is returned, which includes a list of all permissions in the role. The default value is BASIC, which does not return the includedPermissions field.
showDeleted
boolean
Include Roles that have been deleted.
Request body
The request body must be empty.
Response body
If successful, the response body contains an instance of ListRolesResponse.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-21 UTC."],[[["\u003cp\u003eThis page details how to list predefined and custom Identity and Access Management (IAM) roles using the \u003ccode\u003eGET https://iam.googleapis.com/v1/{parent=projects/*}/roles\u003c/code\u003e HTTP request.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eparent\u003c/code\u003e path parameter determines whether to list roles at the \u003ccode\u003eroles\u003c/code\u003e, \u003ccode\u003eprojects\u003c/code\u003e, or \u003ccode\u003eorganizations\u003c/code\u003e level, with specific URL formats for each context.\u003c/p\u003e\n"],["\u003cp\u003eQuery parameters, such as \u003ccode\u003epageSize\u003c/code\u003e, \u003ccode\u003epageToken\u003c/code\u003e, \u003ccode\u003eview\u003c/code\u003e, and \u003ccode\u003eshowDeleted\u003c/code\u003e, can be used to filter and control the roles included in the response.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must be empty, and a successful response returns a \u003ccode\u003eListRolesResponse\u003c/code\u003e object containing the requested role information.\u003c/p\u003e\n"],["\u003cp\u003eAccess to list roles requires specific OAuth scopes, either \u003ccode\u003ehttps://www.googleapis.com/auth/iam\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e, along with the \u003ccode\u003eiam.roles.list\u003c/code\u003e permission.\u003c/p\u003e\n"]]],[],null,["# Method: projects.roles.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Examples](#examples)\n- [Try it!](#try-it)\n\nLists every predefined [Role](/iam/docs/reference/rest/v1/organizations.roles#Role) that IAM supports, or every custom role that is defined for an organization or project.\n\n### HTTP request\n\n`GET https://iam.googleapis.com/v1/{parent=projects/*}/roles`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Query parameters\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [ListRolesResponse](/iam/docs/reference/rest/v1/ListRolesResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/iam`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]