## 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.

### Parameters

- `chatID string`

- `body ChatUpdateParams`

  - `DisplayName param.Field[string]`

    New display name for the chat (group chats only)

  - `GroupChatIcon param.Field[string]`

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

### Returns

- `type ChatUpdateResponse struct{…}`

  - `ChatID string`

  - `Status string`

### Example

```go
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)
}
```

#### Response

```json
{
  "chat_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "pending"
}
```
