Skip to content

Function: renameThread()

renameThread(opts): Promise<{ createdAt: string; id: string; metadata?: unknown; resourceId: string; title?: string; updatedAt: string; } | null>

Rename a single thread, returning the updated wire thread.

Ownership is enforced the same way deleteThread enforces it: the title is only changed when the thread belongs to the calling resource, so a client can’t rename another user’s conversation by guessing its id. Existing thread metadata is preserved untouched (Mastra’s updateThread replaces the row, so it must be passed back in). Returns null when the thread doesn’t exist, isn’t owned by the caller, or the agent has no memory configured, letting the route map that to a 404.

RenameThreadOptions

Promise<{ createdAt: string; id: string; metadata?: unknown; resourceId: string; title?: string; updatedAt: string; } | null>