curl --request PATCH \
--url https://api.yourdomain.com/api/chats/chat_123abc \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Updated Chat Name"
}'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "Updated Chat Name"
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {"name": "Updated Chat Name"}
response = requests.patch(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Chat updated successfully",
"chat": {
"id": "chat_123abc",
"name": "Updated Chat Name",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-17T11:45:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Chat not found"
}
Chat Management
Update Chat
Updates a specific chat for the authenticated user
PATCH
/
api
/
chats
/
{id}
curl --request PATCH \
--url https://api.yourdomain.com/api/chats/chat_123abc \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Updated Chat Name"
}'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "Updated Chat Name"
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {"name": "Updated Chat Name"}
response = requests.patch(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Chat updated successfully",
"chat": {
"id": "chat_123abc",
"name": "Updated Chat Name",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-17T11:45:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Chat not found"
}
Path Parameters
string
required
Chat ID to update
Body Parameters
string
required
Updated chat name
Response
boolean
Indicates if the chat was updated successfully
string
Success or error message
object
The updated chat object
curl --request PATCH \
--url https://api.yourdomain.com/api/chats/chat_123abc \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Updated Chat Name"
}'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "Updated Chat Name"
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {"name": "Updated Chat Name"}
response = requests.patch(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Chat updated successfully",
"chat": {
"id": "chat_123abc",
"name": "Updated Chat Name",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-17T11:45:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Chat not found"
}
⌘I

