Activate or deactivate a knowledge document
curl --request PATCH \
--url https://api.instaview.sk/agents/{id}/knowledge/{documentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"isActive": false
}
'import requests
url = "https://api.instaview.sk/agents/{id}/knowledge/{documentId}"
payload = { "isActive": False }
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({isActive: false})
};
fetch('https://api.instaview.sk/agents/{id}/knowledge/{documentId}', 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.instaview.sk/agents/{id}/knowledge/{documentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'isActive' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.instaview.sk/agents/{id}/knowledge/{documentId}"
payload := strings.NewReader("{\n \"isActive\": false\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))
}HttpResponse<String> response = Unirest.patch("https://api.instaview.sk/agents/{id}/knowledge/{documentId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isActive\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/agents/{id}/knowledge/{documentId}")
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/json'
request.body = "{\n \"isActive\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"title": "Benefits and perks",
"status": "READY",
"isActive": true,
"source": "UPLOAD",
"createdAt": "2026-08-08T10:15:00.000Z",
"fileName": "benefits-and-perks.pdf",
"mimeType": "application/pdf",
"sizeBytes": 482133
}Agent Knowledge Base
Update Knowledge Document
Activates or deactivates a document. Deactivating keeps the document but stops it being attached to new calls. Only completed (READY) documents can be toggled.
PATCH
/
agents
/
{id}
/
knowledge
/
{documentId}
Activate or deactivate a knowledge document
curl --request PATCH \
--url https://api.instaview.sk/agents/{id}/knowledge/{documentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"isActive": false
}
'import requests
url = "https://api.instaview.sk/agents/{id}/knowledge/{documentId}"
payload = { "isActive": False }
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({isActive: false})
};
fetch('https://api.instaview.sk/agents/{id}/knowledge/{documentId}', 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.instaview.sk/agents/{id}/knowledge/{documentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'isActive' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.instaview.sk/agents/{id}/knowledge/{documentId}"
payload := strings.NewReader("{\n \"isActive\": false\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))
}HttpResponse<String> response = Unirest.patch("https://api.instaview.sk/agents/{id}/knowledge/{documentId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isActive\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/agents/{id}/knowledge/{documentId}")
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/json'
request.body = "{\n \"isActive\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"title": "Benefits and perks",
"status": "READY",
"isActive": true,
"source": "UPLOAD",
"createdAt": "2026-08-08T10:15:00.000Z",
"fileName": "benefits-and-perks.pdf",
"mimeType": "application/pdf",
"sizeBytes": 482133
}Activates or deactivates a document without deleting it.
Overview
Deactivating keeps the document and its stored file — it simply stops being attached to new calls. Use it to park seasonal or draft material you expect to bring back, instead of deleting and re-uploading. Calls already in progress are unaffected: a document is resolved when a call starts.Example
curl -X PATCH https://api.instaview.sk/agents/$AGENT_ID/knowledge/$DOCUMENT_ID \
-H "Authorization: Bearer $INSTAVIEW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "isActive": false }'
Pending Documents
Only completed (READY) documents can be toggled. Activating a document whose file never arrived would produce something that lists as usable and fails when a call tries to read it, so it is rejected with a 409 instead.
Error Scenarios
- 404 Not Found: No such document on that agent
- 409 Conflict: The document’s upload has not been completed yet
Related Resources
Path Parameters
Query Parameters
Body
application/json
Response
Document updated
UPLOAD for a file attached through the API or the dashboard. CV for the document the platform produces from a contact's processed CV (contacts only); a CV document can be deactivated but not renamed or deleted. Always UPLOAD on an agent's knowledge base.
Available options:
UPLOAD, CV Example:
"UPLOAD"