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 Google API HTTP annotation 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 description of the service account. Must be fewer than 100 UTF-8 bytes.

etag

string (bytes format)

Used to perform a consistent read-modify-write.

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!

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Identity and Access Management