Skip to main content
GET
/
v4
/
knowledge-bases
/
chunks
/
{chunk_id}
Get Chunk and Artifact Information by Chunk ID
curl --request GET \
  --url https://api.egp.scale.com/v4/knowledge-bases/chunks/{chunk_id}
import requests

url = "https://api.egp.scale.com/v4/knowledge-bases/chunks/{chunk_id}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.egp.scale.com/v4/knowledge-bases/chunks/{chunk_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.egp.scale.com/v4/knowledge-bases/chunks/{chunk_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://api.egp.scale.com/v4/knowledge-bases/chunks/{chunk_id}"

req, _ := http.NewRequest("GET", url, nil)

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.egp.scale.com/v4/knowledge-bases/chunks/{chunk_id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.egp.scale.com/v4/knowledge-bases/chunks/{chunk_id}")

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

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "text": "<string>",
  "artifact_id": "<string>",
  "chunk_position": 123,
  "artifact": {
    "knowledge_base_id": "<string>",
    "artifact_name": "<string>",
    "artifact_uri": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>",
    "artifact_id": "<string>",
    "chunking_strategy_config": {
      "strategy": "<string>",
      "separator": "\n\n",
      "chunk_size": 1000,
      "chunk_overlap": 200
    },
    "artifact_uri_public": "<string>",
    "content_modification_identifier": "<string>",
    "status_reason": "<string>",
    "deleted_at": "<string>",
    "tags": {}
  },
  "metadata": {},
  "user_supplied_metadata": {},
  "status_reason": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Path Parameters

chunk_id
string
required

Response

Successful Response

id
string
required

The id of the chunk

text
string
required

The text of the chunk as stored in the database

artifact_id
string
required

The id of the artifact

chunk_position
integer
required

Chunk position

status
enum<string>
required

Status of the chunk. If Failed or Pending, its possible that the chunk does not reflect in OpenSearch

Available options:
Pending,
Completed,
Failed
artifact
Artifact · object
required

The information of the artifact this chunk belongs to

metadata
Metadata · object

Metadata of the chunk which is stored in OpenSearch

user_supplied_metadata
User Supplied Metadata · object

Metadata of the chunk which is stored in the database only provided via custom chunking.

status_reason
string

Status reason of the chunk. May be successful

created_at
string<date-time>

Date and time of chunk creation