The name parameter's value depends on the target resource for the request, namely roles, projects, or organizations. Each resource type's name value format is described below:
roles.get: roles/{ROLE_NAME}. This method returns results from all predefined roles in IAM. Example request URL: https://iam.googleapis.com/v1/roles/{ROLE_NAME}
projects.roles.get: projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}. This method returns only custom roles that have been created at the project level. Example request URL: https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}
organizations.roles.get: organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}. This method returns only custom roles that have been created at the organization level. Example request URL: https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}
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 name:
iam.roles.get
Request body
The request body must be empty.
Response body
If successful, the response body contains an instance of Role.
[[["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 retrieve the definition of a specific Role using the IAM API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGET\u003c/code\u003e HTTP request method is used, with the URL structure determined by the resource type (roles, projects, or organizations).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ename\u003c/code\u003e parameter in the URL specifies the target resource and follows different formats based on the resource type and whether it's a predefined or custom role.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must be empty, and a successful request will return a Role instance in the response body.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization for this operation requires specific IAM permissions (\u003ccode\u003eiam.roles.get\u003c/code\u003e) and one of two specified OAuth scopes.\u003c/p\u003e\n"]]],[],null,[]]