Reloads the specified document from its specified source, contentUri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
This method is a long-running operation. The returned Operation type has the following method-specific fields:
Required. The name of the document to reload. Format: projects/<Project ID>/locations/<Location
ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>
Request body
The request body contains data with the following structure:
JSON representation
{"importGcsCustomMetadata": boolean,"smartMessagingPartialUpdate": boolean,// Union field source can be only one of the following:"contentUri": string// End of list of possible types for union field source.}
Fields
importGcsCustomMetadata
boolean
Optional. Whether to import custom metadata from Google Cloud Storage. Only valid when the document source is Google Cloud Storage URI.
smartMessagingPartialUpdate
boolean
Optional. When enabled, the reload request is to apply partial update to the smart messaging allowlist.
Union field source. The source for document reloading.
If provided, the service will load the contents from the source and update document in the knowledge base.
Reloading from a new document source is allowed for smart messaging documents only. If you want to update the source for other document types, please delete the existing document and create a new one instead. source can be only one of the following:
contentUri
string
Optional. The path of gcs source file for reloading document content. For now, only gcs uri is supported.
For documents stored in Google Cloud Storage, these URIs must have the form gs://<bucket-name>/<object-name>.
Response body
If successful, the response body contains an instance of Operation.
[[["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 endpoint is used to reload a specified document, deleting its previously loaded content and updating it with the provided source, which can be a \u003ccode\u003econtentUri\u003c/code\u003e from Google Cloud Storage.\u003c/p\u003e\n"],["\u003cp\u003eThe operation is long-running, returning an \u003ccode\u003eOperation\u003c/code\u003e type with \u003ccode\u003eKnowledgeOperationMetadata\u003c/code\u003e and \u003ccode\u003eDocument\u003c/code\u003e fields, and it should use the \u003ccode\u003eprojects.knowledgeBases.documents\u003c/code\u003e resource instead of \u003ccode\u003eprojects.agent.knowledgeBases.documents\u003c/code\u003e, which is deprecated.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request for reloading a document is a \u003ccode\u003ePOST\u003c/code\u003e request to a specified URL that includes path parameters for the document's name, following gRPC Transcoding syntax.\u003c/p\u003e\n"],["\u003cp\u003eThe request body for reloading can include options such as importing custom metadata from Google Cloud Storage (\u003ccode\u003eimportGcsCustomMetadata\u003c/code\u003e) and applying partial updates to the smart messaging allowlist (\u003ccode\u003esmartMessagingPartialUpdate\u003c/code\u003e), where the \u003ccode\u003esource\u003c/code\u003e is a union field that defines where the document should be reloaded from.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization to use this endpoint requires one of the specified OAuth scopes: \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/dialogflow\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]