Uploads new intents and entity types without deleting the existing ones. Intents and entity types with the same name are replaced with the new versions from ImportAgentRequest. After the import, the imported draft agent will be trained automatically (unless disabled in agent settings). However, once the import is done, training may not be completed yet. Please call agent.train and wait for the operation it returns in order to train explicitly.
This method is a long-running operation. The returned Operation type has the following method-specific fields:
Required. The project that the agent to import is associated with. Format: projects/<Project ID> or projects/<Project ID>/locations/<Location ID>.
Authorization requires the following IAM permission on the specified resource parent:
dialogflow.agents.import
Request body
The request body contains data with the following structure:
JSON representation
{// Union field agent can be only one of the following:"agentUri": string,"agentContent": string// End of list of possible types for union field agent.}
Fields
Union field agent. Required. The agent to import. agent can be only one of the following:
agentUri
string
The URI to a Google Cloud Storage file containing the agent to import. Note: The URI must start with "gs://".
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-27 UTC."],[[["\u003cp\u003eThis process imports a Dialogflow agent from a ZIP file, either from a Google Cloud Storage URI or from base64-encoded raw content.\u003c/p\u003e\n"],["\u003cp\u003eThe import action replaces existing intents and entity types with matching names without deleting others, and triggers automatic training of the agent's draft version unless disabled.\u003c/p\u003e\n"],["\u003cp\u003eAfter initiating an agent import, the training process may not have concluded; explicit training can be initiated through the \u003ccode\u003eagent.train\u003c/code\u003e method, which will need to be called, and the response waited for.\u003c/p\u003e\n"],["\u003cp\u003eThis is a long-running operation, and it only tracks the completion of the import, not the training; the successful operation returns an empty response.\u003c/p\u003e\n"],["\u003cp\u003eTo perform the import, you must have \u003ccode\u003edialogflow.agents.import\u003c/code\u003e IAM permission on the specified resource, and one of the provided OAuth scopes.\u003c/p\u003e\n"]]],[],null,["# Method: projects.agent.import\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nImports the specified agent from a ZIP file.\n\nUploads new intents and entity types without deleting the existing ones. Intents and entity types with the same name are replaced with the new versions from `ImportAgentRequest`. After the import, the imported draft agent will be trained automatically (unless disabled in agent settings). However, once the import is done, training may not be completed yet. Please call [agent.train](/dialogflow/es/docs/reference/rest/v2beta1/projects.agent/train#google.cloud.dialogflow.v2beta1.Agents.TrainAgent) and wait for the operation it returns in order to train explicitly.\n\nThis 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:\n\n- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)\n- `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)\n\nThe operation only tracks when importing is complete, not when it is done training.\n\nNote: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).\n\n### HTTP request\n\n`POST https://{endpoint}/v2beta1/{parent=projects/*}/agent:import`\n\nWhere `{endpoint}` is one of the [supported service endpoints](/dialogflow/es/docs/reference/rest#rest_endpoints).\n\nThe URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.operations#Operation).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `\n https://www.googleapis.com/auth/dialogflow`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]