POST {{NEXT_PUBLIC_API_BASE_URL}}/api/conversations/user_id
Get Conversations by User ID
Returns a list of all conversations associated with a specific user’s ID. The user must be authenticated to access this data.
Request Headers
- Content-Type: application/json
- X-CSRFToken: The CSRF token of the authenticated user
Request Body
- user_id (integer, required): The ID of the user
Example:
{
"user_id": 1
}
Responses
200
Returns a list of all conversations associated with the provided user ID.
Example:
[
{
"user_id": 1,
"urls": [
"https://en.wikipedia.org/wiki/Inductive_reasoning"
],
"role": "Student",
"created_at": "Tue, 26 Nov 2024 21:11:40 GMT",
"intent": "Learning about inductive reasoning for a class project.",
"id": 7
},
{
"user_id": 1,
"urls": [
"https://en.wikipedia.org/wiki/Psychoanalysis",
"https://plato.stanford.edu/entries/freud/"
],
"role": "Psychologist",
"created_at": "Tue, 26 Nov 2024 22:13:10 GMT",
"intent": "Researching psychoanalysis for a seminar.",
"id": 8
}
]
401
No user is signed in or the session has expired.
Example:
{
"message": "User not signed in"
}
500
An error occurred while attempting to retrieve the conversations.
Example:
{
"message": "Error getting conversations",
"error": "Some descriptive error message"
}
Last updated on