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.
Import one or more conversation threads.
Single mode: set fields directly (thread_id, title, messages or markdown_content).
Batch mode: use the threads list.
For markdown_content, use the universal conversation markdown format::
## UserHello!## AssistantHi there!Response Body
application/json
application/json
curl -X POST "https://example.com/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": {} } ]}