Delete Thread
/api/threads/{threadId}Deletes a thread and its full descendant tree (all subthreads), including all associated messages and thread storage.
Before anything is deleted, each of those threads stops accepting work: it refuses new messages with 423, starts no execution, and creates no child thread. An execution in flight is aborted, and state.execution.abortSignal fires in the running tool or hook. Queued messages and scheduled effects are discarded.
Every open stream connection to a deleted thread is closed with WebSocket close code 1000 before the response is returned.
If the deletion fails part-way, the response is 500. The remaining threads stay unavailable to new work. Send the same request again to complete the deletion.
threadIdstringrequiredThe unique thread identifier (UUID)
successbooleanrequiredWhether the deletion was successful
threadIdstringrequiredThe root thread ID that was requested for deletion
deletedThreadIdsarray[string]requiredThread IDs deleted in child-first order
deletedCountnumberrequiredTotal number of deleted threads (root + descendants)