Skip to content

Get conversations

Open in ChatGPT Open in Claude
GET
/v1/conversation/user/{userId}
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.

userId
required
string

User ID for which to retrieve conversations

page
integer format: int32
default: 1

Page number for paginated results

Example
1
size
integer format: int32
default: 20

Page size for paginated results

Example
20
sortBy
string
default: lastInteractionTime

Field to sort results by

Example
lastInteractionTime
direction
string
default: DESC

Sort direction (ASC or DESC)

Example
DESC

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