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

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

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

Sets name of an instance.

## Path parameters

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

## Query parameters

- `requestId` string

## Request body

- InstancesSetNameRequest
  - `currentName` string — The current name of this resource, used to prevent conflicts. Provide the latest name when making a request to change name.
  - `name` string — The name to be applied to the instance. Needs to be RFC 1035 compliant.

## 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)
