Get conversations
GET
/v1/conversation/user/{userId}
const url = 'https://api.foldspace.ai/v1/conversation/user/example?page=1&size=20&sortBy=lastInteractionTime&direction=DESC';const options = {method: 'GET', headers: {'X-FOLDSPACE-API-KEY': '<X-FOLDSPACE-API-KEY>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.foldspace.ai/v1/conversation/user/example?page=1&size=20&sortBy=lastInteractionTime&direction=DESC' \ --header 'X-FOLDSPACE-API-KEY: <X-FOLDSPACE-API-KEY>'Retrieves user conversations.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” userId
required
string
User ID for which to retrieve conversations
Query Parameters
Section titled “Query Parameters ” page
integer format: int32
Page number for paginated results
Example
1 size
integer format: int32
Page size for paginated results
Example
20 sortBy
string
Field to sort results by
Example
lastInteractionTime direction
string
Sort direction (ASC or DESC)
Example
DESCResponses
Section titled “ Responses ”Conversations retrieved successfully
Media type application/json
object
data
Array<object>
object
pageNumber
integer format: int32
pageSize
integer format: int32
paginationToken
string
Examples
Example Example PageResultDto<AiChatDto>
Example PageResultDto
{ "items": [ { "id": "9305b94f-1a57-4bcd-8b06-0bebaf7007aa", "userId": "user_1234", "name": "Support Conversation", "product": "X7B69NRTTBM7", "environment": 1, "eventOrigin": 100, "context": {}, "startTime": 1734539909141, "lastInteractionTime": 1734539999999, "status": "ACTIVE", "messages": [], "copilotId": "cp_789", "copilotApiName": "ChatGPT", "lastModifiedDate": 1734539999999, "version": 1, "channel": "WEB", "read": false } ], "pageNumber": 1, "pageSize": 20, "totalElements": 1, "totalPages": 1}Unauthorized
Media type */*
string
Example
{ "error": "Unauthorized"}No conversations found for user
Media type */*
string
Example
{ "error": "Conversations not found"}Rate limit exceeded for subscription
Media type */*
string
Example
{ "error": "Rate limit exceeded for subscription"}Internal server error
Media type */*
string
Example
{ "error": "Internal server error"}