Threads hold conversation state and checkpoint history. Provide a
thread_id for idempotent creation, or let the server generate one.
Set if_exists to "do_nothing" to return the existing thread when the
ID already exists instead of raising a 409 conflict.
Optional client-provided thread ID for idempotent creation. Omit or null to let the server generate a UUID. When set, 1–255 characters and not blank (must fit PostgreSQL btree keys uncompressed).
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Aegra","colors":{"primary":"#f97316","light":"#fb923c","dark":"#ea580c"},"logo":{"light":"https://mintcdn.com/aegra/Rwc7oJzYlJBOchZu/images/logo-light.svg?fit=max\u0026auto=format\u0026n=Rwc7oJzYlJBOchZu\u0026q=85\u0026s=021ca638c2cb9e56e3869be82560d741","dark":"https://mintcdn.com/aegra/Rwc7oJzYlJBOchZu/images/logo-dark.svg?fit=max\u0026auto=format\u0026n=Rwc7oJzYlJBOchZu\u0026q=85\u0026s=67bbde1058431a2027f1f61b8a8fd11d"},"favicon":"https://mintcdn.com/aegra/Rwc7oJzYlJBOchZu/images/favicon.svg?fit=max\u0026auto=format\u0026n=Rwc7oJzYlJBOchZu\u0026q=85\u0026s=f42a720443ed46fb49c5c1bf43a0bc09","appearance":{"default":"dark"},"search":{"prompt":"Search Aegra docs..."},"contextual":{"options":["copy","view","chatgpt","claude","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"aegra","hasAudioNarration":false,"actualSubdomain":"aegra","customDomains":["docs.aegra.dev"],"gitSource":{"type":"github","owner":"aegra","repo":"aegra","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae9cc409e45d74e232debe5","collectionId":"7b4b300f-7c0c-4e04-94d0-968f7fce3eaf","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae9cc409e45d74e232debe5"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae9cc409e45d74e232debe5","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"API Reference","count":56},{"language":"default","tag":"Documentation","count":27},{"language":"default","tag":"Threads","count":13},{"language":"default","tag":"Assistants","count":12},{"language":"default","tag":"Thread Runs","count":11},{"language":"default","tag":"Getting started","count":7},{"language":"default","tag":"Configuration","count":7},{"language":"default","tag":"Crons","count":6},{"language":"default","tag":"Core concepts","count":5},{"language":"default","tag":"Store","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/threads/create-thread","slug":"/api-reference/threads/create-thread","pageMetadata":{"title":"Create Thread","description":"Create a new conversation thread.\n\nThreads hold conversation state and checkpoint history. Provide a\n`thread_id` for idempotent creation, or let the server generate one.\nSet `if_exists` to `\"do_nothing\"` to return the existing thread when the\nID already exists instead of raising a 409 conflict.","deprecated":null,"version":null,"openapi":"/openapi.json post /threads","href":"/api-reference/threads/create-thread","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Create a new conversation thread.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Threads hold conversation state and checkpoint history. Provide a\\n\", _jsx(_components.code, {\n children: \"thread_id\"\n }), \" for idempotent creation, or let the server generate one.\\nSet \", _jsx(_components.code, {\n children: \"if_exists\"\n }), \" to \", _jsx(_components.code, {\n children: \"\\\"do_nothing\\\"\"\n }), \" to return the existing thread when the\\nID already exists instead of raising a 409 conflict.\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create Thread","description":"Create a new conversation thread.\n\nThreads hold conversation state and checkpoint history. Provide a\n`thread_id` for idempotent creation, or let the server generate one.\nSet `if_exists` to `\"do_nothing\"` to return the existing thread when the\nID already exists instead of raising a 409 conflict.","deprecated":null,"version":null,"openapi":"/openapi.json post /threads","href":"/api-reference/threads/create-thread","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Threads"],"summary":"Create Thread","description":"Create a new conversation thread.\n\nThreads hold conversation state and checkpoint history. Provide a\n`thread_id` for idempotent creation, or let the server generate one.\nSet `if_exists` to `\"do_nothing\"` to return the existing thread when the\nID already exists instead of raising a 409 conflict.","operationId":"create_thread_threads_post","requestBody":"6f955d58-9088-41d2-945f-3b4b0e3d1eb9","responses":{"200":"d0c890e4-aa06-41bc-97b1-cfcc0c37d86c","409":"c0aa7787-2f92-4fb8-8619-4cbc641002f5","422":"3786e5c5-49fc-4f7d-b4af-fe69aca739c8"},"method":"post","type":"path","servers":[],"security":[],"path":"/threads","baseUrlOptions":[],"title":"Create Thread","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"properties":{"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Thread metadata","additionalProperties":true,"uniqueKey":"metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Thread metadata","uniqueKey":"metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"metadata","typeLabel":"Metadata · object | null"},"initial_state":{"oneOf":[{"type":"object","title":"Initial State","description":"LangGraph initial state","additionalProperties":true,"uniqueKey":"initial_state.oneOf.0","typeLabel":"Initial State · object"},{"type":"null","title":"Initial State","description":"LangGraph initial state","uniqueKey":"initial_state.oneOf.1","typeLabel":"null"}],"uniqueKey":"initial_state","typeLabel":"Initial State · object | null"},"threadId":{"oneOf":[{"type":"string","title":"Threadid","description":"Optional client-provided thread ID for idempotent creation. Omit or null to let the server generate a UUID. When set, 1–255 characters and not blank (must fit PostgreSQL btree keys uncompressed).","maxLength":255,"minLength":1,"pattern":"\\S","uniqueKey":"threadId.oneOf.0","typeLabel":"string"},{"type":"null","title":"Threadid","description":"Optional client-provided thread ID for idempotent creation. Omit or null to let the server generate a UUID. When set, 1–255 characters and not blank (must fit PostgreSQL btree keys uncompressed).","uniqueKey":"threadId.oneOf.1","typeLabel":"null"}],"uniqueKey":"threadId","typeLabel":"string | null"},"ifExists":{"oneOf":[{"type":"string","title":"Ifexists","description":"Behavior when thread exists: 'raise' (default) or 'do_nothing'","default":"raise","uniqueKey":"ifExists.oneOf.0","typeLabel":"string"},{"type":"null","title":"Ifexists","description":"Behavior when thread exists: 'raise' (default) or 'do_nothing'","default":"raise","uniqueKey":"ifExists.oneOf.1","typeLabel":"null"}],"uniqueKey":"ifExists","typeLabel":"string | null"},"ttl":{"oneOf":[{"type":"object","title":"ThreadTTLSpec","description":"Per-thread TTL override; requires TTL to be configured server-side or default_ttl set","properties":{"default_ttl":{"oneOf":[{"type":"number","title":"Default Ttl","description":"Thread TTL in minutes; also accepted under the key \"ttl\" (LangGraph SDK compatibility). Falls back to the server default when omitted","maximum":1000000000,"minimum":0,"exclusiveMinimum":true,"uniqueKey":"ttl.oneOf.0.default_ttl.oneOf.0","typeLabel":"number"},{"type":"null","title":"Default Ttl","description":"Thread TTL in minutes; also accepted under the key \"ttl\" (LangGraph SDK compatibility). Falls back to the server default when omitted","uniqueKey":"ttl.oneOf.0.default_ttl.oneOf.1","typeLabel":"null"}],"uniqueKey":"ttl.oneOf.0.default_ttl","typeLabel":"number | null"},"strategy":{"oneOf":[{"type":"string","title":"Strategy","description":"Expiry strategy: 'delete' removes the thread, 'keep_latest' prunes history","enum":["delete","keep_latest"],"uniqueKey":"ttl.oneOf.0.strategy.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Strategy","description":"Expiry strategy: 'delete' removes the thread, 'keep_latest' prunes history","uniqueKey":"ttl.oneOf.0.strategy.oneOf.1","typeLabel":"null"}],"uniqueKey":"ttl.oneOf.0.strategy","typeLabel":"enum\u003cstring> | null"}},"uniqueKey":"ttl.oneOf.0","typeLabel":"ThreadTTLSpec · object"},{"type":"null","description":"Per-thread TTL override; requires TTL to be configured server-side or default_ttl set","uniqueKey":"ttl.oneOf.1","typeLabel":"null"}],"uniqueKey":"ttl","typeLabel":"ThreadTTLSpec · object | null"}},"type":"object","title":"ThreadCreate","description":"Request model for creating threads","uniqueKey":"","typeLabel":"ThreadCreate · object"},"examples":{"Example":{"title":"Example","value":{"metadata":{},"initial_state":{},"threadId":"\u003cstring>","ifExists":"raise","ttl":{"default_ttl":500000000}}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"d0c890e4-aa06-41bc-97b1-cfcc0c37d86c":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"thread_id":{"type":"string","title":"Thread Id","description":"Unique identifier for the thread.","isRequired":true,"uniqueKey":"thread_id","typeLabel":"string"},"user_id":{"type":"string","title":"User Id","description":"Identifier of the user who owns this thread.","isRequired":true,"uniqueKey":"user_id","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the thread was created.","isRequired":true,"uniqueKey":"created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Timestamp when the thread was last updated.","isRequired":true,"uniqueKey":"updated_at","typeLabel":"string\u003cdate-time>"},"status":{"type":"string","title":"Status","description":"Current thread status: idle, busy, interrupted, or error.","default":"idle","uniqueKey":"status","typeLabel":"string"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Arbitrary metadata attached to the thread.","uniqueKey":"metadata","typeLabel":"Metadata · object"}},"type":"object","required":["thread_id","user_id","created_at","updated_at"],"title":"Thread","description":"Thread entity model\n\nStatus values: idle, busy, interrupted, error","uniqueKey":"","typeLabel":"Thread · object"},"examples":{"Example":{"title":"Example","value":{"thread_id":"\u003cstring>","user_id":"\u003cstring>","created_at":"2023-11-07T05:31:56Z","updated_at":"2023-11-07T05:31:56Z","status":"idle","metadata":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"c0aa7787-2f92-4fb8-8619-4cbc641002f5":{"description":"Resource state conflict","content":{"application/json":{"schema":{"properties":{"error":{"type":"string","title":"Error","description":"Error type","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","title":"Message","description":"Human-readable error message","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"details":{"oneOf":[{"type":"object","title":"Details","description":"Additional error details","additionalProperties":true,"uniqueKey":"details.oneOf.0","typeLabel":"Details · object"},{"type":"null","title":"Details","description":"Additional error details","uniqueKey":"details.oneOf.1","typeLabel":"null"}],"uniqueKey":"details","typeLabel":"Details · object | null"}},"type":"object","required":["error","message"],"title":"AgentProtocolError","description":"Standard Agent Protocol error response","uniqueKey":"","typeLabel":"AgentProtocolError · object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","message":"\u003cstring>","details":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"3786e5c5-49fc-4f7d-b4af-fe69aca739c8":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"oneOf":[{"type":"string","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"detail.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"type":"array","title":"Location","isRequired":true,"uniqueKey":"detail.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"detail.items.[INDEX].msg","typeLabel":"string"},"type":{"type":"string","title":"Error Type","isRequired":true,"uniqueKey":"detail.items.[INDEX].type","typeLabel":"string"},"input":{"oneOf":[{"title":"Input"}],"uniqueKey":"detail.items.[INDEX].input","typeLabel":"any"},"ctx":{"type":"object","title":"Context","uniqueKey":"detail.items.[INDEX].ctx","typeLabel":"Context · object"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","uniqueKey":"detail.items.[INDEX]","typeLabel":"ValidationError · object"},"type":"array","title":"Detail","uniqueKey":"detail","typeLabel":"ValidationError · object[]"}},"type":"object","title":"HTTPValidationError","uniqueKey":"","typeLabel":"HTTPValidationError · object"},"examples":{"Example":{"title":"Example","value":{"detail":[{"loc":["\u003cstring>"],"msg":"\u003cstring>","type":"\u003cstring>","input":"\u003cunknown>","ctx":{}}]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{},"servers":{}},"originalFileLocation":"openapi.json"},"subdomain":"aegra","siteName":"Aegra","title":"Create Thread - Aegra","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-25T15:29:15.276Z","originalFileLocation":"api-reference/threads/create-thread.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create a new conversation thread. Threads hold conversation state and checkpoint history. Provide a thread_id for idempotent creation, or let the server generate one. Set if_exists to \u0026quot;do_nothing\u0026quot; to return the existing thread when the ID already exists instead of raising a 409 conflict.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Aegra\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/aegra/PXmwwk9BNjTPZqTG/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/aegra/PXmwwk9BNjTPZqTG/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/aegra/PXmwwk9BNjTPZqTG/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/aegra/PXmwwk9BNjTPZqTG/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/aegra/PXmwwk9BNjTPZqTG/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/aegra/PXmwwk9BNjTPZqTG/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/aegra/PXmwwk9BNjTPZqTG/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/aegra/PXmwwk9BNjTPZqTG/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/aegra/PXmwwk9BNjTPZqTG/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create Thread - Aegra\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a new conversation thread. Threads hold conversation state and checkpoint history. Provide a thread_id for idempotent creation, or let the server generate one. Set if_exists to \u0026quot;do_nothing\u0026quot; to return the existing thread when the ID already exists instead of raising a 409 conflict.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Aegra\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.aegra.dev/api-reference/threads/create-thread\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://aegra.mintlify.site/_mintlify/api/og/v2?division=Threads\u0026amp;title=Create+Thread\u0026amp;description=Create+a+new+conversation+thread.%0A%0AThreads+hold+conversation+state+and+checkpoint+history.+Provide+a%0A%60thread_id%60+for+idempotent+creation%2C+or+let+the+server+gene\u0026amp;theme=91d2c677a0dfb352733d0c75\u0026amp;signature=955c3f2ea030add831868283c3189c0e85335f7df650184423bfda82adb2ac41\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create Thread - Aegra\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a new conversation thread. Threads hold conversation state and checkpoint history. Provide a thread_id for idempotent creation, or let the server generate one. Set if_exists to \u0026quot;do_nothing\u0026quot; to return the existing thread when the ID already exists instead of raising a 409 conflict.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://aegra.mintlify.site/_mintlify/api/og/v2?division=Threads\u0026amp;title=Create+Thread\u0026amp;description=Create+a+new+conversation+thread.%0A%0AThreads+hold+conversation+state+and+checkpoint+history.+Provide+a%0A%60thread_id%60+for+idempotent+creation%2C+or+let+the+server+gene\u0026amp;theme=91d2c677a0dfb352733d0c75\u0026amp;signature=955c3f2ea030add831868283c3189c0e85335f7df650184423bfda82adb2ac41\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/aegra/PXmwwk9BNjTPZqTG/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Aegra\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#f97316\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.aegra.dev/api-reference/threads/create-thread\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/threads/create-thread.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.aegra.dev/#organization\",\"name\":\"Aegra\",\"url\":\"https://docs.aegra.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/aegra/Rwc7oJzYlJBOchZu/images/logo-light.svg?fit=max\u0026auto=format\u0026n=Rwc7oJzYlJBOchZu\u0026q=85\u0026s=021ca638c2cb9e56e3869be82560d741\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.aegra.dev#website\",\"name\":\"Aegra\",\"url\":\"https://docs.aegra.dev\",\"publisher\":{\"@id\":\"https://docs.aegra.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.aegra.dev/api-reference/threads/create-thread#webpage\",\"url\":\"https://docs.aegra.dev/api-reference/threads/create-thread\",\"name\":\"Create Thread\",\"description\":\"Create a new conversation thread. Threads hold conversation state and checkpoint history. Provide a thread_id for idempotent creation, or let the server generate one. Set if_exists to \\\"do_nothing\\\" to return the existing thread when the ID already exists instead of raising a 409 conflict.\",\"dateModified\":\"2026-10-25T15:29:15.276Z\",\"isPartOf\":{\"@id\":\"https://docs.aegra.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.aegra.dev/api-reference/threads/create-thread#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.aegra.dev/api-reference/threads/create-thread#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Threads\",\"item\":\"https://docs.aegra.dev/api-reference/threads/list-threads\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Thread\",\"item\":\"https://docs.aegra.dev/api-reference/threads/create-thread\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.aegra.dev/api-reference/threads/create-thread#apireference\",\"headline\":\"Create Thread\",\"name\":\"Create Thread\",\"description\":\"Create a new conversation thread. Threads hold conversation state and checkpoint history. Provide a thread_id for idempotent creation, or let the server generate one. Set if_exists to \\\"do_nothing\\\" to return the existing thread when the ID already exists instead of raising a 409 conflict.\",\"url\":\"https://docs.aegra.dev/api-reference/threads/create-thread\",\"mainEntityOfPage\":{\"@id\":\"https://docs.aegra.dev/api-reference/threads/create-thread#webpage\"},\"dateModified\":\"2026-10-25T15:29:15.276Z\",\"publisher\":{\"@id\":\"https://docs.aegra.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.aegra.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Aegra\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Aegra","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Health","pages":[{"title":"Info","deprecated":null,"version":null,"openapi":"/openapi.json get /info","href":"/api-reference/health/info"},{"title":"Health Check","deprecated":null,"version":null,"openapi":"/openapi.json get /health","href":"/api-reference/health/health-check"},{"title":"Readiness Check","deprecated":null,"version":null,"openapi":"/openapi.json get /ready","href":"/api-reference/health/readiness-check"},{"title":"Liveness Check","deprecated":null,"version":null,"openapi":"/openapi.json get /live","href":"/api-reference/health/liveness-check"}]},{"group":"Assistants","pages":[{"title":"List Assistants","deprecated":null,"version":null,"openapi":"/openapi.json get /assistants","href":"/api-reference/assistants/list-assistants"},{"title":"Create Assistant","deprecated":null,"version":null,"openapi":"/openapi.json post /assistants","href":"/api-reference/assistants/create-assistant"},{"title":"Search Assistants","deprecated":null,"version":null,"openapi":"/openapi.json post /assistants/search","href":"/api-reference/assistants/search-assistants"},{"title":"Count Assistants","deprecated":null,"version":null,"openapi":"/openapi.json post /assistants/count","href":"/api-reference/assistants/count-assistants"},{"title":"Get Assistant","deprecated":null,"version":null,"openapi":"/openapi.json get /assistants/{assistant_id}","href":"/api-reference/assistants/get-assistant"},{"title":"Delete Assistant","deprecated":null,"version":null,"openapi":"/openapi.json delete /assistants/{assistant_id}","href":"/api-reference/assistants/delete-assistant"},{"title":"Update Assistant","deprecated":null,"version":null,"openapi":"/openapi.json patch /assistants/{assistant_id}","href":"/api-reference/assistants/update-assistant"},{"title":"Set Assistant Latest","deprecated":null,"version":null,"openapi":"/openapi.json post /assistants/{assistant_id}/latest","href":"/api-reference/assistants/set-assistant-latest"},{"title":"List Assistant Versions","deprecated":null,"version":null,"openapi":"/openapi.json post /assistants/{assistant_id}/versions","href":"/api-reference/assistants/list-assistant-versions"},{"title":"Get Assistant Schemas","deprecated":null,"version":null,"openapi":"/openapi.json get /assistants/{assistant_id}/schemas","href":"/api-reference/assistants/get-assistant-schemas"},{"title":"Get Assistant Graph","deprecated":null,"version":null,"openapi":"/openapi.json get /assistants/{assistant_id}/graph","href":"/api-reference/assistants/get-assistant-graph"},{"title":"Get Assistant Subgraphs","deprecated":null,"version":null,"openapi":"/openapi.json get /assistants/{assistant_id}/subgraphs","href":"/api-reference/assistants/get-assistant-subgraphs"}]},{"group":"Threads","pages":[{"title":"List Threads","description":"List all threads owned by the authenticated user.\n\nReturns every thread without filtering. Use the search endpoint for\nfiltered queries.","deprecated":null,"version":null,"openapi":"/openapi.json get /threads","href":"/api-reference/threads/list-threads"},{"title":"Create Thread","deprecated":null,"version":null,"openapi":"/openapi.json post /threads","href":"/api-reference/threads/create-thread"},{"title":"Get Thread","description":"Get a thread by its ID.\n\nReturns 404 if the thread does not exist or does not belong to the\nauthenticated user.","deprecated":null,"version":null,"openapi":"/openapi.json get /threads/{thread_id}","href":"/api-reference/threads/get-thread"},{"title":"Delete Thread","deprecated":null,"version":null,"openapi":"/openapi.json delete /threads/{thread_id}","href":"/api-reference/threads/delete-thread"},{"title":"Update Thread","deprecated":null,"version":null,"openapi":"/openapi.json patch /threads/{thread_id}","href":"/api-reference/threads/update-thread"},{"title":"Get Thread State","deprecated":null,"version":null,"openapi":"/openapi.json get /threads/{thread_id}/state","href":"/api-reference/threads/get-thread-state"},{"title":"Update Thread State","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/{thread_id}/state","href":"/api-reference/threads/update-thread-state"},{"title":"Get Thread State At Checkpoint","deprecated":null,"version":null,"openapi":"/openapi.json get /threads/{thread_id}/state/{checkpoint_id}","href":"/api-reference/threads/get-thread-state-at-checkpoint"},{"title":"Get Thread State At Checkpoint Post","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/{thread_id}/state/checkpoint","href":"/api-reference/threads/get-thread-state-at-checkpoint-post"},{"title":"Get Thread History Get","deprecated":null,"version":null,"openapi":"/openapi.json get /threads/{thread_id}/history","href":"/api-reference/threads/get-thread-history-get"},{"title":"Get Thread History Post","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/{thread_id}/history","href":"/api-reference/threads/get-thread-history-post"},{"title":"Prune Threads","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/prune","href":"/api-reference/threads/prune-threads"},{"title":"Search Threads","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/search","href":"/api-reference/threads/search-threads"}]},{"group":"Thread Runs","pages":[{"title":"List Runs","deprecated":null,"version":null,"openapi":"/openapi.json get /threads/{thread_id}/runs","href":"/api-reference/thread-runs/list-runs"},{"title":"Create Run","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/{thread_id}/runs","href":"/api-reference/thread-runs/create-run"},{"title":"Create And Stream Run","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/{thread_id}/runs/stream","href":"/api-reference/thread-runs/create-and-stream-run"},{"title":"Get Run","deprecated":null,"version":null,"openapi":"/openapi.json get /threads/{thread_id}/runs/{run_id}","href":"/api-reference/thread-runs/get-run"},{"title":"Delete Run","deprecated":null,"version":null,"openapi":"/openapi.json delete /threads/{thread_id}/runs/{run_id}","href":"/api-reference/thread-runs/delete-run"},{"title":"Update Run","deprecated":null,"version":null,"openapi":"/openapi.json patch /threads/{thread_id}/runs/{run_id}","href":"/api-reference/thread-runs/update-run"},{"title":"Join Run","deprecated":null,"version":null,"openapi":"/openapi.json get /threads/{thread_id}/runs/{run_id}/join","href":"/api-reference/thread-runs/join-run"},{"title":"Wait For Run","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/{thread_id}/runs/wait","href":"/api-reference/thread-runs/wait-for-run"},{"title":"Stream Run","deprecated":null,"version":null,"openapi":"/openapi.json get /threads/{thread_id}/runs/{run_id}/stream","href":"/api-reference/thread-runs/stream-run"},{"title":"Cancel Run Endpoint","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/{thread_id}/runs/{run_id}/cancel","href":"/api-reference/thread-runs/cancel-run-endpoint"},{"title":"Cancel Runs","deprecated":null,"version":null,"openapi":"/openapi.json post /runs/cancel","href":"/api-reference/thread-runs/cancel-runs"}]},{"group":"Stateless Runs","pages":[{"title":"Stateless Wait For Run","deprecated":null,"version":null,"openapi":"/openapi.json post /runs/wait","href":"/api-reference/stateless-runs/stateless-wait-for-run"},{"title":"Stateless Stream Run","deprecated":null,"version":null,"openapi":"/openapi.json post /runs/stream","href":"/api-reference/stateless-runs/stateless-stream-run"},{"title":"Stateless Create Run","deprecated":null,"version":null,"openapi":"/openapi.json post /runs","href":"/api-reference/stateless-runs/stateless-create-run"}]},{"group":"Crons","pages":[{"title":"Create Cron","deprecated":null,"version":null,"openapi":"/openapi.json post /runs/crons","href":"/api-reference/crons/create-cron"},{"title":"Create Cron For Thread","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/{thread_id}/runs/crons","href":"/api-reference/crons/create-cron-for-thread"},{"title":"Delete Cron","deprecated":null,"version":null,"openapi":"/openapi.json delete /runs/crons/{cron_id}","href":"/api-reference/crons/delete-cron"},{"title":"Update Cron","deprecated":null,"version":null,"openapi":"/openapi.json patch /runs/crons/{cron_id}","href":"/api-reference/crons/update-cron"},{"title":"Search Crons","deprecated":null,"version":null,"openapi":"/openapi.json post /runs/crons/search","href":"/api-reference/crons/search-crons"},{"title":"Count Crons","deprecated":null,"version":null,"openapi":"/openapi.json post /runs/crons/count","href":"/api-reference/crons/count-crons"}]},{"group":"Store","pages":[{"title":"Get Store Item","deprecated":null,"version":null,"openapi":"/openapi.json get /store/items","href":"/api-reference/store/get-store-item"},{"title":"Put Store Item","deprecated":null,"version":null,"openapi":"/openapi.json put /store/items","href":"/api-reference/store/put-store-item"},{"title":"Delete Store Item","deprecated":null,"version":null,"openapi":"/openapi.json delete /store/items","href":"/api-reference/store/delete-store-item"},{"title":"Search Store Items","deprecated":null,"version":null,"openapi":"/openapi.json post /store/items/search","href":"/api-reference/store/search-store-items"},{"title":"List Namespaces","deprecated":null,"version":null,"openapi":"/openapi.json post /store/namespaces","href":"/api-reference/store/list-namespaces"}]},{"group":"Event Streaming","pages":[{"title":"Stream Thread Events","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/{thread_id}/stream/events","href":"/api-reference/event-streaming/stream-thread-events"},{"title":"Post Thread Command","deprecated":null,"version":null,"openapi":"/openapi.json post /threads/{thread_id}/commands","href":"/api-reference/event-streaming/post-thread-command"}]}]}]},"basePath":"","title":"Create Thread - Aegra","buildId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","deploymentId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-i2a3QZ8E.js","utils-ChLwp8m0.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DRktVTDc.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-CA2pEs4T.js","snippetPresets-ClQ6XrKD.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Ct_Lv36y.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-Cn2PYw9e.js","shallow-rkyymjXQ.js","getApiPlaygroundDisplay-BB9vkXtE.js","CodeSnippet-Bm5RU7m1.js","CodeSnippets-BgU9Deuz.js","Page-BUDYNlhG.js","getPastedJson-BD-6NNum.js","icon-8Z6tud2e.js","MethodPill-Tuzr4g3V.js","DuplicateIcon-0ceWFYhN.js","createIcon-FBXow_ST.js","DynamicMarkdown-CD8713Yy.js","SectionHeading-7zgzQbH-.js","axios-vUo_bRtp.js","Markdown-D7Ofw1oz.js","clsx-eKJ4rcii.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CwjSCXIK.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-9EK5IAXV.js"]}