- [HTTP request](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations.suggestions/generate#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations.suggestions/generate#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations.suggestions/generate#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations.suggestions/generate#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations.suggestions/generate#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations.suggestions/generate#body.aspect)
- [Try it!](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations.suggestions/generate#try-it)

Generates all the suggestions using generators configured in the conversation profile. A generator is used only if its trigger event is matched.

### HTTP request

Choose an endpoint:
global   
`POST https://dialogflow.googleapis.com/v2/{conversation=projects/*/conversations/*}/suggestions:generate`

<br />

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

**OR**

`POST https://{endpoint}/v2/{conversation=projects/*/conversations/*}/suggestions:generate`

Where `{endpoint}` is one of the [supported service endpoints](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest#rest_endpoints).

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

### Path parameters

| Parameters ||
|---|---|
| `conversation` | `string` Required. The conversation for which the suggestions are generated. Format: `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>`. The conversation must be created with a conversation profile which has generators configured in it to be able to get suggestions. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "latestMessage": string, "triggerEvents": [ enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/TriggerEvent`) ] } ``` |

| Fields ||
|---|---|
| `latestMessage` | `string` Optional. The name of the latest conversation message for which the request is triggered. Format: `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>/messages/<Message ID>`. |
| `triggerEvents[]` | ``enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/TriggerEvent`)`` Optional. A list of trigger events. Only generators configured in the conversationProfile whose triggerEvent is listed here will be triggered. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/GenerateSuggestionsResponse`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/dialogflow`

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