curl --request POST \
--url https://pria.praxislxp.com/api/user/courses \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"institution": "60d5ec49f1b2c80015a4d1a1"
}
'import requests
url = "https://pria.praxislxp.com/api/user/courses"
payload = { "institution": "60d5ec49f1b2c80015a4d1a1" }
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({institution: '60d5ec49f1b2c80015a4d1a1'})
};
fetch('https://pria.praxislxp.com/api/user/courses', 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://pria.praxislxp.com/api/user/courses",
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([
'institution' => '60d5ec49f1b2c80015a4d1a1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <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://pria.praxislxp.com/api/user/courses"
payload := strings.NewReader("{\n \"institution\": \"60d5ec49f1b2c80015a4d1a1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<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://pria.praxislxp.com/api/user/courses")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"institution\": \"60d5ec49f1b2c80015a4d1a1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/user/courses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"institution\": \"60d5ec49f1b2c80015a4d1a1\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"course_id": 1750532703472,
"course_name": "Conversation 123",
"history_count": 12,
"last_dialogue_date": "2025-07-01T12:00:00.000Z",
"assistant": {
"_id": "60d5ec49f1b2c80015a4d1a4",
"name": "My Assistant",
"liked_count": 5,
"picture_url": "https://example.com/avatar.png"
}
}
]
}{
"success": false,
"message": "Error getting courses invalid ObjectId",
"error": {}
}{
"success": false,
"message": "Authentication Required!"
}Retrieve user conversations
Gets a grouped list of all conversations (courses) for the authenticated user. Each course includes its history count, last dialogue date, and the most recently used assistant (so callers can restore conversation context on the next turn). Courses with course_id=0 are filtered out of results. Institution scoping: pass an ObjectId to scope to a twin, explicit null/empty to scope to personal history only, or omit the field to fall back to the user’s current institution.
curl --request POST \
--url https://pria.praxislxp.com/api/user/courses \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"institution": "60d5ec49f1b2c80015a4d1a1"
}
'import requests
url = "https://pria.praxislxp.com/api/user/courses"
payload = { "institution": "60d5ec49f1b2c80015a4d1a1" }
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({institution: '60d5ec49f1b2c80015a4d1a1'})
};
fetch('https://pria.praxislxp.com/api/user/courses', 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://pria.praxislxp.com/api/user/courses",
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([
'institution' => '60d5ec49f1b2c80015a4d1a1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <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://pria.praxislxp.com/api/user/courses"
payload := strings.NewReader("{\n \"institution\": \"60d5ec49f1b2c80015a4d1a1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<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://pria.praxislxp.com/api/user/courses")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"institution\": \"60d5ec49f1b2c80015a4d1a1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/user/courses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"institution\": \"60d5ec49f1b2c80015a4d1a1\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"course_id": 1750532703472,
"course_name": "Conversation 123",
"history_count": 12,
"last_dialogue_date": "2025-07-01T12:00:00.000Z",
"assistant": {
"_id": "60d5ec49f1b2c80015a4d1a4",
"name": "My Assistant",
"liked_count": 5,
"picture_url": "https://example.com/avatar.png"
}
}
]
}{
"success": false,
"message": "Error getting courses invalid ObjectId",
"error": {}
}{
"success": false,
"message": "Authentication Required!"
}Authorizations
JWT token passed in x-access-token header
Body
Institution ObjectId. Three-state semantics: (1) valid ObjectId scopes to that twin, (2) explicit null/empty scopes to personal/null history, (3) field omitted falls back to the user's current institution (or personal if none).
Response
Successfully retrieved user courses
Was this page helpful?