- [HTTP request](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents/import#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents/import#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents/import#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents/import#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents/import#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents/import#body.aspect)
- [MergeOption](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents/import#MergeOption)
- [Try it!](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents/import#try-it)

Imports the specified intents into the agent.

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

- `metadata`: `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ImportIntentsMetadata`
- `response`: `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ImportIntentsResponse`

### HTTP request

Choose an endpoint:
global   
`POST https://dialogflow.googleapis.com/v3beta1/{parent=projects/*/locations/*/agents/*}/intents:import`

<br />

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

**OR**

`POST https://{endpoint}/v3beta1/{parent=projects/*/locations/*/agents/*}/intents:import`

Where `{endpoint}` is one of the [supported service endpoints](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest#rest_endpoints).

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The agent to import the intents into. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `dialogflow.intents.create` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "mergeOption": enum (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents/import#MergeOption`), // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "intentsUri": string, "intentsContent": { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/InlineSource`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `mergeOption` | ``enum (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents/import#MergeOption`)`` Merge option for importing intents. If not specified, `REJECT` is assumed. |
| Required. The intents to import. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `intentsUri` | `string` The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to import intents from. The format of this URI must be `gs://<bucket-name>/<object-name>`. Dialogflow performs a read operation for the Cloud Storage object on the caller's behalf, so your request authentication must have read permissions for the object. For more information, see [Dialogflow access control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). |
| `intentsContent` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/InlineSource`)`` Uncompressed byte content of intents. |
| End of mutually exclusive fields. ||

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/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).

## MergeOption

Merge option when display name conflicts exist during import.

| Enums ||
|---|---|
| `MERGE_OPTION_UNSPECIFIED` | Unspecified. Should not be used. |
| `REJECT` | DEPRECATED: Please use \[REPORT_CONFLICT\]\[ImportIntentsRequest.REPORT_CONFLICT\] instead. Fail the request if there are intents whose display names conflict with the display names of intents in the agent. > [!WARNING] > This item is deprecated! |
| `REPLACE` | Replace the original intent in the agent with the new intent when display name conflicts exist. |
| `MERGE` | Merge the original intent with the new intent when display name conflicts exist. |
| `RENAME` | Create new intents with new display names to differentiate them from the existing intents when display name conflicts exist. |
| `REPORT_CONFLICT` | Report conflict information if display names conflict is detected. Otherwise, import intents. |
| `KEEP` | Keep the original intent and discard the conflicting new intent when display name conflicts exist. |