POST /v1/agents/import - Import agent from Markdown, YAML, or JSON
POST /v1/agents/import
Accepts agent definition in multiple formats:
- Markdown with YAML front matter (if starts with ---)
- Pure YAML
- Pure JSON
- Plain text (treated as system prompt, name auto-generated)
Request Body required
Section titled “Request Body required ”Responses
Section titled “ Responses ”Agent imported successfully
Agent configuration for agentic loop. An agent defines the behavior and capabilities of an AI assistant.
object
Capabilities enabled for this agent with per-agent configuration. Capabilities add tools and system prompt modifications.
Per-agent capability configuration
Associates a capability with an agent, including optional per-agent configuration. The config field allows the same capability to behave differently per-agent.
object
Per-agent configuration for this capability (capability-specific)
Reference to the capability ID
Timestamp when the agent was created.
Default LLM model ID for this agent. Can be overridden at the session level.
Example
model_01933b5a00007000800000000000001Human-readable description of what the agent does.
External identifier (agent_<32-hex>). Shown as “id” in API. Client-supplied or auto-generated.
Example
agent_01933b5a000070008000000000000001Display name of the agent.
Current lifecycle status of the agent.
System prompt that defines the agent’s behavior. Sent as the first message in every conversation.
Tags for organizing and filtering agents.
Timestamp when the agent was last updated.
Cumulative token usage across all sessions for this agent.
object
Number of tokens written to cache (Anthropic-specific)
Number of tokens read from cache (reduces cost)
Number of input/prompt tokens
Number of output/completion tokens
Invalid format or input exceeds limits
Standard error response for API endpoints.
object
Error message describing what went wrong.
Internal server error
Standard error response for API endpoints.
object
Error message describing what went wrong.