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. Note: If the document source is Google Cloud Storage URI, its metadata will be replaced with the custom metadata from Google Cloud Storage if the importGcsCustomMetadata field is set to true in the request.
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,// Union field source can be only one of the following:"gcsSource": {object (GcsSource)}// End of list of possible types for union field source.}
Fields
importGcsCustomMetadata
boolean
Whether to import custom metadata from Google Cloud Storage. Only valid when the document source is Google Cloud Storage URI.
Union field source. The source for document reloading.
Optional. 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:
[[["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 operation reloads a specified document from its source, deleting the previously loaded content and potentially causing side effects even if the content hasn't changed.\u003c/p\u003e\n"],["\u003cp\u003eThe document reload is triggered via a \u003ccode\u003ePOST\u003c/code\u003e request to a specific endpoint with a required document name path parameter in the format \u003ccode\u003eprojects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request body may optionally include a boolean to \u003ccode\u003eimportGcsCustomMetadata\u003c/code\u003e and a \u003ccode\u003egcsSource\u003c/code\u003e to reload from a new source file, with smart messaging documents being the only document type that can change sources during a reload.\u003c/p\u003e\n"],["\u003cp\u003eThe response is a long-running operation that includes \u003ccode\u003emetadata\u003c/code\u003e and \u003ccode\u003eresponse\u003c/code\u003e fields containing information about the document reload, and it requires specific authorization scopes for authentication.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eprojects.agent.knowledgeBases.documents\u003c/code\u003e resource is deprecated and users are instructed to use \u003ccode\u003eprojects.knowledgeBases.documents\u003c/code\u003e instead.\u003c/p\u003e\n"]]],[],null,["# Method: projects.agent.knowledgeBases.documents.reload\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\nReloads 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. Note: If the document source is Google Cloud Storage URI, its metadata will be replaced with the custom metadata from Google Cloud Storage if the `importGcsCustomMetadata` field is set to true in the request.\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`: [KnowledgeOperationMetadata](/dialogflow/es/docs/reference/rest/v2beta1/KnowledgeOperationMetadata)\n- `response`: [Document](/dialogflow/es/docs/reference/rest/v2beta1/projects.agent.knowledgeBases.documents#Document)\n\nNote: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.\n\n### HTTP request\n\n`POST https://{endpoint}/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload`\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)."]]