curl --request PUT \
--url https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"entity_names": [
"<string>"
],
"published_at": 123,
"content_at": 123,
"time_periods": [
"<string>"
],
"summary": "<string>",
"external_user": "<string>",
"document_scope": 123,
"language": "<string>",
"custom_data": {}
}
'import requests
url = "https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata"
payload = {
"title": "<string>",
"entity_names": ["<string>"],
"published_at": 123,
"content_at": 123,
"time_periods": ["<string>"],
"summary": "<string>",
"external_user": "<string>",
"document_scope": 123,
"language": "<string>",
"custom_data": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
entity_names: ['<string>'],
published_at: 123,
content_at: 123,
time_periods: ['<string>'],
summary: '<string>',
external_user: '<string>',
document_scope: 123,
language: '<string>',
custom_data: {}
})
};
fetch('https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'entity_names' => [
'<string>'
],
'published_at' => 123,
'content_at' => 123,
'time_periods' => [
'<string>'
],
'summary' => '<string>',
'external_user' => '<string>',
'document_scope' => 123,
'language' => '<string>',
'custom_data' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"entity_names\": [\n \"<string>\"\n ],\n \"published_at\": 123,\n \"content_at\": 123,\n \"time_periods\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"external_user\": \"<string>\",\n \"document_scope\": 123,\n \"language\": \"<string>\",\n \"custom_data\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"entity_names\": [\n \"<string>\"\n ],\n \"published_at\": 123,\n \"content_at\": 123,\n \"time_periods\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"external_user\": \"<string>\",\n \"document_scope\": 123,\n \"language\": \"<string>\",\n \"custom_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"entity_names\": [\n \"<string>\"\n ],\n \"published_at\": 123,\n \"content_at\": 123,\n \"time_periods\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"external_user\": \"<string>\",\n \"document_scope\": 123,\n \"language\": \"<string>\",\n \"custom_data\": {}\n}"
response = http.request(request)
puts response.read_body{
"org_id": "<string>",
"user_id": "<string>",
"dataset_id": "<string>",
"file_id": "<string>",
"document_id": "<string>",
"created_at": 123,
"updated_at": 123,
"overall_summarize_enabled": true,
"smart_indexing_mode": 0,
"smart_indexing_enabled": true,
"split_media_enabled": true,
"pdf_parsing_mode": 2,
"pdf_parsing_element_types": [
1,
2
],
"read_pdf_pages": "<string>",
"audio_parsing_mode": 123,
"audio_chunk_mode": 1,
"name": "<string>",
"document_type": 1,
"next_step": true,
"llm": {},
"metadata_info": {},
"task_priority": 123,
"description": "",
"summary": "",
"step_status": 100,
"status": 1,
"process_status": 100,
"version": 2,
"splitter_type": 1,
"splitter": {},
"sections": [],
"content_text": "<string>",
"trim_text": true
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Update Knowledge Document Metadata
Update a document’s metadata and rebuild its retrieval tags
curl --request PUT \
--url https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"entity_names": [
"<string>"
],
"published_at": 123,
"content_at": 123,
"time_periods": [
"<string>"
],
"summary": "<string>",
"external_user": "<string>",
"document_scope": 123,
"language": "<string>",
"custom_data": {}
}
'import requests
url = "https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata"
payload = {
"title": "<string>",
"entity_names": ["<string>"],
"published_at": 123,
"content_at": 123,
"time_periods": ["<string>"],
"summary": "<string>",
"external_user": "<string>",
"document_scope": 123,
"language": "<string>",
"custom_data": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
entity_names: ['<string>'],
published_at: 123,
content_at: 123,
time_periods: ['<string>'],
summary: '<string>',
external_user: '<string>',
document_scope: 123,
language: '<string>',
custom_data: {}
})
};
fetch('https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'entity_names' => [
'<string>'
],
'published_at' => 123,
'content_at' => 123,
'time_periods' => [
'<string>'
],
'summary' => '<string>',
'external_user' => '<string>',
'document_scope' => 123,
'language' => '<string>',
'custom_data' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"entity_names\": [\n \"<string>\"\n ],\n \"published_at\": 123,\n \"content_at\": 123,\n \"time_periods\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"external_user\": \"<string>\",\n \"document_scope\": 123,\n \"language\": \"<string>\",\n \"custom_data\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"entity_names\": [\n \"<string>\"\n ],\n \"published_at\": 123,\n \"content_at\": 123,\n \"time_periods\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"external_user\": \"<string>\",\n \"document_scope\": 123,\n \"language\": \"<string>\",\n \"custom_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-spectra.duplik.cn/v1/knowledge/{knowledge_id}/document/{document_id}/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"entity_names\": [\n \"<string>\"\n ],\n \"published_at\": 123,\n \"content_at\": 123,\n \"time_periods\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"external_user\": \"<string>\",\n \"document_scope\": 123,\n \"language\": \"<string>\",\n \"custom_data\": {}\n}"
response = http.request(request)
puts response.read_body{
"org_id": "<string>",
"user_id": "<string>",
"dataset_id": "<string>",
"file_id": "<string>",
"document_id": "<string>",
"created_at": 123,
"updated_at": 123,
"overall_summarize_enabled": true,
"smart_indexing_mode": 0,
"smart_indexing_enabled": true,
"split_media_enabled": true,
"pdf_parsing_mode": 2,
"pdf_parsing_element_types": [
1,
2
],
"read_pdf_pages": "<string>",
"audio_parsing_mode": 123,
"audio_chunk_mode": 1,
"name": "<string>",
"document_type": 1,
"next_step": true,
"llm": {},
"metadata_info": {},
"task_priority": 123,
"description": "",
"summary": "",
"step_status": 100,
"status": 1,
"process_status": 100,
"version": 2,
"splitter_type": 1,
"splitter": {},
"sections": [],
"content_text": "<string>",
"trim_text": true
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Knowledge base ID
Document to update
Body
Document title. Passing it also renames the document
Tags. Values written as "key:value" drive metadata pre-filtering at retrieval time
Visibility scope of the document
Free-form key-values. Stored, indexed and returned, but never used for filtering. Replaced as a whole, not deep merged
Changing it re-triggers parsing. 1: page, 2: section (recommended), 3: section v2
1, 2, 3 Changing it re-triggers parsing. 1: transcript, 2: speaker diarization
1, 2 Response
Successful Response
2020Generate an overall summary. Boolean
Smart indexing mode. 0: disabled (recommended), 1: standard, 2: advanced
Enable smart indexing. Boolean. Takes effect only together with smart_indexing_mode 2 (advanced); leaving it false is recommended unless the corpus needs it, as it adds noticeable processing time and token cost
Generate media segments. Boolean
PDF parsing mode. 1: page, 2: section (recommended), 3: section v2
pdf parsing element list, eg: [1, 2]. 1: table, 2: image, 3: formula
read pdf pages, Example: '1,3,4' or '1,4-end' or 'all'
audio parsing mode, 1: transcript, 2: speaker diarization
256next step
task priority
512