---
title: "This is used when the user is already authenticated and would like to
create bearer tokens for distribution"
method: POST
path: "/oauth/generate_token"
tags: ["oauth"]
---

# This is used when the user is already authenticated and would like to
create bearer tokens for distribution

`POST /oauth/generate_token`

Generates an oauth token

## Request body

- OauthGenerateTokenRequest — Oauth token generate request
  - `scopes` string[], required
  - `client_name` string, required — client name of the Oauth Client
  - `client_description` string, required — client description of the Oauth Client
  - `expires_in` integer — Token expiration time in seconds

## Response `200`

Success

- OauthGenerateTokenResponse — Oauth token generate response
  - `client_secret` string, required — client secret of the Oauth Client
  - `oauth_token` OauthToken, required — Oauth token information
    - `access_token` string, required — access_token to be used for accessing gateway
    - `token_type` string, required — Only value possible is "bearer".
    - `expires_in` integer, required — Token expiration time in seconds
    - `refresh_token` string, required — refresh_token which can used to get new token
    - `scopes` string[], required
  - `client_id` string, required — client id of the Oauth Client

## Other responses

- `default` — Internal Error

---

[API](https://skmtc.net/nutanix/apis/nutanix-intentful-api.md) · [All operations](https://skmtc.net/nutanix/apis/nutanix-intentful-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nutanix/nutanix-intentful-api/versions/40395083ab31/schema)
