Skip to main content
PATCH
/
knowledge
/
content
/
{content_id}
Update Content
curl --request PATCH \
  --url https://api.example.com/knowledge/content/{content_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'name=<string>' \
  --data 'description=<string>' \
  --data 'metadata=<string>' \
  --data 'reader_id=<string>'
import requests

url = "https://api.example.com/knowledge/content/{content_id}"

payload = {
"name": "<string>",
"description": "<string>",
"metadata": "<string>",
"reader_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}

response = requests.patch(url, data=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
name: '<string>',
description: '<string>',
metadata: '<string>',
reader_id: '<string>'
})
};

fetch('https://api.example.com/knowledge/content/{content_id}', 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.example.com/knowledge/content/{content_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "name=%3Cstring%3E&description=%3Cstring%3E&metadata=%3Cstring%3E&reader_id=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-www-form-urlencoded"
],
]);

$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.example.com/knowledge/content/{content_id}"

payload := strings.NewReader("name=%3Cstring%3E&description=%3Cstring%3E&metadata=%3Cstring%3E&reader_id=%3Cstring%3E")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.example.com/knowledge/content/{content_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("name=%3Cstring%3E&description=%3Cstring%3E&metadata=%3Cstring%3E&reader_id=%3Cstring%3E")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/knowledge/content/{content_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "name=%3Cstring%3E&description=%3Cstring%3E&metadata=%3Cstring%3E&reader_id=%3Cstring%3E"

response = http.request(request)
puts response.read_body
{
  "id": "3c2fc685-d451-4d47-b0c0-b9a544c672b7",
  "name": "example.pdf",
  "description": "",
  "type": "application/pdf",
  "size": "251261",
  "metadata": {},
  "access_count": 1,
  "status": "completed",
  "status_message": "",
  "created_at": "2025-09-08T15:22:53Z",
  "updated_at": "2025-09-08T15:22:54Z"
}
{
"detail": "Bad request",
"error_code": "BAD_REQUEST"
}
{
"detail": "Unauthenticated access",
"error_code": "UNAUTHENTICATED"
}
{
"detail": "Not found",
"error_code": "NOT_FOUND"
}
{
"detail": "Validation error",
"error_code": "VALIDATION_ERROR"
}
{
"detail": "Internal server error",
"error_code": "INTERNAL_SERVER_ERROR"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

content_id
string
required

Content ID

Query Parameters

db_id
string | null

Database ID to use

knowledge_id
string | null

Knowledge base ID to use

Body

application/x-www-form-urlencoded
name
string | null

Content name

description
string | null

Content description

metadata
string | null

Content metadata as JSON string

reader_id
string | null

ID of the reader to use for processing

Response

Content updated successfully

id
string
required

Unique identifier for the content

name
string | null

Name of the content

description
string | null

Description of the content

type
string | null

MIME type of the content

size
string | null

Size of the content in bytes

linked_to
string | null

ID of related content if linked

metadata
Metadata · object | null

Additional metadata as key-value pairs

access_count
integer | null

Number of times content has been accessed

Required range: x >= 0
status
enum<string> | null

Processing status of the content

Available options:
processing,
completed,
failed
status_message
string | null

Status message or error details

created_at
string<date-time> | null

Timestamp when content was created

updated_at
string<date-time> | null

Timestamp when content was last updated