Skip to main content
PATCH
/
v1
/
knowledge-bases
/
{kb_id}
Update Kb
curl --request PATCH \
  --url https://api-tokyo.oneinbox.ai/v1/knowledge-bases/{kb_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "chunk_size": 2080,
  "multilingual": true
}
'
import requests

url = "https://api-tokyo.oneinbox.ai/v1/knowledge-bases/{kb_id}"

payload = {
    "name": "<string>",
    "chunk_size": 2080,
    "multilingual": True
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({name: '<string>', chunk_size: 2080, multilingual: true})
};

fetch('https://api-tokyo.oneinbox.ai/v1/knowledge-bases/{kb_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-tokyo.oneinbox.ai/v1/knowledge-bases/{kb_id}"

	payload := strings.NewReader("{\n  \"name\": \"<string>\",\n  \"chunk_size\": 2080,\n  \"multilingual\": true\n}")

	req, _ := http.NewRequest("PATCH", 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))

}
{
  "kb_id": "<string>",
  "name": "<string>",
  "chunk_size": 123,
  "multilingual": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "total_tokens": 0,
  "mode": "stuff",
  "sources": [
    {
      "source_id": "<string>",
      "kb_id": "<string>",
      "type": "<string>",
      "source": "<string>",
      "chunk_count": 123,
      "status": "<string>",
      "error_message": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "file_name": "<string>",
      "mime_type": "<string>",
      "file_size": 123,
      "token_count": 0
    }
  ]
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}

Authorizations

Authorization
string
header
required

Your API key sent as a Bearer credential — Authorization: Bearer <api_key>, where <api_key> starts with oi_sk_ (create one via POST /v1/api-keys). Although the field is labelled 'token', paste your API key here. A dashboard JWT is also accepted on this header for the same endpoints.

Path Parameters

kb_id
string<uuid>
required

Body

application/json
name
string | null
Required string length: 1 - 255
chunk_size
integer | null
Required range: 64 <= x <= 4096
multilingual
boolean | null

Response

Successful Response

kb_id
string
required
name
string
required
chunk_size
integer
required
multilingual
boolean
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
total_tokens
integer
default:0
mode
string
default:stuff
sources
KBSourceResponse · object[]