Skip to content
V2 (Legacy) API ReferenceGet started

Update a chat

client.Chats.Update(ctx, chatID, body) (*ChatUpdateResponse, error)
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.

ParametersExpand Collapse
chatID string
formatuuid
body ChatUpdateParams
DisplayName param.Field[string]Optional

New display name for the chat (group chats only)

GroupChatIcon param.Field[string]Optional

URL of an image to set as the group chat icon (group chats only)

formaturi
ReturnsExpand Collapse
type ChatUpdateResponse struct{…}
ChatID stringOptional
formatuuid
Status stringOptional

Update a chat

package main

import (
  "context"
  "fmt"

  "github.com/linq-team/linq-go"
  "github.com/linq-team/linq-go/option"
)

func main() {
  client := linqgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  chat, err := client.Chats.Update(
    context.TODO(),
    "550e8400-e29b-41d4-a716-446655440000",
    linqgo.ChatUpdateParams{
      DisplayName: linqgo.String("Team Discussion"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", chat.ChatID)
}
{
  "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
}