- [HTTP request](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#body.aspect_1)
- [UserEventInputConfig](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#UserEventInputConfig)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#UserEventInputConfig.SCHEMA_REPRESENTATION)
- [UserEventInlineSource](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#UserEventInlineSource)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#UserEventInlineSource.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2/projects.locations.catalogs.userEvents/import.md.txt#try-it)

Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events.

`Operation.response` is of type `ImportResponse`. Note that it is possible for a subset of the items to be successfully inserted. `Operation.metadata` is of type `ImportMetadata`.

### HTTP request

`POST https://retail.googleapis.com/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:import`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. `projects/1234/locations/global/catalogs/default_catalog` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "inputConfig": { object (`UserEventInputConfig`) }, "errorsConfig": { object (`ImportErrorsConfig`) } } ``` |

| Fields ||
|---|---|
| `inputConfig` | ``object (`UserEventInputConfig`)`` Required. The desired input location of the data. |
| `errorsConfig` | ``object (`ImportErrorsConfig`)`` The desired location of errors incurred during the Import. Cannot be set for inline user event imports. |

### Response body

If successful, the response body contains an instance of `Operation`.

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

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:

- `retail.userEvents.import`

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

## UserEventInputConfig

The input config source for user events.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "userEventInlineSource": { object (`UserEventInlineSource`) }, "gcsSource": { object (`GcsSource`) }, "bigQuerySource": { object (`BigQuerySource`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| The source of the input. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `userEventInlineSource` | ``object (`UserEventInlineSource`)`` Required. The Inline source for the input content for UserEvents. |
| `gcsSource` | ``object (`GcsSource`)`` Required. Google Cloud Storage location for the input content. |
| `bigQuerySource` | ``object (`BigQuerySource`)`` Required. BigQuery input source. |
| End of mutually exclusive fields. ||

## UserEventInlineSource

The inline source for the input config for userEvents.import method.

| JSON representation |
|---|
| ``` { "userEvents": [ { object (`UserEvent`) } ] } ``` |

| Fields ||
|---|---|
| `userEvents[]` | ``object (`UserEvent`)`` Required. A list of user events to import. Recommended max of 10k items. |