- [HTTP request](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/media/upload.md.txt#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/media/upload.md.txt#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/media/upload.md.txt#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/media/upload.md.txt#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/media/upload.md.txt#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/media/upload.md.txt#body.UploadConversationImageResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/media/upload.md.txt#body.aspect)
- [Try it!](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/media/upload.md.txt#try-it)

This is an experimental feature. Please contact Google before using it. Uploads an image for the conversation to use as a source of information.

### HTTP request

- Upload URI, for media upload requests:  
  `POST https://retail.googleapis.com/upload/v2alpha/{catalog=projects/*/locations/*/catalogs/*}:uploadConversationImage`
- Metadata URI, for metadata-only requests:  
  `POST https://retail.googleapis.com/v2alpha/{catalog=projects/*/locations/*/catalogs/*}:uploadConversationImage`

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

### Path parameters

| Parameters ||
|---|---|
| `catalog` | `string` Required. Full resource name of the catalog, such as `projects/*/locations/global/catalogs/default_catalog`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "conversationId": string, "visitorId": string, "mimeType": string, "sizeBytes": string, "imageBytes": string } ``` |

| Fields ||
|---|---|
| `conversationId` | `string` Optional. The conversation id of the conversation to upload the image for. If not provided, the image upload will start a new conversation and return the conversation id in the response. |
| `visitorId` | `string` Required. A unique identifier for tracking visitors. This should be the same identifier as `UserEvent.visitor_id`. |
| `mimeType` | `string` Optional. The mime type of the image to be uploaded. |
| `sizeBytes` | `string (int64 format)` Optional. The size of the image in bytes. |
| `imageBytes` | `string (bytes format)` Optional. The image content provided inline. Also supports passing base64 encoded image bytes. See an example here: (<https://cloud.google.com/vertex-ai/docs/general/base64)>. A base64-encoded string. |

### Response body

This is an experimental feature. Please contact Google before using it. Response message for `ConversationalSearchService.UploadConversationImage` method.

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

| JSON representation |
|---|
| ``` { "conversationImageId": string, "conversationId": string } ``` |

| Fields ||
|---|---|
| `conversationImageId` | `string` The conversation image id of the uploaded image. |
| `conversationId` | `string` The conversation id of the conversation to upload the image for. |

### Authorization scopes

Requires the following OAuth scope:

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

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