Skip to main content
DELETE
/
v4
/
knowledge-bases
/
{knowledge_base_id}
/
artifacts
/
{artifact_id}
/
chunks
/
{chunk_id}
Python
import os
from scale_gp import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
chunk = client.knowledge_bases.artifacts.chunks.delete(
    chunk_id="chunk_id",
    knowledge_base_id="knowledge_base_id",
    artifact_id="artifact_id",
)
print(chunk.artifact_id)
package main

import (
"context"
"fmt"

"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)

func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
chunk, err := client.KnowledgeBases.Artifacts.Chunks.Delete(
context.TODO(),
"knowledge_base_id",
"artifact_id",
"chunk_id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", chunk.ArtifactID)
}
curl --request DELETE \
--url https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}/chunks/{chunk_id} \
--header 'x-api-key: <api-key>'
const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};

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

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

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.delete("https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}/chunks/{chunk_id}")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "deleted": true,
  "artifact_id": "<string>",
  "chunk_id": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Path Parameters

knowledge_base_id
string
required
artifact_id
string
required
chunk_id
string
required

Response

Successful Response

deleted
boolean
required

Whether or not the artifact was successfully deleted

artifact_id
string
required

The ID of the artifact from which the chunk was deleted

chunk_id
string
required

The ID of the chunk that was deleted