Skip to main content
POST
/
datasets
/
{dataset_id}
/
documents
/
{document_id}
/
update-by-file
{
  "document": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "position": 123,
    "data_source_type": "<string>",
    "data_source_info": {},
    "dataset_process_rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "created_from": "<string>",
    "created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created_at": 123,
    "tokens": 123,
    "indexing_status": "<string>",
    "error": "<string>",
    "enabled": true,
    "disabled_at": 123,
    "disabled_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "archived": true,
    "display_status": "<string>",
    "word_count": 123,
    "hit_count": 123,
    "doc_form": "<string>"
  },
  "batch": "<string>"
}

Authorizations

Authorization
string
header
required

API Key authentication. For all API requests, include your API Key in the Authorization HTTP Header, prefixed with 'Bearer '. Example: Authorization: Bearer {API_KEY}. Strongly recommend storing your API Key on the server-side, not shared or stored on the client-side, to avoid possible API-Key leakage that can lead to serious consequences.

Path Parameters

dataset_id
string<uuid>
required

The ID of the knowledge base containing the document.

document_id
string<uuid>
required

The ID of the document to update.

Body

multipart/form-data
data
string

A JSON string containing optional document name and processing rules. See UpdateDocumentByFileRequestData schema.

Example:

"{\"name\":\"new_name.txt\",\"process_rule\":{\"mode\":\"automatic\"}}"

file
file

The new file to upload.

Response

200 - application/json

Document updated successfully.

document
object
batch
string

A batch identifier for tracking indexing progress.