- [HTTP request](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#body.request_body)
- [Response body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#body.AcquireUserAuthorizationResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#body.aspect_1)
- [RefreshTokenInfo](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#RefreshTokenInfo)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#RefreshTokenInfo.SCHEMA_REPRESENTATION)

Uses the stored refresh token for the user identified by their end-user credentials and the given resource, and returns the generated access token and its details. Takes the access token from cache if available. Rotates the stored refresh token if needed.

### HTTP request

Choose an endpoint:
global us   
`POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/authorizations/*}:acquireUserAuthorization`

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. Resource name of the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations#Authorization`. Format: `projects/{project}/locations/{location}/authorizations/{authorization}` |

### Request body

The request body must be empty.

### Response body

Response message for the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#google.cloud.discoveryengine.v1alpha.AuthorizationService.AcquireUserAuthorization` method.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "refreshTokenInfo": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#RefreshTokenInfo`) }, "accessToken": string, "authorizationUri": string } ``` |

| Fields ||
|---|---|
| `refreshTokenInfo` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.authorizations/acquireUserAuthorization#RefreshTokenInfo`)`` Info about the stored refresh token used to create the access token. |
| `accessToken` | `string` The created access token. |
| `authorizationUri` | `string` A URI, that triggers the authorization flow. Set when the user needs to be (re)authorized. |

### Authorization scopes

Requires one of the following OAuth scopes:

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

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

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `discoveryengine.authorizations.storeUserAuthorization`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## RefreshTokenInfo

Describes a refresh token.

| JSON representation |
|---|
| ``` { "scopes": [ string ] } ``` |

| Fields ||
|---|---|
| `scopes[]` | `string` The list of scopes for this token. |