POST/organization/projects/{project_id}/service_accounts/{service_account_id}

Update a project service account

Updates a service account in a project. Supply name or role to change the corresponding account property; the role must be member or owner.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters · 2 body fields
project_idstringrequired
The ID of the project containing the service account.
service_account_idstringrequired
The ID of the service account to update.

Service account properties to update; supply name, role, or both.

namestringoptional
The updated service account name.
rolestringoptional
The updated service account role.
Allowed:memberowner

5 status codes
200Returns the updated service account object, including its ID, name, role, and creation timestamp.
objectstringrequired
The object type, which is always `organization.project.service_account`
Allowed:organization.project.service_account
idstringrequired
The identifier, which can be referenced in API endpoints
namestringrequired
The name of the service account
rolestringrequired
`owner`, `member`, or `none`
Allowed:ownermembernone
created_atintegerrequired
The Unix timestamp (in seconds) of when the service account was created
400Returned when the update is invalid or the project is archived.
errorobjectrequired
403Returned when the caller does not have permission to update the project service account.
errorobjectrequired
Details about the permission error.
404Returned when the project or service account is not found.
errorobjectrequired
429Returned when management requests exceed the allowed rate; reduce the request rate and try again later.
errorobjectrequired

Error handling

A 400 is returned for an invalid update or an archived project; a 403 when the authenticated user lacks permission; a 404 when the project or service account is not found; and a 429 when management requests are being sent too frequently. If supplied, role must be member or owner. The project_id path parameter and service_account_id path parameter must identify the project and service account to update.