Theparentparameter's value depends on the target resource for the request, namelyroles,projects, ororganizations. Each resource type'sparentvalue format is described below:
roles.list: An empty string. This method doesn't require a resource; it simply returns allpredefined rolesin IAM. Example request URL:https://iam.googleapis.com/v1/roles
projects.roles.list:projects/{PROJECT_ID}. This method lists all project-levelcustom roles. Example request URL:https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles
organizations.roles.list:organizations/{ORGANIZATION_ID}. This method lists all organization-levelcustom 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 followingIAMpermission on the specified resourceparent:
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. WhenFULLis specified, theincludedPermissionsfield is returned, which includes a list of all permissions in the role. The default value isBASIC, which does not return theincludedPermissionsfield.
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 ofListRolesResponse.
[[["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 document details how to list predefined and custom roles using the IAM API, covering both organization and project levels.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request method is \u003ccode\u003eGET\u003c/code\u003e, and the URL structure uses gRPC Transcoding syntax with \u003ccode\u003eparent\u003c/code\u003e as a path parameter to specify the target resource (roles, projects, or organizations).\u003c/p\u003e\n"],["\u003cp\u003eThe request supports optional query parameters such as \u003ccode\u003epageSize\u003c/code\u003e, \u003ccode\u003epageToken\u003c/code\u003e, \u003ccode\u003eview\u003c/code\u003e, and \u003ccode\u003eshowDeleted\u003c/code\u003e to refine the list of roles returned in the response.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must be empty, and the response body contains an instance of \u003ccode\u003eListRolesResponse\u003c/code\u003e upon success.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires either the \u003ccode\u003ehttps://www.googleapis.com/auth/iam\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scopes.\u003c/p\u003e\n"]]],[],null,["# Method: organizations.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=organizations/*}/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)."]]