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

Uses the per-user refresh token minted with `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/acquireAndStoreRefreshToken#google.cloud.discoveryengine.v1alpha.DataConnectorService.AcquireAndStoreRefreshToken` to generate and return a new access token and its details. Takes the access token from cache if available. Rotates the stored refresh token if needed. uses the end user identity to return the user specific access token. Does *not* return the credentials configured by the administrator. Used by action execution and UI.

### HTTP request

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

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The resource name of the connector for which a token is queried. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "scope": string, "action": string } ``` |

| Fields ||
|---|---|
| `scope` | `string` Optional. The scope to request for the access token. scope will override default scope if specified. |
| `action` | `string` Optional. The tool/action name being executed. If provided, the server will check the required scopes of the action and dynamically trigger incremental authorization if they are missing. |

### Response body

Response message for the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/acquireAccessToken#google.cloud.discoveryengine.v1alpha.DataConnectorService.AcquireAccessToken` 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/RefreshTokenInfo`) }, "accessToken": string } ``` |

| Fields ||
|---|---|
| `refreshTokenInfo` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/RefreshTokenInfo`)`` Info about the stored refresh token used to create the access token. |
| `accessToken` | `string` The created access token. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/discoveryengine.assist.readwrite`
- `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.dataConnectors.acquireAccessToken`

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