Some products and features are in the process of being renamed. Generative playbook and flow features are also being migrated to a single consolidated console. See the details.
Required. The name of the agent to restore into. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>.
Authorization requires the following IAM permission on the specified resource name:
dialogflow.agents.restore
Request body
The request body contains data with the following structure:
JSON representation
{"restoreOption": enum (RestoreOption),// Union field agent can be only one of the following:"agentUri": string,"agentContent": string,"gitSource": {object (GitSource)}// End of list of possible types for union field agent.}
Agent restore mode. If not specified, KEEP is assumed.
Union field agent. Required. The agent to restore. agent can be only one of the following:
agentUri
string
The Google Cloud Storage URI to restore agent 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.
Always respect the settings from the exported agent file. It may cause a restoration failure if some settings (e.g. model type) are not supported in the target agent.
FALLBACK
Fallback to default settings if some settings are not supported in the target agent.
[[["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 API allows restoring an agent, replacing the existing one with data from a binary file or a Git branch, removing all current resources.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request is a POST operation using a specific endpoint and agent name path parameters, requiring \u003ccode\u003edialogflow.agents.restore\u003c/code\u003e IAM permission.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires the \u003ccode\u003eagent\u003c/code\u003e field which can be a Google Cloud Storage URI, base64-encoded agent content, or a \u003ccode\u003eGitSource\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003erestoreOption\u003c/code\u003e field in the request body allows choosing between \u003ccode\u003eKEEP\u003c/code\u003e or \u003ccode\u003eFALLBACK\u003c/code\u003e for handling unsupported settings during restoration.\u003c/p\u003e\n"],["\u003cp\u003eA successful restore operation returns an \u003ccode\u003eOperation\u003c/code\u003e object, and the process is a long-running operation.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.agents.restore\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- [GitSource](#GitSource)\n - [JSON representation](#GitSource.SCHEMA_REPRESENTATION)\n- [RestoreOption](#RestoreOption)\n- [Try it!](#try-it)\n\nRestores the specified agent from a binary file.\n\nReplaces the current agent with a new one. Note that all existing resources in agent (e.g. intents, entity types, flows) will be removed.\n\nThis 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:\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\nNote: You should always train a flow prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).\n\n### HTTP request\n\n`POST https://{endpoint}/v3beta1/{name=projects/*/locations/*/agents/*}:restore`\n\nWhere `{endpoint}` is one of the [supported service endpoints](/dialogflow/cx/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/cx/docs/reference/rest/v3beta1/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).\n\nGitSource\n---------\n\nSettings for restoring from a git branch\n\nRestoreOption\n-------------\n\nRestore option."]]