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

Imports the specified flow to the specified agent from a binary file.

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`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ImportFlowResponse`

Note: You should always train a flow prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).

### HTTP request

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

<br />

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

**OR**

`POST https://{endpoint}/v3beta1/{parent=projects/*/locations/*/agents/*}/flows: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 flow 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.flows.create` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "importOption": enum (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.flows/import#ImportOption`), "flowImportStrategy": { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.flows/import#FlowImportStrategy`) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "flowUri": string, "flowContent": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `importOption` | ``enum (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.flows/import#ImportOption`)`` Flow import mode. If not specified, `KEEP` is assumed. |
| `flowImportStrategy` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.flows/import#FlowImportStrategy`)`` Optional. Specifies the import strategy used when resolving resource conflicts. |
| Required. The flow to import. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `flowUri` | `string` The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to import flow 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). |
| `flowContent` | `string (https://developers.google.com/discovery/v1/type-format format)` Uncompressed raw byte content for flow. A base64-encoded string. |
| 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).

## ImportOption

Import option.

| Enums ||
|---|---|
| `IMPORT_OPTION_UNSPECIFIED` | Unspecified. Treated as `KEEP`. |
| `KEEP` | Always respect settings in exported flow content. It may cause a import failure if some settings (e.g. custom NLU) are not supported in the agent to import into. |
| `FALLBACK` | Fallback to default settings if some settings are not supported in the agent to import into. E.g. Standard NLU will be used if custom NLU is not available. |

## FlowImportStrategy

The flow import strategy used for resource conflict resolution associated with an `ImportFlowRequest`.

| JSON representation |
|---|
| ``` { "globalImportStrategy": enum (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ImportStrategy`) } ``` |

| Fields ||
|---|---|
| `globalImportStrategy` | ``enum (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ImportStrategy`)`` Optional. Global flow import strategy for resource conflict resolution. The import Import strategy for resource conflict resolution, applied globally throughout the flow. It will be applied for all display name conflicts in the imported content. If not specified, 'CREATE_NEW' is assumed. |