Poll Knowledge Base Status
curl --request POST \
--url https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"uniqueId": [
"fb45bb1e-bc81-45a8-85be-36b2aa4f289e",
"c2847dcd-636c-4e7a-9217-593ccf2a7bb1"
]
}
'import requests
url = "https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll"
payload = { "uniqueId": ["fb45bb1e-bc81-45a8-85be-36b2aa4f289e", "c2847dcd-636c-4e7a-9217-593ccf2a7bb1"] }
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
uniqueId: ['fb45bb1e-bc81-45a8-85be-36b2aa4f289e', 'c2847dcd-636c-4e7a-9217-593ccf2a7bb1']
})
};
fetch('https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll', 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://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll",
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([
'uniqueId' => [
'fb45bb1e-bc81-45a8-85be-36b2aa4f289e',
'c2847dcd-636c-4e7a-9217-593ccf2a7bb1'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll"
payload := strings.NewReader("{\n \"uniqueId\": [\n \"fb45bb1e-bc81-45a8-85be-36b2aa4f289e\",\n \"c2847dcd-636c-4e7a-9217-593ccf2a7bb1\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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.post("https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"uniqueId\": [\n \"fb45bb1e-bc81-45a8-85be-36b2aa4f289e\",\n \"c2847dcd-636c-4e7a-9217-593ccf2a7bb1\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"uniqueId\": [\n \"fb45bb1e-bc81-45a8-85be-36b2aa4f289e\",\n \"c2847dcd-636c-4e7a-9217-593ccf2a7bb1\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id1": "indexing",
"id2": "indexed"
}
}Knowledge Base
Poll Knowledge Base Status
Retrieves the indexing status for one or more knowledge base sources by their IDs. Use this endpoint to monitor the progress of file uploads, text entries, or website crawls being indexed. **Batch su
POST
/
ai-agents
/
agent-builder
/
knowledge-base
/
status
/
poll
Poll Knowledge Base Status
curl --request POST \
--url https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"uniqueId": [
"fb45bb1e-bc81-45a8-85be-36b2aa4f289e",
"c2847dcd-636c-4e7a-9217-593ccf2a7bb1"
]
}
'import requests
url = "https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll"
payload = { "uniqueId": ["fb45bb1e-bc81-45a8-85be-36b2aa4f289e", "c2847dcd-636c-4e7a-9217-593ccf2a7bb1"] }
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
uniqueId: ['fb45bb1e-bc81-45a8-85be-36b2aa4f289e', 'c2847dcd-636c-4e7a-9217-593ccf2a7bb1']
})
};
fetch('https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll', 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://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll",
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([
'uniqueId' => [
'fb45bb1e-bc81-45a8-85be-36b2aa4f289e',
'c2847dcd-636c-4e7a-9217-593ccf2a7bb1'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll"
payload := strings.NewReader("{\n \"uniqueId\": [\n \"fb45bb1e-bc81-45a8-85be-36b2aa4f289e\",\n \"c2847dcd-636c-4e7a-9217-593ccf2a7bb1\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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.post("https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"uniqueId\": [\n \"fb45bb1e-bc81-45a8-85be-36b2aa4f289e\",\n \"c2847dcd-636c-4e7a-9217-593ccf2a7bb1\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/status/poll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"uniqueId\": [\n \"fb45bb1e-bc81-45a8-85be-36b2aa4f289e\",\n \"c2847dcd-636c-4e7a-9217-593ccf2a7bb1\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id1": "indexing",
"id2": "indexed"
}
}For the complete error reference, see Error Guide.
Authorizations
API Key (i.e. Rest API Key from the Dashboard).
Body
application/json
Array of unique IDs to query
Array of unique IDs to query
Example:
[
"fb45bb1e-bc81-45a8-85be-36b2aa4f289e",
"c2847dcd-636c-4e7a-9217-593ccf2a7bb1"
]Response
200 - application/json
Status for requested unique IDs
The response is of type object.
Was this page helpful?
⌘I