Method: projects.serviceAccounts.update

Updates a ServiceAccount.

Currently, only the following fields are updatable: displayName . The etag is mandatory.

HTTP request

PUT https://iam.googleapis.com/v1/{name=projects/*/serviceAccounts/*}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

The resource name of the service account in the following format: projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}.

Requests using - as a wildcard for the PROJECT_ID will infer the project from the account and the ACCOUNT value can be the email address or the uniqueId of the service account.

In responses the resource name will always be in the format projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}.

Request body

The request body contains data with the following structure:

JSON representation
{
  "projectId": string,
  "uniqueId": string,
  "email": string,
  "displayName": string,
  "etag": string,
  "oauth2ClientId": string
}
Fields
projectId

string

The id of the project that owns the service account.

Note: This field is used in responses only. Any value specified here in a request is ignored.

uniqueId

string

The unique and stable id of the service account.

Note: This field is used in responses only. Any value specified here in a request is ignored.

email

string

The email address of the service account.

Note: This field is used in responses only. Any value specified here in a request is ignored.

displayName

string

Optional. A user-specified name for the service account. Must be less than or equal to 100 UTF-8 bytes.

etag

string (bytes format)

Optional. Note: etag is an inoperable legacy field that is only returned for backwards compatibility.

A base64-encoded string.

oauth2ClientId

string

The OAuth2 client id for the service account. This is used in conjunction with the OAuth2 clientconfig API to make three legged OAuth2 (3LO) flows to access the data of Google users.

Note: This field is used in responses only. Any value specified here in a request is ignored.

Response body

If successful, the response body contains an instance of ServiceAccount.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/iam
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Try it!

このページは役立ちましたか?評価をお願いいたします。

フィードバックを送信...

Cloud Identity and Access Management