puter.threads.edit()


Updates the text of an existing thread.

Syntax

puter.threads.edit(uuid, text);

Parameters

uuid (string) (required)

The UUID of the thread to edit.

text (string) (required)

The new text to store in the thread.

Return value

An object containing information about the updated thread:

{
  uuid: string,       // The UUID of the thread
  text: string,       // The updated text 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 text")
            .then(updatedThread => {
                console.log("Thread updated:", updatedThread);
            })
            .catch(error => {
                console.error("Error updating thread:", error);
            });
    </script>
</body>
</html>