# Method: users.environments.removePublicKey

- [HTTP request](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/removePublicKey#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/removePublicKey#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/removePublicKey#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/removePublicKey#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/removePublicKey#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/removePublicKey#body.aspect)
- [Try it!](https://docs.cloud.google.com/shell/docs/reference/rest/v1/users.environments/removePublicKey#try-it)

Removes a public SSH key from an environment. Clients will no longer be able to connect to the environment using the corresponding private key. If a key with the same content is not present, this will error with NOT_FOUND.

### HTTP request

`POST https://cloudshell.googleapis.com/v1/{environment=users/*/environments/*}:removePublicKey`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `environment` | `string` Environment this key should be removed from, e.g. `users/me/environments/default`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "key": string } ``` |

| Fields ||
|---|---|
| `key` | `string` Key that should be removed from the environment. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/shell/docs/reference/rest/v1/operations#Operation`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).