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 call is used to restore an agent from a binary file, replacing the existing agent and removing all current resources like intents and flows.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request for restoring an agent is a \u003ccode\u003ePOST\u003c/code\u003e operation to a specific endpoint using gRPC Transcoding syntax, with the agent's name as a required path parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires a \u003ccode\u003erestoreOption\u003c/code\u003e (which can be \u003ccode\u003eKEEP\u003c/code\u003e or \u003ccode\u003eFALLBACK\u003c/code\u003e) and the agent content, specified either as a Google Cloud Storage URI, raw byte content, or a \u003ccode\u003eGitSource\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful restoration returns an \u003ccode\u003eOperation\u003c/code\u003e object, which is a long-running operation, with an empty \u003ccode\u003eStruct\u003c/code\u003e for metadata and an \u003ccode\u003eEmpty\u003c/code\u003e message for response.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization for this operation requires the \u003ccode\u003edialogflow.agents.restore\u003c/code\u003e IAM permission and one of the specified OAuth scopes.\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 flows prior to sending them queries. See the [training documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).\n\n### HTTP request\n\n`POST https://{endpoint}/v3/{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/v3/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."]]