List Knowledge
curl --request POST \
--url https://composer.personal.ai/lab/api/v1/op/knowledge.list \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"collection": "<string>",
"limit": 123,
"before": "<string>",
"after": "<string>"
}
'import requests
url = "https://composer.personal.ai/lab/api/v1/op/knowledge.list"
payload = {
"collection": "<string>",
"limit": 123,
"before": "<string>",
"after": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': '<content-type>'},
body: JSON.stringify({collection: '<string>', limit: 123, before: '<string>', after: '<string>'})
};
fetch('https://composer.personal.ai/lab/api/v1/op/knowledge.list', 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://composer.personal.ai/lab/api/v1/op/knowledge.list",
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([
'collection' => '<string>',
'limit' => 123,
'before' => '<string>',
'after' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-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://composer.personal.ai/lab/api/v1/op/knowledge.list"
payload := strings.NewReader("{\n \"collection\": \"<string>\",\n \"limit\": 123,\n \"before\": \"<string>\",\n \"after\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://composer.personal.ai/lab/api/v1/op/knowledge.list")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"collection\": \"<string>\",\n \"limit\": 123,\n \"before\": \"<string>\",\n \"after\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://composer.personal.ai/lab/api/v1/op/knowledge.list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"collection\": \"<string>\",\n \"limit\": 123,\n \"before\": \"<string>\",\n \"after\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"collection": "<string>",
"documents": [
{}
]
}Knowledge
List Knowledge
Browse the documents in a knowledge collection
POST
/
lab
/
api
/
v1
/
op
/
knowledge.list
List Knowledge
curl --request POST \
--url https://composer.personal.ai/lab/api/v1/op/knowledge.list \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"collection": "<string>",
"limit": 123,
"before": "<string>",
"after": "<string>"
}
'import requests
url = "https://composer.personal.ai/lab/api/v1/op/knowledge.list"
payload = {
"collection": "<string>",
"limit": 123,
"before": "<string>",
"after": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': '<content-type>'},
body: JSON.stringify({collection: '<string>', limit: 123, before: '<string>', after: '<string>'})
};
fetch('https://composer.personal.ai/lab/api/v1/op/knowledge.list', 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://composer.personal.ai/lab/api/v1/op/knowledge.list",
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([
'collection' => '<string>',
'limit' => 123,
'before' => '<string>',
'after' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-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://composer.personal.ai/lab/api/v1/op/knowledge.list"
payload := strings.NewReader("{\n \"collection\": \"<string>\",\n \"limit\": 123,\n \"before\": \"<string>\",\n \"after\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://composer.personal.ai/lab/api/v1/op/knowledge.list")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"collection\": \"<string>\",\n \"limit\": 123,\n \"before\": \"<string>\",\n \"after\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://composer.personal.ai/lab/api/v1/op/knowledge.list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"collection\": \"<string>\",\n \"limit\": 123,\n \"before\": \"<string>\",\n \"after\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"collection": "<string>",
"documents": [
{}
]
}Overview
Lists the documents in a collection, newest first. To get the next page, pass the oldest document’screated_at as before. A page shorter than limit means there are no more.
Operation name: knowledge.list.
Authorization
Headers
Body
Example Request
{
"limit": 30
}
Response
Each has
id, title, doc_type, subject_id, metadata, created_at, withdrawn_at and chunks. A withdrawn document has withdrawn_at set and no chunks.Example Success Response
{
"collection": "semantic",
"documents": [
{
"id": "c41d2e7a-6b5f-4a3e-8d9c-0b1a2f3e4d5c",
"title": "Autumn menu",
"doc_type": "prose",
"subject_id": null,
"metadata": {},
"created_at": "2026-11-27T10:00:00Z",
"withdrawn_at": null,
"chunks": 6
}
]
}
Example cURL
cURL
curl --request POST 'https://composer.personal.ai/lab/api/v1/op/knowledge.list' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-api-key>' \
--data '{"limit": 30}'
Error Codes
| Code | Description |
|---|---|
| 400 | The body doesn’t match the fields above, or the operation failed. The response body says why. |
| 401 | Missing or invalid API key |
| 403 | This key isn’t allowed to call this operation |