curl --request GET \
--url https://api.example.com/learnings \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/learnings"
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/learnings', 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/learnings",
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/learnings"
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/learnings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/learnings")
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": [
{
"learning_id": "<string>",
"learning_type": "<string>",
"namespace": "<string>",
"user_id": "<string>",
"agent_id": "<string>",
"team_id": "<string>",
"session_id": "<string>",
"entity_id": "<string>",
"entity_type": "<string>",
"content": {},
"metadata": {},
"created_at": 123,
"updated_at": 123
}
],
"meta": {
"page": 0,
"limit": 20,
"total_pages": 0,
"total_count": 0,
"search_time_ms": 0
}
}{
"detail": "Bad request",
"error_code": "BAD_REQUEST"
}{
"detail": "Unauthenticated access",
"error_code": "UNAUTHENTICATED"
}{
"detail": "Not found",
"error_code": "NOT_FOUND"
}{
"detail": "Validation error",
"error_code": "VALIDATION_ERROR"
}{
"detail": "Internal server error",
"error_code": "INTERNAL_SERVER_ERROR"
}List Learnings
List learning records with pagination and optional filters. For a scoped (non-admin) caller with user isolation enabled, results are bound to that user and also include records with no owner (user_id IS NULL) — this covers global, agent, team, session, and entity-scoped learnings; passing a user_id that differs from the caller is rejected with 403. Admins and unscoped callers see all records (optionally filtered by user_id).
curl --request GET \
--url https://api.example.com/learnings \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/learnings"
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/learnings', 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/learnings",
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/learnings"
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/learnings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/learnings")
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": [
{
"learning_id": "<string>",
"learning_type": "<string>",
"namespace": "<string>",
"user_id": "<string>",
"agent_id": "<string>",
"team_id": "<string>",
"session_id": "<string>",
"entity_id": "<string>",
"entity_type": "<string>",
"content": {},
"metadata": {},
"created_at": 123,
"updated_at": 123
}
],
"meta": {
"page": 0,
"limit": 20,
"total_pages": 0,
"total_count": 0,
"search_time_ms": 0
}
}{
"detail": "Bad request",
"error_code": "BAD_REQUEST"
}{
"detail": "Unauthenticated access",
"error_code": "UNAUTHENTICATED"
}{
"detail": "Not found",
"error_code": "NOT_FOUND"
}{
"detail": "Validation error",
"error_code": "VALIDATION_ERROR"
}{
"detail": "Internal server error",
"error_code": "INTERNAL_SERVER_ERROR"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Filter by learning type
Filter by user ID
Filter by agent ID
Filter by team ID
Filter by session ID
Filter by namespace
Filter by entity ID
Filter by entity type
Page size
1 <= x <= 10001-indexed page number
x >= 1Field to sort by, e.g. created_at or updated_at (the default). An unrecognised field is ignored (the default ordering is used).
Sort order (asc or desc)
asc, desc Database ID to query
The database table to use (requires db_id)
Was this page helpful?