---
title: "POST /projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount"
method: POST
path: "/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount"
tags: ["instances"]
---

# POST /projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount

`POST /projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount`

Sets the service account on the instance. For more information,
readChanging
the service account and access scopes for an instance.

## Path parameters

- `project` string, required
- `zone` string, required
- `instance` string, required

## Query parameters

- `requestId` string

## Request body

- InstancesSetServiceAccountRequest
  - `email` string — Email address of the service account.
  - `scopes` string[] — The list of scopes to be made available for this service account.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/compute.md) · [All operations](https://skmtc.net/google/apis/compute/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/compute/versions/6120ed8969d4/schema)
