- [HTTP request](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.knowledgeBases.documents/reload#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.knowledgeBases.documents/reload#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.knowledgeBases.documents/reload#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.knowledgeBases.documents/reload#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.knowledgeBases.documents/reload#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.knowledgeBases.documents/reload#body.aspect)
- [Try it!](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.knowledgeBases.documents/reload#try-it)

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](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:

- `metadata`: `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/KnowledgeOperationMetadata`
- `response`: `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.agent.knowledgeBases.documents#Document`

Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`.

### HTTP request

Choose an endpoint:
global   
`POST https://dialogflow.googleapis.com/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}:reload`

<br />

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

**OR**

`POST https://{endpoint}/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}:reload`

Where `{endpoint}` is one of the [supported service endpoints](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest#rest_endpoints).

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` 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, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "gcsSource": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/GcsSource`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `importGcsCustomMetadata` | `boolean` Whether to import custom metadata from Google Cloud Storage. Only valid when the document source is Google Cloud Storage URI. |
| 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. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `gcsSource` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/GcsSource`)`` The path for a Cloud Storage source file for reloading document content. If not provided, the Document's existing source will be reloaded. |
| End of mutually exclusive fields. ||

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.operations#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/dialogflow`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).