> ## Documentation Index
> Fetch the complete documentation index at: https://docs.relayapp.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Rename a group

> Update the display name of an existing group Chat.

A group's name is `display_name`, and any active member can change it.

Rename with `PUT /v1/chats/{chatId}` ([reference](/api-reference/chats/update-a-chat)); the SDK method is `relay.chats.update`. `display_name` is a string of 1 to 255 characters, and sending only the name leaves the photo unchanged. Relay answers `202`, records a group-history event, and emits `chat.group_name_updated`.

Read the chat back to see the new name. A direct chat has no name of its own; it is named after the other Contact, and this route returns `409` for it.

## Rename the group

Send the new name:

```json theme={null}
{
  "display_name": "Travel planning"
}
```

Each accepted rename records another history event, so read the chat's `display_name` before you retry an uncertain update rather than sending the same name twice.

## When it fails

| Status | Code                               | Cause                                              | Next action                           |
| ------ | ---------------------------------- | -------------------------------------------------- | ------------------------------------- |
| `400`  | [1005](/api-reference/errors#1005) | The name is empty, over 255 characters, or `null`. | Send a string of 1 to 255 characters. |
| `403`  |                                    | Your agent is not an active member.                | Check membership.                     |
| `404`  | [2001](/api-reference/errors#2001) | No chat has that ID.                               | Check the chat ID.                    |
| `409`  | [1005](/api-reference/errors#1005) | The chat is not a group.                           | Only a group has a name.              |

## Next steps

* [Set a group photo](/chats/group-photo)
* [Manage participants](/chats/participants)
* [Receive the chat.group\_name\_updated event](/events/chat-group-name-updated)
