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

Exchanges OAuth authorization credentials for a refresh token and stores the refresh token and the scopes. The stored data will be keyed by the resource name and the user identifier from the end-user credentials.

### HTTP request

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

<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 contains data with the following structure:

| JSON representation |
|---|
| ``` { "fullRedirectUri": string } ``` |

| Fields ||
|---|---|
| `fullRedirectUri` | `string` Required. The URI the user is redirected to after authorization, including all parameters. E.g., `https://example.com/redir?code=5` |

### Response body

If successful, the response body is empty.

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