- [HTTP request](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.dataStores.userEvents/import#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.dataStores.userEvents/import#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.dataStores.userEvents/import#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.dataStores.userEvents/import#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.dataStores.userEvents/import#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.dataStores.userEvents/import#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.dataStores.userEvents/import#body.aspect_1)

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

Choose an endpoint:
global us   
`POST https://discoveryengine.googleapis.com/v1beta/{parent=projects/*/locations/*/dataStores/*}/userEvents:import`

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "errorConfig": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/ImportErrorConfig`) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "inlineSource": { object (`InlineSource`) }, "gcsSource": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/GcsSource`) }, "bigquerySource": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/BigQuerySource`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `errorConfig` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/ImportErrorConfig`)`` The desired location of errors incurred during the Import. Cannot be set for inline user event imports. |
| Required - The desired input source of the user event data. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `inlineSource` | ``object (`InlineSource`)`` The Inline source for the input content for UserEvents. |
| `gcsSource` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/GcsSource`)`` Cloud Storage location for the input content. |
| `bigquerySource` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/BigQuerySource`)`` BigQuery input source. |
| End of mutually exclusive fields. ||

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/discoveryengine.assist.readwrite`
- `https://www.googleapis.com/auth/discoveryengine.readwrite`
- `https://www.googleapis.com/auth/discoveryengine.serving.readwrite`

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

- `discoveryengine.userEvents.import`

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