Gets the IAM policy that is attached to a ServiceAccount. This IAM policy specifies which principals have access to the service account.
This method does not tell you whether the service account has been granted any roles on other resources. To check whether a service account has role grants on a resource, use the getIamPolicy method for that resource. For example, to view the role grants for a project, call the Resource Manager API's projects.getIamPolicy method.
HTTP request
POST https://iam.googleapis.com/v1/{resource=projects/*/serviceAccounts/*}:getIamPolicy
[[["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-01-16 UTC."],[[["This API retrieves the IAM policy for a specified ServiceAccount, detailing which principals have access."],["The HTTP request is a POST operation using gRPC Transcoding syntax and requires a resource path parameter."],["An optional `GetPolicyOptions` object can be provided via query parameters to configure the `serviceAccounts.getIamPolicy` method."],["The request body should be empty, while the response body will contain a `Policy` instance upon successful execution."],["Authorization requires either the `https://www.googleapis.com/auth/iam` or `https://www.googleapis.com/auth/cloud-platform` OAuth scope."]]],[]]