---
title: "POST /v2/projects/{projectsId}/locations/{locationsId}:generateServiceIdentity"
method: POST
path: "/v2/projects/{projectsId}/locations/{locationsId}:generateServiceIdentity"
tags: ["projects"]
---

# POST /v2/projects/{projectsId}/locations/{locationsId}:generateServiceIdentity

`POST /v2/projects/{projectsId}/locations/{locationsId}:generateServiceIdentity`

## Request

- Base URL: `https://tpu.googleapis.com`
- URL: `https://tpu.googleapis.com/v2/projects/{projectsId}/locations/{locationsId}:generateServiceIdentity`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Generates the Cloud TPU service identity for the project.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string

## Request body

- GenerateServiceIdentityRequest: Request for GenerateServiceIdentity.

## Response `200`

Successful response

- GenerateServiceIdentityResponse: Response for GenerateServiceIdentity.
  - `identity` ServiceIdentity: The per-product per-project service identity for Cloud TPU service.
    - `email` string: The email address of the service identity.

---

[API](https://skmtc.dev/google/apis/tpu.md) - [All operations](https://skmtc.dev/google/apis/tpu/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/tpu/revisions/ebe9b0673ab2?raw)
