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

Updates/Creates multiple entity types in the specified agent.

This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/BatchUpdateEntityTypesResponse`

Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

### HTTP request

Choose an endpoint:
global   
`POST https://dialogflow.googleapis.com/v2/{parent=projects/*/agent}/entityTypes:batchUpdate`

<br />

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

**OR**

`POST https://{endpoint}/v2/{parent=projects/*/agent}/entityTypes:batchUpdate`

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 name of the agent to update or create entity types in. Format: `projects/<Project ID>/agent`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `dialogflow.entityTypes.batchUpdate` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "languageCode": string, "updateMask": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "entityTypeBatchUri": string, "entityTypeBatchInline": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/EntityTypeBatch`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `languageCode` | `string` Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Optional. The mask to control which fields get updated. This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |
| The source of the entity type batch. For each entity type in the batch: - If `name` is specified, we update an existing entity type. - If `name` is not specified, we create a new entity type. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `entityTypeBatchUri` | `string` The URI to a Google Cloud Storage file containing entity types to update or create. The file format can either be a serialized proto (of EntityBatch type) or a JSON object. Note: The URI must start with "gs://". |
| `entityTypeBatchInline` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/EntityTypeBatch`)`` The collection of entity types to update or create. |
| End of mutually exclusive fields. ||

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.locations.operations#Operation`.

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