curl --request GET \
--url 'https://api.yourdomain.com/api/chats?limit=20&offset=0' \
--header 'Authorization: Bearer <token>'
const response = await fetch('https://api.yourdomain.com/api/chats?limit=20&offset=0', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats"
headers = {"Authorization": "Bearer <token>"}
params = {"limit": 20, "offset": 0}
response = requests.get(url, headers=headers, params=params)
data = response.json()
{
"success": true,
"chats": [
{
"id": "chat_123abc",
"name": "Project Discussion",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T14:20:00Z"
}
],
"nextOffset": 20,
"hasMore": false,
"total": 15,
"message": "Chats retrieved successfully"
}
{
"success": false,
"chats": [],
"hasMore": false,
"total": 0
}
Chat Management
List Chats
Retrieves all chats for the authenticated user with pagination
GET
/
api
/
chats
curl --request GET \
--url 'https://api.yourdomain.com/api/chats?limit=20&offset=0' \
--header 'Authorization: Bearer <token>'
const response = await fetch('https://api.yourdomain.com/api/chats?limit=20&offset=0', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats"
headers = {"Authorization": "Bearer <token>"}
params = {"limit": 20, "offset": 0}
response = requests.get(url, headers=headers, params=params)
data = response.json()
{
"success": true,
"chats": [
{
"id": "chat_123abc",
"name": "Project Discussion",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T14:20:00Z"
}
],
"nextOffset": 20,
"hasMore": false,
"total": 15,
"message": "Chats retrieved successfully"
}
{
"success": false,
"chats": [],
"hasMore": false,
"total": 0
}
Query Parameters
number
default:20
Number of results per page
number
default:0
Pagination offset
Response
boolean
Indicates if the request was successful
array
Array of chat objects
number
Offset for the next page of results
boolean
Indicates if there are more results available
number
Total number of chats
string
Response message
curl --request GET \
--url 'https://api.yourdomain.com/api/chats?limit=20&offset=0' \
--header 'Authorization: Bearer <token>'
const response = await fetch('https://api.yourdomain.com/api/chats?limit=20&offset=0', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats"
headers = {"Authorization": "Bearer <token>"}
params = {"limit": 20, "offset": 0}
response = requests.get(url, headers=headers, params=params)
data = response.json()
{
"success": true,
"chats": [
{
"id": "chat_123abc",
"name": "Project Discussion",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T14:20:00Z"
}
],
"nextOffset": 20,
"hasMore": false,
"total": 15,
"message": "Chats retrieved successfully"
}
{
"success": false,
"chats": [],
"hasMore": false,
"total": 0
}
⌘I

