Skip to main content

Overview

Returns an async function that updates a conversation’s details via the API. This is a low-level hook — it makes the PATCH request and returns the updated conversation without touching Redux state. Use it when you need direct control over when and how state is updated.
Requires ChatProvider in the component tree.

Usage Example

import { useUpdateConversation } from "@replyke/react-js";

function RenameButton({ conversationId }: { conversationId: string }) {
  const updateConversation = useUpdateConversation();

  const handleRename = async () => {
    const updated = await updateConversation({
      conversationId,
      name: "New Name",
    });
    console.log(updated);
  };

  return <button onClick={handleRename}>Rename</button>;
}

Parameters

The hook returns a function. That function accepts:
conversationId
string
required
The ID of the conversation to update.
name
string
New conversation name.
description
string
New conversation description.
avatarFileId
string | null
File ID for the avatar image. Pass null to remove the current avatar.
postingPermission
'members' | 'admins'
Who can post messages. Only applicable to space conversations.

Returns

Conversation
Conversation
The updated Conversation object.

Notes

  • This hook does not update Redux state. If you want the result reflected in the UI, dispatch setConversation manually or use useConversation which handles this automatically.
  • For integration guidance, see Chat: Conversations.