Sessions

Edit a message and rewind

Changed on

Requires run. Replaces the named message with content and starts a new turn from it. A follow-up is named by its message_id or client_message_id; an opening prompt only by the client_message_id it was created with, since listSessionMessages does not list it. 404 rewind_message_not_found when the Session has no such message.

<sub>Scope: run</sub>

post/v3/organizations/{orgId}/sessions/{sessionId}/rewind

Request

  • Base URL
    https://api.reasonmachines.com
  • URL
    https://api.reasonmachines.com/v3/organizations/{orgId}/sessions/{sessionId}/rewind
  • Auth
    HTTP bearer

Request body

message_idstring

The follow-up to rewind to, by its id from listSessionMessages. Give this or client_message_id.

client_message_idstring

The message to rewind to, by the client_message_id it was sent with. This also names an opening prompt that was created with one; listSessionMessages does not list opening prompts.

contentstring required

The edited message. It replaces that message, and the conversation after it is set aside.

request_idstring uuid

A caller-chosen id for this rewind, so a retried request returns the first rewind (deduplicated true) instead of rewinding twice. Omitted, every request rewinds.

Response

The rewind started.

oktrue required

Always true on success.

session_idstring required

The Session that runs again from the edited message.

deduplicatedboolean required

True when this request_id was already applied and the first rewind is returned instead of starting another.

Changes