Import threads
Import one or more conversation threads from JSON messages or conversation markdown.
Single mode set fields directly:
{
"title": "My Conversation",
"messages": [
{"role": "user", "content": "Hello!"},
{"role": "assistant", "content": "Hi there!"}
]
}Markdown modepass conversation markdown:
{
"markdown_content": "## User\n\nHello!\n\n## Assistant\n\nHi there!"
}Batch mode import multiple threads at once:
{
"threads": [
{"title": "Thread 1", "messages": [...]},
{"title": "Thread 2", "markdown_content": "## User\n\n..."}
]
}Thread IDs are auto-generated when omitted. Titles are inferred from markdown frontmatter when available.
See the Conversation Markdown format reference for the full .md format specification.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "http://127.0.0.1:14242/threads/import" \ -H "Content-Type: application/json" \ -d '{}'{
"success": true,
"imported_count": 0,
"failed_count": 0,
"results": [
{
"success": true,
"thread_id": "string",
"title": "string",
"message_count": 0,
"error": "string"
}
]
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}