Update a chat
client.chats.update(stringchatID, ChatUpdateParams { display_name, group_chat_icon } body, RequestOptionsoptions?): ChatUpdateResponse { chat_id, status }
PUT/v3/chats/{chatId}
Update chat properties such as display name and group chat icon.
Listen for chat.group_name_updated, chat.group_icon_updated,
chat.group_name_update_failed, or chat.group_icon_update_failed
webhook events to confirm the outcome.
Update a chat
import LinqAPIV3 from '@linqapp/sdk';
const client = new LinqAPIV3({
apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted
});
const chat = await client.chats.update('550e8400-e29b-41d4-a716-446655440000', {
display_name: 'Team Discussion',
});
console.log(chat.chat_id);{
"chat_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending"
}{
"error": {
"status": 400,
"code": 1002,
"message": "Phone number must be in E.164 format"
},
"success": false
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token"
},
"success": false
}{
"error": {
"status": 404,
"code": 2001,
"message": "Resource not found"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error"
},
"success": false
}Returns Examples
{
"chat_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending"
}{
"error": {
"status": 400,
"code": 1002,
"message": "Phone number must be in E.164 format"
},
"success": false
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token"
},
"success": false
}{
"error": {
"status": 404,
"code": 2001,
"message": "Resource not found"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error"
},
"success": false
}