Thenameparameter's value depends on the target resource for the request, namelyprojectsororganizations. Each resource type'snamevalue format is described below:
projects.roles.patch:projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}. This method updates onlycustom rolesthat have been created at the project level. Example request URL:https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}
organizations.roles.patch:organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}. This method updates onlycustom rolesthat 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 followingIAMpermission on the specified resourcename:
[[["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 update a custom Role within Google Cloud's Identity and Access Management (IAM) service.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePATCH\u003c/code\u003e HTTP method is used with a specific URL structure that includes either a project ID or an organization ID to update the custom role.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires specifying the \u003ccode\u003ename\u003c/code\u003e of the custom role to be updated, which is a string that depends on whether the role is at the project or organization level.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain an instance of the \u003ccode\u003eRole\u003c/code\u003e, and the response body will also contain an instance of \u003ccode\u003eRole\u003c/code\u003e if the update is successful.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eupdateMask\u003c/code\u003e query parameter is used to specify which fields of the Role have changed during this update, providing a more granular control of the updates.\u003c/p\u003e\n"]]],[],null,["# Method: organizations.roles.patch\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\nUpdates the definition of a custom [Role](/iam/docs/reference/rest/v1/organizations.roles#Role).\n\n### HTTP request\n\n`PATCH https://iam.googleapis.com/v1/{name=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 contains an instance of [Role](/iam/docs/reference/rest/v1/organizations.roles#Role).\n\n### Response body\n\nIf successful, the response body contains an instance of [Role](/iam/docs/reference/rest/v1/organizations.roles#Role).\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)."]]