puter.threads.edit()


Updates the content of an existing thread.

Syntax

puter.threads.edit(uuid, content);

Parameters

uuid (string) (required)

The UUID of the thread to edit.

content (any) (required)

The new content to store in the thread.

Return value

An object containing information about the updated thread:

{
  uuid: string,       // The UUID of the thread
  content: any,       // The updated content stored in the thread
  parent_uuid: string // The UUID of the parent thread (if applicable)
}

Permissions Required

The current actor needs the thread:UUID-OF-THREAD:edit permission to edit the thread, unless they are the owner.

Example

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.threads.edit('550e8400-e29b-41d4-a716-446655440000', "Updated thread content")
            .then(updatedThread => {
                console.log("Thread updated:", updatedThread);
            })
            .catch(error => {
                console.error("Error updating thread:", error);
            });
    </script>
</body>
</html>