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

Generates and returns a suggestion for a conversation that does not have a resource created for it.

### HTTP request

Choose an endpoint:
global   
`POST https://dialogflow.googleapis.com/v2beta1/{parent=projects/*/locations/*}/statelessSuggestion:generate`

<br />

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

**OR**

`POST https://{endpoint}/v2beta1/{parent=projects/*/locations/*}/statelessSuggestion: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 ||
|---|---|
| `parent` | `string` Required. The parent resource to charge for the Suggestion's generation. Format: `projects/<Project ID>/locations/<Location ID>`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "contextReferences": { string: { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.conversations#Conversation.ContextReference`) }, ... }, "conversationContext": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.generators#Generator.ConversationContext`) }, "triggerEvents": [ enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/TriggerEvent`) ], "securitySettings": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "generator": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.generators#Generator`) }, "generatorName": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `contextReferences` | ``map (key: string, value: object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.conversations#Conversation.ContextReference`))`` Optional. A section of ingested context information. The key is the name of the context reference and the value contains the contents of the context reference. The key is used to incorporate ingested context references to enhance the generator. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `conversationContext` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.generators#Generator.ConversationContext`)`` Optional. Context of the conversation, including transcripts. |
| `triggerEvents[]` | ``enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/TriggerEvent`)`` Optional. A list of trigger events. Generator will be triggered only if it's trigger event is included here. |
| `securitySettings` | `string` Optional. Name of the CX SecuritySettings which is used to redact generated response. If this field is empty, try to fetch v2 securitySettings, which is a project level setting. If this field is empty and no v2 securitySettings set up in this project, no redaction will be done. Format: `projects/<Project ID>/locations/<Location ID>/securitySettings/<Security Settings ID>`. |
| Generator. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `generator` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.generators#Generator`)`` Uncreated generator. It should be a complete generator that includes all information about the generator. |
| `generatorName` | `string` The resource name of the existing created generator. Format: `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>` |
| End of mutually exclusive fields. ||

### Response body

The response message for `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.statelessSuggestion/generate#google.cloud.dialogflow.v2beta1.Conversations.GenerateStatelessSuggestion`.

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

| JSON representation |
|---|
| ``` { "generatorSuggestion": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/GeneratorSuggestion`) } } ``` |

| Fields ||
|---|---|
| `generatorSuggestion` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/GeneratorSuggestion`)`` Required. Generated suggestion for a conversation. |

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