Skip to content
Letta Platform Letta Platform Letta Docs
Sign up

Cancel Conversation

client.conversations.cancel(stringconversationID, ConversationCancelParams { agent_id } params?, RequestOptionsoptions?): ConversationCancelResponse
post/v1/conversations/{conversation_id}/cancel

Cancel runs associated with a conversation.

Note: To cancel active runs, Redis is required.

Agent-direct mode: Pass conversation_id="default" with agent_id query parameter to cancel runs for the agent's default conversation.

Deprecated: Passing an agent ID as conversation_id still works but will be removed.

ParametersExpand Collapse
conversationID: string

The conversation identifier. Can be a conversation ID ('conv-'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-') for backwards compatibility (deprecated).

minLength1
maxLength42
params: ConversationCancelParams { agent_id }
agent_id?: string | null

Agent ID for agent-direct mode with 'default' conversation

ReturnsExpand Collapse
ConversationCancelResponse = Record<string, unknown>
Cancel Conversation
import Letta from '@letta-ai/letta-client';

const client = new Letta({
  apiKey: process.env['LETTA_API_KEY'], // This is the default and can be omitted
});

const response = await client.conversations.cancel('default');

console.log(response);
{
  "foo": "bar"
}
Returns Examples
{
  "foo": "bar"
}