Skip to main content
POST
/
api
/
user
/
courses
Retrieve user conversations
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"
}
'
{
  "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"
      }
    }
  ]
}

Authorizations

x-access-token
string
header
required

JWT token passed in x-access-token header

Body

application/json
institution
string

Institution ObjectId. If omitted, uses the current user's institution.

api
string

Regex filter for the api field on history records (case-insensitive)

Example:

"chat"

Response

Successfully retrieved user courses

success
boolean

Indicates if the request was successful

data
object[]

Array of course objects sorted by last_dialogue_date descending. Courses with course_id=0 are excluded.

message
string

Error message when success is false

error
object

Error object when success is false