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

Converses a conversation.

### HTTP request

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

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The resource name of the Conversation to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStoreId}/conversations/{conversationId}`. Use `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStoreId}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a conversations.converse session. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "query": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.conversations#Conversation.TextInput`) }, "servingConfig": string, "conversation": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.conversations#Conversation`) }, "safeSearch": boolean, "userLabels": { string: string, ... }, "summarySpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/ContentSearchSpec#SummarySpec`) }, "filter": string, "boostSpec": { object (`BoostSpec`) } } ``` |

| Fields ||
|---|---|
| `query` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.conversations#Conversation.TextInput`)`` Required. Current user input. |
| `servingConfig` | `string` The resource name of the Serving Config to use. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStoreId}/servingConfigs/{servingConfigId}` If this is not set, the default serving config will be used. |
| `conversation` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.conversations#Conversation`)`` The conversation to be used by auto session only. The name field will be ignored as we automatically assign new name for the conversation in auto session. |
| `safeSearch` | `boolean` Whether to turn on safe search. |
| `userLabels` | `map (key: string, value: string)` The user labels applied to a resource must meet the following requirements: - Each resource can have multiple labels, up to a maximum of 64. - Each label must be a key-value pair. - Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. - Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. - The key portion of a label must be unique. However, you can use the same key with multiple resources. - Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details. |
| `summarySpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/ContentSearchSpec#SummarySpec`)`` A specification for configuring the summary returned in the response. |
| `filter` | `string` The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. This will be used to filter search results which may affect the summary response. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend -- this mapping is defined by the customer in their schema. For example a media customer might have a field 'name' in their schema. In this case the filter would look like this: filter --\> name:'ANY("king kong")' For more information about filtering including syntax and filter operators, see [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) |
| `boostSpec` | ``object (`BoostSpec`)`` Boost specification to boost certain documents in search results which may affect the converse response. For more information on boosting, see [Boosting](https://cloud.google.com/retail/docs/boosting#boost) |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/ConverseConversationResponse`.

### 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.conversations.converse`

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