Skip to main content

Start conversation

POST /api/conversations

Start a conversation in the local environment.

Request body

FieldTypeRequiredDescription
agentAgentBase-Inputyes
workspaceLocalWorkspace-InputyesWorking directory for agent operations and tool execution
conversation_id`stringnull`no
confirmation_policyConfirmationPolicyBase-InputnoControls when the conversation will prompt the user before continuing. Defaults to never.
initial_message`SendMessageRequestnull`no
max_iterationsintegernoIf set, the max number of iterations the agent will run before stopping. This is useful to prevent infinite loops.
stuck_detectionbooleannoIf true, the conversation will use stuck detection to prevent infinite loops.
secretsobjectnoSecrets available in the conversation
tool_module_qualnamesobjectnoMapping of tool names to their module qualnames from the client's registry. These modules will be dynamically imported on the server to register the tools for this conversation.
plugins`PluginSource[]null`no
hook_config`HookConfig-Inputnull`no

Responses

StatusDescription
200Successful Response
422Validation Error

Response body

FieldTypeRequiredDescription
idstringyesUnique conversation ID
agentAgentBase-OutputyesThe agent running in the conversation. This is persisted to allow resuming conversations and check agent configuration to handle e.g., tool changes, LLM changes, etc.
workspaceBaseWorkspace-OutputyesWorkspace used by the agent to execute commands and read/write files. Not the process working directory.
persistence_dir`stringnull`no
max_iterationsintegernoMaximum number of iterations the agent can perform in a single run.
stuck_detectionbooleannoWhether to enable stuck detection for the agent.
execution_statusConversationExecutionStatusno
confirmation_policyConfirmationPolicyBase-Outputno
security_analyzer`SecurityAnalyzerBase-Outputnull`no
activated_knowledge_skillsstring[]noList of activated knowledge skills name
blocked_actionsobjectnoActions blocked by PreToolUse hooks, keyed by action ID
blocked_messagesobjectnoMessages blocked by UserPromptSubmit hooks, keyed by message ID
statsConversationStats-OutputnoConversation statistics for tracking LLM metrics
secret_registrySecretRegistry-OutputnoRegistry for handling secrets and sensitive data
agent_stateobjectnoDictionary for agent-specific runtime state that persists across iterations. Agents can store feature-specific state using string keys. To trigger autosave, always reassign: state.agent_state = {**state.agent_state, key: value}. See https://docs.faheem-code.dev/sdk/guides/convo-persistence#how-state-persistence-works
title`stringnull`no
metrics`MetricsSnapshotnull`no
created_atstringno
updated_atstringno

Operation ID: start_conversation_api_conversations_post