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"
      }
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.praxis-ai.com/llms.txt

Use this file to discover all available pages before exploring further.

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

allInstitutions
boolean
default:false

When true, search across all institutions the user is enrolled in PLUS the user's personal account (histories with no institution). Overrides the institution field if both are set, and causes course_id to be ignored (cross-twin scope always crosses courses). Populates institution as an object ({_id, name, ainame, picture}) for institutional records, or as {personal: true} for personal-account records.

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)

matched
integer

Only returned when allInstitutions: true. Total number of records matching the search (not capped by limit). Equals total when no search term is provided.

total
integer

Only returned when allInstitutions: true. Total number of records in the searchable scope (ignores the search term; still respects allInstitutions, course_id, before, after, and status/forgotten filters).

message
string

Error message when success is false

error
object

Error object when success is false