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

# canopy.updateDialogue

<RequestExample>
  ```javascript index.js
  await canopy.updateDialogue({
      role: "system",
      content: "This is a new message.", 
      dialogueIndex: 4
  });
  ```
</RequestExample>

Updates a dialogue at a given `dialogueIndex` from the `messageThread`. More information
<a href="/documentation/llm-concepts#delete-dialogue"> here </a>.

### Parameters

<ParamField path="dialogueIndex" type="number" required="true">
  The index in the message thread array of the dialogue. Must be less than the length of the `messageThread` array.
</ParamField>

<ParamField path="role" type="string" required="true">
  More information <a href="/documentation/llm-concepts"> here </a>.
</ParamField>

<ParamField path="content" type="string" required="true" />

### Response

You will get a <b>JSON</b> response with the following fields:

<ResponseField name="success" type="boolean" />

<ResponseField name="timestamp" type="number" />

<ResponseField name="messageThread" type="array">
  An array of objects, where each object is a `dialogue`.
</ResponseField>
