---
title: "POST /v1/{+name}:generateIdToken"
method: POST
path: "/v1/{+name}:generateIdToken"
tags: ["projects"]
---

# POST /v1/{+name}:generateIdToken

`POST /v1/{+name}:generateIdToken`

Generates an OpenID Connect ID token for a service account.

## Path parameters

- `name` string, required

## Request body

- GenerateIdTokenRequest
  - `includeEmail` boolean — Include the service account email in the token. If set to `true`, the token will contain `email` and `email_verified` claims.
  - `organizationNumberIncluded` boolean — Include the organization number of the service account in the token. If set to `true`, the token will contain a `google.organization_number` claim. The value of the claim will be `null` if the service account isn't associated with an organization.
  - `delegates` string[] — The sequence of service accounts in a delegation chain. Each service account must be granted the `roles/iam.serviceAccountTokenCreator` role on its next service account in the chain. The last service account in the chain must be granted the `roles/iam.serviceAccountTokenCreator` role on the service account that is specified in the `name` field of the request. The delegates must have the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.
  - `audience` string — Required. The audience for the token, such as the API or account that this token grants access to.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/iamcredentials.md) · [All operations](https://skmtc.dev/google/apis/iamcredentials/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/iamcredentials/revisions/470ff76e345d/schema)
