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
)
response = client.knowledge_bases.artifacts.batch_delete(
knowledge_base_id="knowledge_base_id",
artifact_ids=["string"],
)
print(response.artifact_ids)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"),
)
response, err := client.KnowledgeBases.Artifacts.BatchDelete(
context.TODO(),
"knowledge_base_id",
sgp.KnowledgeBaseArtifactBatchDeleteParams{
ArtifactIDs: sgp.F([]string{"string"}),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.ArtifactIDs)
}curl --request POST \
--url https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/batch-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"artifact_ids": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({artifact_ids: ['<string>']})
};
fetch('https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/batch-delete', 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/batch-delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'artifact_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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.post("https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/batch-delete")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"artifact_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/batch-delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"artifact_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"artifact_ids": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Knowledge Bases
Batch Delete Locally Stored Artifacts
POST
/
v4
/
knowledge-bases
/
{knowledge_base_id}
/
artifacts
/
batch-delete
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
)
response = client.knowledge_bases.artifacts.batch_delete(
knowledge_base_id="knowledge_base_id",
artifact_ids=["string"],
)
print(response.artifact_ids)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"),
)
response, err := client.KnowledgeBases.Artifacts.BatchDelete(
context.TODO(),
"knowledge_base_id",
sgp.KnowledgeBaseArtifactBatchDeleteParams{
ArtifactIDs: sgp.F([]string{"string"}),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.ArtifactIDs)
}curl --request POST \
--url https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/batch-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"artifact_ids": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({artifact_ids: ['<string>']})
};
fetch('https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/batch-delete', 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/batch-delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'artifact_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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.post("https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/batch-delete")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"artifact_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/batch-delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"artifact_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"artifact_ids": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
Path Parameters
Body
application/json
List of artifact ids to delete
Required array length:
1 - 100 elementsResponse
Successful Response
List of artifact ids that were deleted
⌘I

