List knowledge documents
curl --request GET \
--url https://api.example.com/v1/workspaces/{workspaceId}/knowledge-documents \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/v1/workspaces/{workspaceId}/knowledge-documents"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/workspaces/{workspaceId}/knowledge-documents', 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.example.com/v1/workspaces/{workspaceId}/knowledge-documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.example.com/v1/workspaces/{workspaceId}/knowledge-documents"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/v1/workspaces/{workspaceId}/knowledge-documents")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/workspaces/{workspaceId}/knowledge-documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"contentType": "<string>",
"createdAt": "<string>",
"createdById": "<string>",
"failureReason": "upload_expired",
"fileName": "<string>",
"fileSize": 123,
"id": "<string>",
"knowledgeFolderId": "<string>",
"name": "<string>",
"nbCitations": 123,
"pageId": "<string>",
"reviewStatus": "to_validate",
"status": "pending",
"summary": "<string>",
"type": "text",
"updatedAt": "<string>",
"updatedById": "<string>",
"url": "<string>",
"validatedAt": "<string>",
"validatedById": "<string>",
"workspace": {
"id": "<string>",
"name": "<string>",
"websiteUrl": "<string>"
}
}
],
"pagination": {
"hasMore": true,
"limit": 123,
"page": 123,
"total": 123
}
}List knowledge documents
Returns the knowledge documents of a workspace, paginated, with filters and sort. Deleted and page documents are not listed. On the knowledge base V2, documents being replaced are not listed. Filters, sort and pagination need the V2 knowledge base: without it the full list comes back and they are ignored. Enable knowledge sources in POST /v1/contents/:contentId/atomic settings.
GET
/
v1
/
workspaces
/
{workspaceId}
/
knowledge-documents
List knowledge documents
curl --request GET \
--url https://api.example.com/v1/workspaces/{workspaceId}/knowledge-documents \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/v1/workspaces/{workspaceId}/knowledge-documents"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/workspaces/{workspaceId}/knowledge-documents', 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.example.com/v1/workspaces/{workspaceId}/knowledge-documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.example.com/v1/workspaces/{workspaceId}/knowledge-documents"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/v1/workspaces/{workspaceId}/knowledge-documents")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/workspaces/{workspaceId}/knowledge-documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"contentType": "<string>",
"createdAt": "<string>",
"createdById": "<string>",
"failureReason": "upload_expired",
"fileName": "<string>",
"fileSize": 123,
"id": "<string>",
"knowledgeFolderId": "<string>",
"name": "<string>",
"nbCitations": 123,
"pageId": "<string>",
"reviewStatus": "to_validate",
"status": "pending",
"summary": "<string>",
"type": "text",
"updatedAt": "<string>",
"updatedById": "<string>",
"url": "<string>",
"validatedAt": "<string>",
"validatedById": "<string>",
"workspace": {
"id": "<string>",
"name": "<string>",
"websiteUrl": "<string>"
}
}
],
"pagination": {
"hasMore": true,
"limit": 123,
"page": 123,
"total": 123
}
}Authorizations
Query Parameters
Was this page helpful?