Skip to main content
POST
Creates a new conversation thread with the specified agent.
string
required
The name of the agent to use for this thread. Must match an agent defined in agents/agents/.
string
Optional user identifier for tracking and authorization.
array
Optional array of string tags for categorizing and filtering threads.
object
Optional thread environment values. Every value must be a string.

Errors

A request is rejected with 400, and no thread is created, when:
  • the body is not a JSON object
  • agent_id is absent or is not a string
  • tags is present and is not an array of strings
  • env is present and is not an object whose values are all strings
null counts as present for tags and env. An empty tags array and an empty env object are valid. A string agent_id returns 404 unless it is the id of an agent that GET /api/agents lists for the caller without a filter. Those are the project’s agents and the entry agents of installed packages, including agents with primary: false. An agent of a package that is not one of its entry agents returns the same 404 as a name that matches no agent, and no thread is created.
string
required
Unique thread identifier (UUID)
string
required
The agent name associated with this thread
string
required
Confirmation message