- [HTTP request](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#body.RunAssistantResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#body.aspect_1)
- [RunAssistantRequest.InteractionType](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#RunAssistantRequest.InteractionType)
- [AssistantOutput](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#AssistantOutput)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#AssistantOutput.SCHEMA_REPRESENTATION)

Runs the assistant agent for the specified assistant session.

### HTTP request

`POST https://ces.googleapis.com/v1beta/{app=projects/*/locations/*/apps/*}:runAssistant`

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

### Path parameters

| Parameters ||
|---|---|
| `app` | `string` Required. The app to run assistant for. Format: `projects/{project}/locations/{location}/apps/{app}` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "assistantSession": string, "message": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps.assistantSessions#AssistantMessage`) }, "interactionType": enum (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#RunAssistantRequest.InteractionType`) } ``` |

| Fields ||
|---|---|
| `assistantSession` | `string` Required. The assistant session to be used to run the assistant. Format: `projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistantSession}` |
| `message` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps.assistantSessions#AssistantMessage`)`` Required. The message to send to the assistant agent. |
| `interactionType` | ``enum (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#RunAssistantRequest.InteractionType`)`` Optional. Different interaction types for the assistant message. |

### Response body

Response message for `https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#google.cloud.ces.v1beta.AssistantService.RunAssistant`.

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

| JSON representation |
|---|
| ``` { "output": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#AssistantOutput`) }, "state": enum (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps.assistantSessions#AssistantSessionState`) } ``` |

| Fields ||
|---|---|
| `output` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps/runAssistant#AssistantOutput`)`` Required. The output from the assistant agent. |
| `state` | ``enum (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps.assistantSessions#AssistantSessionState`)`` Output only. The status of the assistant session. |

### Authorization scopes

Requires one of the following OAuth scopes:

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

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 `app` resource:

- `ces.apps.update`

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

## RunAssistantRequest.InteractionType

The type of interaction for the message sent to the assistant.

| Enums ||
|---|---|
| `INTERACTION_TYPE_UNSPECIFIED` | The default value. This value is used if the type is not specified. |
| `NEW_MESSAGE` | The message is a user input. User input is provided in the chunk list. |
| `POLL` | The message is for polling the state of the assistant session. |
| `DISMISS` | The message is to dismiss the assistant session pending review. This will change the state of the assistant session to idle. |

## AssistantOutput

The output from the assistant agent.

| JSON representation |
|---|
| ``` { "message": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps.assistantSessions#AssistantMessage`) }, "userResponseSuggestions": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps.assistantSessions#UserResponseSuggestions`) } } ``` |

| Fields ||
|---|---|
| `message` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps.assistantSessions#AssistantMessage`)`` Required. The response from the assistant agent. |
| `userResponseSuggestions` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1beta/projects.locations.apps.assistantSessions#UserResponseSuggestions`)`` Output only. Suggested user responses from the assistant agent. |