curl --request POST \
--url https://api.yourdomain.com/api/chats \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "New Project Discussion",
"chatId": "custom_chat_id_123"
}'
const response = await fetch('https://api.yourdomain.com/api/chats', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "New Project Discussion",
chatId: "custom_chat_id_123"
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "New Project Discussion",
"chatId": "custom_chat_id_123"
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Chat created successfully",
"chat": {
"id": "custom_chat_id_123",
"name": "New Project Discussion",
"createdAt": "2024-01-17T10:30:00Z",
"updatedAt": "2024-01-17T10:30:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
Chat Management
Create Chat
Creates a new chat for the authenticated user
POST
/
api
/
chats
curl --request POST \
--url https://api.yourdomain.com/api/chats \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "New Project Discussion",
"chatId": "custom_chat_id_123"
}'
const response = await fetch('https://api.yourdomain.com/api/chats', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "New Project Discussion",
chatId: "custom_chat_id_123"
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "New Project Discussion",
"chatId": "custom_chat_id_123"
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Chat created successfully",
"chat": {
"id": "custom_chat_id_123",
"name": "New Project Discussion",
"createdAt": "2024-01-17T10:30:00Z",
"updatedAt": "2024-01-17T10:30:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
Body Parameters
string
required
Chat name
string
Optional custom chat ID (if not provided, one will be generated)
Response
boolean
Indicates if the chat was created successfully
string
Success or error message
object
The newly created chat object
curl --request POST \
--url https://api.yourdomain.com/api/chats \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "New Project Discussion",
"chatId": "custom_chat_id_123"
}'
const response = await fetch('https://api.yourdomain.com/api/chats', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "New Project Discussion",
chatId: "custom_chat_id_123"
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "New Project Discussion",
"chatId": "custom_chat_id_123"
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Chat created successfully",
"chat": {
"id": "custom_chat_id_123",
"name": "New Project Discussion",
"createdAt": "2024-01-17T10:30:00Z",
"updatedAt": "2024-01-17T10:30:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
⌘I

