Skip to main content
POST
/
api
/
user
/
histories
Retrieve user conversation histories
curl --request POST \
  --url https://pria.praxislxp.com/api/user/histories \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "limit": 5,
  "course_id": 1750532703472,
  "search": "deploy",
  "tools": false
}
'
{
  "success": true,
  "data": [
    {
      "id": "688b024f7db6fe6e921399e3",
      "created": "2025-07-01T12:00:00.000Z",
      "credits": 1,
      "usage": 150,
      "discount": 0,
      "institution": "60d5ec49f1b2c80015a4d1a1",
      "user": "60d5ec49f1b2c80015a4d1a2",
      "favorite": false,
      "forgotten": false,
      "role_id": "60d5ec49f1b2c80015a4d1a3",
      "role_name": "Student",
      "thumbUpDown": "up",
      "conversation_model": "gpt-4o",
      "success": true,
      "in": {
        "input": "How are you?"
      },
      "out": {
        "outputs": [
          "I am doing wonderful, thank you for asking..."
        ]
      },
      "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
limit
integer

Maximum number of records to return (default 100)

Example:

5

institution
string

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

course_id
number

Course identifier to filter by. When 0, matches records with course_id 0 or null.

Example:

1750532703472

before
number

Epoch timestamp in ms. Returns records created before this date.

Example:

1723019070274

after
number

Epoch timestamp in ms. Returns records created after this date.

Example:

1723019070274

historyId
string

The ObjectId of a specific history record to retrieve

Example:

"688b024f7db6fe6e921399e3"

Free-text search string. Matches against input, inputs, output, and outputs fields (case-insensitive regex).

Example:

"how to deploy"

tools
boolean

When true, returns full tool response data. When false or omitted, tool responses longer than 80 chars are truncated.

Example:

false

Response

Successfully retrieved conversation histories

success
boolean

Indicates if the request was successful

data
object[]

Array of history records sorted oldest-first (dialogs are reversed before returning)

message
string

Error message when success is false

error
object

Error object when success is false