import Morphik from 'morphik';const client = new Morphik({ apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted});const response = await client.retrieve.chunks.createGrouped();console.log(response.chunks);
Retrieve relevant chunks with grouped response format.
Uses the same filter operators as /retrieve/chunks (equality, $eq/$ne, $gt/$gte/$lt/$lte, $in/$nin,
$exists, $type, $regex, $contains, and the logical $and/$or/$nor/$not), with arbitrary nesting
supported inside request.filters.
Returns both flat results (for backward compatibility) and grouped results (for UI).
When padding > 0, groups chunks by main matches and their padding chunks.
POST
/
retrieve
/
chunks
/
grouped
JavaScript
import Morphik from 'morphik';const client = new Morphik({ apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted});const response = await client.retrieve.chunks.createGrouped();console.log(response.chunks);
Metadata filters supporting logical operators ($and/$or/$not/$nor) and field predicates ($eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$exists/$type/$regex/$contains).
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Morphik Documentation","colors":{"primary":"#000000","light":"#6B7280","dark":"#111827"},"logo":{"light":"https://mintcdn.com/databridge/DOquaEmX3ZFpdpaS/logo/light.png?fit=max\u0026auto=format\u0026n=DOquaEmX3ZFpdpaS\u0026q=85\u0026s=fdfc76422f7ad5f822941fb2306c2fd2","dark":"https://mintcdn.com/databridge/eYNTu58F8b1Z2Eq-/logo/dark.png?fit=max\u0026auto=format\u0026n=eYNTu58F8b1Z2Eq-\u0026q=85\u0026s=06c64dde532002ebbcb027d22c8fd3a8","href":"https://morphik.ai"},"favicon":"/favicon.png","api":{"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml","playground":{"display":"interactive","proxy":true}},"appearance":{"default":"light","strict":false},"background":{"color":{"light":"#FFFFFF","dark":"#0F0F0F"}},"navbar":{"links":[{"label":"Support","href":"mailto:founders@morphik.ai"},{"label":"Community","href":"https://discord.com/invite/BwMtv3Zaju"},{"label":"GitHub","href":"https://github.com/morphik-org/morphik-core"}]},"footer":{"socials":{"x":"https://x.com/ArnavAgrawal03","github":"https://github.com/morphik-org/morphik-core"}},"fonts":{"family":"Inter"},"contextual":{"options":["copy","view","chatgpt","claude"]},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"databridge","hasAudioNarration":false,"actualSubdomain":"databridge","customDomains":["morphik.ai"],"gitSource":{"type":"github","owner":"morphik-org","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{},"buildId":"6ae925ab38a52af76f40445a:success","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"API Reference","count":85},{"language":"default","tag":"Python SDK","count":62},{"language":"default","tag":"Guides","count":26},{"language":"default","tag":"Data Organization","count":16},{"language":"default","tag":"Documents","count":14},{"language":"default","tag":"EE - Connectors","count":12},{"language":"default","tag":"Folders","count":10},{"language":"default","tag":"Document Retrieval","count":8},{"language":"default","tag":"Document Updates","count":8},{"language":"default","tag":"Document Management","count":7}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"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":"editor-metadata","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/retrieve-chunks-grouped","slug":"/api-reference/retrieve-chunks-grouped","pageMetadata":{"title":"Retrieve Chunks Grouped","description":"Retrieve relevant chunks with grouped response format.\n\nUses the same filter operators as `/retrieve/chunks` (equality, `$eq/$ne`, `$gt/$gte/$lt/$lte`, `$in/$nin`,\n`$exists`, `$type`, `$regex`, `$contains`, and the logical `$and/$or/$nor/$not`), with arbitrary nesting\nsupported inside `request.filters`.\n\nReturns both flat results (for backward compatibility) and grouped results (for UI).\nWhen padding > 0, groups chunks by main matches and their padding chunks.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /retrieve/chunks/grouped","href":"/api-reference/retrieve-chunks-grouped","autogeneratedByOpenApi":true,"hidden":false},"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: \"Retrieve relevant chunks with grouped response format.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Uses the same filter operators as \", _jsx(_components.code, {\n children: \"/retrieve/chunks\"\n }), \" (equality, \", _jsx(_components.code, {\n children: \"$eq/$ne\"\n }), \", \", _jsx(_components.code, {\n children: \"$gt/$gte/$lt/$lte\"\n }), \", \", _jsx(_components.code, {\n children: \"$in/$nin\"\n }), \",\\n\", _jsx(_components.code, {\n children: \"$exists\"\n }), \", \", _jsx(_components.code, {\n children: \"$type\"\n }), \", \", _jsx(_components.code, {\n children: \"$regex\"\n }), \", \", _jsx(_components.code, {\n children: \"$contains\"\n }), \", and the logical \", _jsx(_components.code, {\n children: \"$and/$or/$nor/$not\"\n }), \"), with arbitrary nesting\\nsupported inside \", _jsx(_components.code, {\n children: \"request.filters\"\n }), \".\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"Returns both flat results (for backward compatibility) and grouped results (for UI).\\nWhen padding > 0, groups chunks by main matches and their padding chunks.\"\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":"Retrieve Chunks Grouped","description":"Retrieve relevant chunks with grouped response format.\n\nUses the same filter operators as `/retrieve/chunks` (equality, `$eq/$ne`, `$gt/$gte/$lt/$lte`, `$in/$nin`,\n`$exists`, `$type`, `$regex`, `$contains`, and the logical `$and/$or/$nor/$not`), with arbitrary nesting\nsupported inside `request.filters`.\n\nReturns both flat results (for backward compatibility) and grouped results (for UI).\nWhen padding > 0, groups chunks by main matches and their padding chunks.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /retrieve/chunks/grouped","href":"/api-reference/retrieve-chunks-grouped","autogeneratedByOpenApi":true,"hidden":false}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Retrieve Chunks Grouped","description":"Retrieve relevant chunks with grouped response format.\n\nUses the same filter operators as `/retrieve/chunks` (equality, `$eq/$ne`, `$gt/$gte/$lt/$lte`, `$in/$nin`,\n`$exists`, `$type`, `$regex`, `$contains`, and the logical `$and/$or/$nor/$not`), with arbitrary nesting\nsupported inside `request.filters`.\n\nReturns both flat results (for backward compatibility) and grouped results (for UI).\nWhen padding > 0, groups chunks by main matches and their padding chunks.","operationId":"retrieve_chunks_grouped_retrieve_chunks_grouped_post","parameters":["54b27ac2-cd8f-4249-962a-37ded8d6ff01"],"requestBody":"fc271ad6-54bb-4212-9166-34d2acb41038","responses":{"200":"5039e786-94fc-47fe-97d9-cab37fa07a65","422":"07d8acdd-16be-4c9f-a472-9f464f7a8ec9"},"x-codeSamples":[{"lang":"JavaScript","source":"import Morphik from 'morphik';\n\nconst client = new Morphik({\n apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.retrieve.chunks.createGrouped();\n\nconsole.log(response.chunks);"},{"lang":"cURL","source":"curl https://api.morphik.ai/retrieve/chunks/grouped \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $MORPHIK_API_KEY\" \\\n -d '{}'"}],"method":"post","type":"path","servers":[],"security":[],"path":"/retrieve/chunks/grouped","baseUrlOptions":[],"title":"Retrieve Chunks Grouped","codeSamples":[{"lang":"JavaScript","source":"import Morphik from 'morphik';\n\nconst client = new Morphik({\n apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.retrieve.chunks.createGrouped();\n\nconsole.log(response.chunks);"},{"lang":"cURL","source":"curl https://api.morphik.ai/retrieve/chunks/grouped \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $MORPHIK_API_KEY\" \\\n -d '{}'"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"54b27ac2-cd8f-4249-962a-37ded8d6ff01":{"name":"authorization","in":"header","required":false,"schema":{"oneOf":[{"type":"string","title":"Authorization","uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","title":"Authorization","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string | null"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"query":{"oneOf":[{"type":"string","title":"Query","description":"Natural-language query used to retrieve relevant chunks or documents.","minLength":1,"uniqueKey":"query.oneOf.0","typeLabel":"string"},{"type":"null","title":"Query","description":"Natural-language query used to retrieve relevant chunks or documents.","uniqueKey":"query.oneOf.1","typeLabel":"null"}],"uniqueKey":"query","typeLabel":"string | null"},"query_image":{"oneOf":[{"type":"string","title":"Query Image","description":"Base64-encoded image to use as query for Morphik multimodal retrieval. Requires use_colpali=True. Mutually exclusive with 'query'.","uniqueKey":"query_image.oneOf.0","typeLabel":"string"},{"type":"null","title":"Query Image","description":"Base64-encoded image to use as query for Morphik multimodal retrieval. Requires use_colpali=True. Mutually exclusive with 'query'.","uniqueKey":"query_image.oneOf.1","typeLabel":"null"}],"uniqueKey":"query_image","typeLabel":"string | null"},"filters":{"oneOf":[{"type":"object","title":"Filters","description":"Metadata filters supporting logical operators ($and/$or/$not/$nor) and field predicates ($eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$exists/$type/$regex/$contains).","additionalProperties":true,"uniqueKey":"filters.oneOf.0","typeLabel":"Filters · object"},{"type":"null","title":"Filters","description":"Metadata filters supporting logical operators ($and/$or/$not/$nor) and field predicates ($eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$exists/$type/$regex/$contains).","uniqueKey":"filters.oneOf.1","typeLabel":"null"}],"uniqueKey":"filters","typeLabel":"Filters · object | null"},"k":{"type":"integer","exclusiveMinimum":0,"title":"K","description":"Maximum number of chunks or documents to return.","default":4,"uniqueKey":"k","typeLabel":"integer"},"min_score":{"type":"number","title":"Min Score","description":"Minimum similarity score a result must meet before it is returned.","default":0,"uniqueKey":"min_score","typeLabel":"number"},"use_reranking":{"oneOf":[{"type":"boolean","title":"Use Reranking","description":"When provided, overrides the workspace reranking configuration for this request.","uniqueKey":"use_reranking.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Use Reranking","description":"When provided, overrides the workspace reranking configuration for this request.","uniqueKey":"use_reranking.oneOf.1","typeLabel":"null"}],"uniqueKey":"use_reranking","typeLabel":"boolean | null"},"use_colpali":{"oneOf":[{"type":"boolean","title":"Use Colpali","description":"When provided, uses Morphik's finetuned ColPali style embeddings (recommended to be True for high quality retrieval).","uniqueKey":"use_colpali.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Use Colpali","description":"When provided, uses Morphik's finetuned ColPali style embeddings (recommended to be True for high quality retrieval).","uniqueKey":"use_colpali.oneOf.1","typeLabel":"null"}],"uniqueKey":"use_colpali","typeLabel":"boolean | null"},"output_format":{"oneOf":[{"type":"string","title":"OutputFormat","description":"How to return image chunks: base64 (default), url, or text (markdown format)","default":"base64","enum":["base64","url","text"],"uniqueKey":"output_format.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","description":"How to return image chunks: base64 (default), url, or text (markdown format)","default":"base64","uniqueKey":"output_format.oneOf.1","typeLabel":"null"}],"uniqueKey":"output_format","typeLabel":"enum\u003cstring> | null"},"padding":{"type":"integer","minimum":0,"title":"Padding","description":"Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only)","default":0,"uniqueKey":"padding","typeLabel":"integer"},"folder_name":{"oneOf":[{"type":"string","title":"Folder Name","description":"Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list of paths.","uniqueKey":"folder_name.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"folder_name.oneOf.1.items.[INDEX]","typeLabel":"string"},"title":"Folder Name","description":"Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list of paths.","uniqueKey":"folder_name.oneOf.1","typeLabel":"string[]"},{"type":"null","title":"Folder Name","description":"Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list of paths.","uniqueKey":"folder_name.oneOf.2","typeLabel":"null"}],"uniqueKey":"folder_name","typeLabel":"string | string[] | null"},"folder_depth":{"oneOf":[{"type":"integer","title":"Folder Depth","description":"Folder scope depth. 0 or None = exact folder only, -1 = include all descendants, n > 0 = include descendants up to n levels deeper.","uniqueKey":"folder_depth.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Folder Depth","description":"Folder scope depth. 0 or None = exact folder only, -1 = include all descendants, n > 0 = include descendants up to n levels deeper.","uniqueKey":"folder_depth.oneOf.1","typeLabel":"null"}],"uniqueKey":"folder_depth","typeLabel":"integer | null"},"end_user_id":{"oneOf":[{"type":"string","title":"End User Id","description":"Optional end-user scope for the operation","uniqueKey":"end_user_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"End User Id","description":"Optional end-user scope for the operation","uniqueKey":"end_user_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"end_user_id","typeLabel":"string | null"}},"type":"object","title":"RetrieveRequest","description":"Base retrieve request model","uniqueKey":"","typeLabel":"RetrieveRequest · object"},"examples":{"Example":{"title":"Example","value":{"query":"\u003cstring>","query_image":"\u003cstring>","filters":{},"k":4,"min_score":0,"use_reranking":true,"use_colpali":true,"output_format":"base64","padding":0,"folder_name":"\u003cstring>","folder_depth":123,"end_user_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"5039e786-94fc-47fe-97d9-cab37fa07a65":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"chunks":{"items":{"properties":{"content":{"type":"string","title":"Content","isRequired":true,"uniqueKey":"chunks.items.[INDEX].content","typeLabel":"string"},"score":{"type":"number","title":"Score","isRequired":true,"uniqueKey":"chunks.items.[INDEX].score","typeLabel":"number"},"document_id":{"type":"string","title":"Document Id","isRequired":true,"uniqueKey":"chunks.items.[INDEX].document_id","typeLabel":"string"},"chunk_number":{"type":"integer","title":"Chunk Number","isRequired":true,"uniqueKey":"chunks.items.[INDEX].chunk_number","typeLabel":"integer"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","isRequired":true,"uniqueKey":"chunks.items.[INDEX].metadata","typeLabel":"Metadata · object"},"content_type":{"type":"string","title":"Content Type","isRequired":true,"uniqueKey":"chunks.items.[INDEX].content_type","typeLabel":"string"},"filename":{"oneOf":[{"type":"string","title":"Filename","uniqueKey":"chunks.items.[INDEX].filename.oneOf.0","typeLabel":"string"},{"type":"null","title":"Filename","uniqueKey":"chunks.items.[INDEX].filename.oneOf.1","typeLabel":"null"}],"uniqueKey":"chunks.items.[INDEX].filename","typeLabel":"string | null"},"download_url":{"oneOf":[{"type":"string","title":"Download Url","uniqueKey":"chunks.items.[INDEX].download_url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Download Url","uniqueKey":"chunks.items.[INDEX].download_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"chunks.items.[INDEX].download_url","typeLabel":"string | null"},"is_padding":{"type":"boolean","title":"Is Padding","description":"Whether this chunk was added as padding","default":false,"uniqueKey":"chunks.items.[INDEX].is_padding","typeLabel":"boolean"}},"type":"object","required":["content","score","document_id","chunk_number","metadata","content_type"],"title":"ChunkResult","description":"Query result at chunk level","uniqueKey":"chunks.items.[INDEX]","typeLabel":"ChunkResult · object"},"type":"array","title":"Chunks","description":"Flat list of all chunks (for backward compatibility)","isRequired":true,"uniqueKey":"chunks","typeLabel":"ChunkResult · object[]"},"groups":{"items":{"properties":{"main_chunk":{"properties":{"content":{"type":"string","title":"Content","isRequired":true,"uniqueKey":"groups.items.[INDEX].main_chunk.content","typeLabel":"string"},"score":{"type":"number","title":"Score","isRequired":true,"uniqueKey":"groups.items.[INDEX].main_chunk.score","typeLabel":"number"},"document_id":{"type":"string","title":"Document Id","isRequired":true,"uniqueKey":"groups.items.[INDEX].main_chunk.document_id","typeLabel":"string"},"chunk_number":{"type":"integer","title":"Chunk Number","isRequired":true,"uniqueKey":"groups.items.[INDEX].main_chunk.chunk_number","typeLabel":"integer"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","isRequired":true,"uniqueKey":"groups.items.[INDEX].main_chunk.metadata","typeLabel":"Metadata · object"},"content_type":{"type":"string","title":"Content Type","isRequired":true,"uniqueKey":"groups.items.[INDEX].main_chunk.content_type","typeLabel":"string"},"filename":{"oneOf":[{"type":"string","title":"Filename","uniqueKey":"groups.items.[INDEX].main_chunk.filename.oneOf.0","typeLabel":"string"},{"type":"null","title":"Filename","uniqueKey":"groups.items.[INDEX].main_chunk.filename.oneOf.1","typeLabel":"null"}],"uniqueKey":"groups.items.[INDEX].main_chunk.filename","typeLabel":"string | null"},"download_url":{"oneOf":[{"type":"string","title":"Download Url","uniqueKey":"groups.items.[INDEX].main_chunk.download_url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Download Url","uniqueKey":"groups.items.[INDEX].main_chunk.download_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"groups.items.[INDEX].main_chunk.download_url","typeLabel":"string | null"},"is_padding":{"type":"boolean","title":"Is Padding","description":"Whether this chunk was added as padding","default":false,"uniqueKey":"groups.items.[INDEX].main_chunk.is_padding","typeLabel":"boolean"}},"type":"object","required":["content","score","document_id","chunk_number","metadata","content_type"],"title":"ChunkResult","description":"Query result at chunk level","isRequired":true,"uniqueKey":"groups.items.[INDEX].main_chunk","typeLabel":"ChunkResult · object"},"total_chunks":{"type":"integer","title":"Total Chunks","description":"Total number of chunks in this group","isRequired":true,"uniqueKey":"groups.items.[INDEX].total_chunks","typeLabel":"integer"},"padding_chunks":{"items":{"properties":{"content":{"type":"string","title":"Content","isRequired":true,"uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].content","typeLabel":"string"},"score":{"type":"number","title":"Score","isRequired":true,"uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].score","typeLabel":"number"},"document_id":{"type":"string","title":"Document Id","isRequired":true,"uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].document_id","typeLabel":"string"},"chunk_number":{"type":"integer","title":"Chunk Number","isRequired":true,"uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].chunk_number","typeLabel":"integer"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","isRequired":true,"uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].metadata","typeLabel":"Metadata · object"},"content_type":{"type":"string","title":"Content Type","isRequired":true,"uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].content_type","typeLabel":"string"},"filename":{"oneOf":[{"type":"string","title":"Filename","uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].filename.oneOf.0","typeLabel":"string"},{"type":"null","title":"Filename","uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].filename.oneOf.1","typeLabel":"null"}],"uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].filename","typeLabel":"string | null"},"download_url":{"oneOf":[{"type":"string","title":"Download Url","uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].download_url.oneOf.0","typeLabel":"string"},{"type":"null","title":"Download Url","uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].download_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].download_url","typeLabel":"string | null"},"is_padding":{"type":"boolean","title":"Is Padding","description":"Whether this chunk was added as padding","default":false,"uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX].is_padding","typeLabel":"boolean"}},"type":"object","required":["content","score","document_id","chunk_number","metadata","content_type"],"title":"ChunkResult","description":"Query result at chunk level","uniqueKey":"groups.items.[INDEX].padding_chunks.items.[INDEX]","typeLabel":"ChunkResult · object"},"type":"array","title":"Padding Chunks","uniqueKey":"groups.items.[INDEX].padding_chunks","typeLabel":"ChunkResult · object[]"}},"type":"object","required":["main_chunk","total_chunks"],"title":"ChunkGroup","description":"Represents a group of chunks: one main match + its padding chunks","uniqueKey":"groups.items.[INDEX]","typeLabel":"ChunkGroup · object"},"type":"array","title":"Groups","description":"Grouped chunks for UI display","isRequired":true,"uniqueKey":"groups","typeLabel":"ChunkGroup · object[]"},"total_results":{"type":"integer","title":"Total Results","description":"Total number of unique chunks","isRequired":true,"uniqueKey":"total_results","typeLabel":"integer"},"has_padding":{"type":"boolean","title":"Has Padding","description":"Whether padding was applied to any results","isRequired":true,"uniqueKey":"has_padding","typeLabel":"boolean"}},"type":"object","required":["chunks","groups","total_results","has_padding"],"title":"GroupedChunkResponse","description":"Response that includes both flat results and grouped results for UI","uniqueKey":"","typeLabel":"GroupedChunkResponse · object"},"examples":{"Example":{"title":"Example","value":{"chunks":[{"content":"\u003cstring>","score":123,"document_id":"\u003cstring>","chunk_number":123,"metadata":{},"content_type":"\u003cstring>","filename":"\u003cstring>","download_url":"\u003cstring>","is_padding":false}],"groups":[{"main_chunk":{"content":"\u003cstring>","score":123,"document_id":"\u003cstring>","chunk_number":123,"metadata":{},"content_type":"\u003cstring>","filename":"\u003cstring>","download_url":"\u003cstring>","is_padding":false},"total_chunks":123,"padding_chunks":[{"content":"\u003cstring>","score":123,"document_id":"\u003cstring>","chunk_number":123,"metadata":{},"content_type":"\u003cstring>","filename":"\u003cstring>","download_url":"\u003cstring>","is_padding":false}]}],"total_results":123,"has_padding":true}}},"exampleType":"generated"}},"exampleType":"generated"},"07d8acdd-16be-4c9f-a472-9f464f7a8ec9":{"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"}},"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>"}]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{},"servers":{}},"originalFileLocation":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml"},"subdomain":"databridge","siteName":"Morphik Documentation","title":"Retrieve Chunks Grouped - Morphik Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-22T23:19:40.009Z","originalFileLocation":"api-reference/retrieve-chunks-grouped.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=\"light\"}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=\"Retrieve relevant chunks with grouped response format. Uses the same filter operators as /retrieve/chunks (equality, $eq/$ne, $gt/$gte/$lt/$lte, $in/$nin, $exists, $type, $regex, $contains, and the logical $and/$or/$nor/$not), with arbitrary nesting supported inside request.filters. Returns both flat results (for backward compatibility) and grouped results (for UI). When padding \u0026gt; 0, groups chunks by main matches and their padding chunks.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Morphik Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/databridge/GwARqmEiOtZ6Hg51/_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=\"/docs/mintlify-assets/_mintlify/favicons/databridge/GwARqmEiOtZ6Hg51/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/databridge/GwARqmEiOtZ6Hg51/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/databridge/GwARqmEiOtZ6Hg51/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/databridge/GwARqmEiOtZ6Hg51/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/databridge/GwARqmEiOtZ6Hg51/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/databridge/GwARqmEiOtZ6Hg51/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/databridge/GwARqmEiOtZ6Hg51/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/databridge/GwARqmEiOtZ6Hg51/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Retrieve Chunks Grouped - Morphik Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Retrieve relevant chunks with grouped response format. Uses the same filter operators as /retrieve/chunks (equality, $eq/$ne, $gt/$gte/$lt/$lte, $in/$nin, $exists, $type, $regex, $contains, and the logical $and/$or/$nor/$not), with arbitrary nesting supported inside request.filters. Returns both flat results (for backward compatibility) and grouped results (for UI). When padding \u0026gt; 0, groups chunks by main matches and their padding chunks.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Morphik Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://morphik.ai/docs/api-reference/retrieve-chunks-grouped\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://databridge.mintlify.site/docs/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Retrieve+Chunks+Grouped\u0026amp;description=Retrieve+relevant+chunks+with+grouped+response+format.%0A%0AUses+the+same+filter+operators+as+%60%2Fretrieve%2Fchunks%60+%28equality%2C+%60%24eq%2F%24ne%60%2C+%60%24gt%2F%24gte%2F%24lt%2F%24lte%60%2C+%60%24in%2F%24ni\u0026amp;theme=83ee97c449cd477808afddfd\u0026amp;signature=5474a1d4e82ad1aee2170cec195516028026559ef4a0f51d6f3fcbe2beef2161\">\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=\"Retrieve Chunks Grouped - Morphik Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Retrieve relevant chunks with grouped response format. Uses the same filter operators as /retrieve/chunks (equality, $eq/$ne, $gt/$gte/$lt/$lte, $in/$nin, $exists, $type, $regex, $contains, and the logical $and/$or/$nor/$not), with arbitrary nesting supported inside request.filters. Returns both flat results (for backward compatibility) and grouped results (for UI). When padding \u0026gt; 0, groups chunks by main matches and their padding chunks.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://databridge.mintlify.site/docs/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Retrieve+Chunks+Grouped\u0026amp;description=Retrieve+relevant+chunks+with+grouped+response+format.%0A%0AUses+the+same+filter+operators+as+%60%2Fretrieve%2Fchunks%60+%28equality%2C+%60%24eq%2F%24ne%60%2C+%60%24gt%2F%24gte%2F%24lt%2F%24lte%60%2C+%60%24in%2F%24ni\u0026amp;theme=83ee97c449cd477808afddfd\u0026amp;signature=5474a1d4e82ad1aee2170cec195516028026559ef4a0f51d6f3fcbe2beef2161\">\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=\"/docs/mintlify-assets/_mintlify/favicons/databridge/GwARqmEiOtZ6Hg51/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Morphik Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#000000\">\u003clink data-mint-head rel=\"canonical\" href=\"https://morphik.ai/docs/api-reference/retrieve-chunks-grouped\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/retrieve-chunks-grouped.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://morphik.ai/#organization\",\"name\":\"Morphik Documentation\",\"url\":\"https://morphik.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/databridge/DOquaEmX3ZFpdpaS/logo/light.png?fit=max\u0026auto=format\u0026n=DOquaEmX3ZFpdpaS\u0026q=85\u0026s=fdfc76422f7ad5f822941fb2306c2fd2\"}},{\"@type\":\"WebSite\",\"@id\":\"https://morphik.ai/docs#website\",\"name\":\"Morphik Documentation\",\"url\":\"https://morphik.ai/docs\",\"publisher\":{\"@id\":\"https://morphik.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://morphik.ai/docs/api-reference/retrieve-chunks-grouped#webpage\",\"url\":\"https://morphik.ai/docs/api-reference/retrieve-chunks-grouped\",\"name\":\"Retrieve Chunks Grouped\",\"description\":\"Retrieve relevant chunks with grouped response format. Uses the same filter operators as /retrieve/chunks (equality, $eq/$ne, $gt/$gte/$lt/$lte, $in/$nin, $exists, $type, $regex, $contains, and the logical $and/$or/$nor/$not), with arbitrary nesting supported inside request.filters. Returns both flat results (for backward compatibility) and grouped results (for UI). When padding > 0, groups chunks by main matches and their padding chunks.\",\"dateModified\":\"2026-01-22T23:19:40.009Z\",\"isPartOf\":{\"@id\":\"https://morphik.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://morphik.ai/docs/api-reference/retrieve-chunks-grouped#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://morphik.ai/docs/api-reference/retrieve-chunks-grouped#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://morphik.ai/docs/api-reference/get-available-models\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Retrieve Chunks Grouped\",\"item\":\"https://morphik.ai/docs/api-reference/retrieve-chunks-grouped\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://morphik.ai/docs/api-reference/retrieve-chunks-grouped#apireference\",\"headline\":\"Retrieve Chunks Grouped\",\"name\":\"Retrieve Chunks Grouped\",\"description\":\"Retrieve relevant chunks with grouped response format. Uses the same filter operators as /retrieve/chunks (equality, $eq/$ne, $gt/$gte/$lt/$lte, $in/$nin, $exists, $type, $regex, $contains, and the logical $and/$or/$nor/$not), with arbitrary nesting supported inside request.filters. Returns both flat results (for backward compatibility) and grouped results (for UI). When padding > 0, groups chunks by main matches and their padding chunks.\",\"url\":\"https://morphik.ai/docs/api-reference/retrieve-chunks-grouped\",\"mainEntityOfPage\":{\"@id\":\"https://morphik.ai/docs/api-reference/retrieve-chunks-grouped#webpage\"},\"dateModified\":\"2026-01-22T23:19:40.009Z\",\"publisher\":{\"@id\":\"https://morphik.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://morphik.ai/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Morphik Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Morphik Documentation","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Getting Started","pages":[{"title":"Getting Started with Morphik API","href":"/api-reference/getting-started"}]},{"group":"API Reference","pages":[{"title":"Get Available Models","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /models","href":"/api-reference/get-available-models"},{"title":"Retrieve Chunks","description":"Retrieve relevant chunks.\n\nThe optional `request.filters` payload accepts equality checks (which also match scalars inside JSON arrays)\nplus the logical operators `$and`, `$or`, `$nor`, and `$not`. Field-level predicates include `$eq`, `$ne`,\n`$in`, `$nin`, `$exists`, `$type`, `$regex`, `$contains`, and the comparison operators `$gt`, `$gte`, `$lt`,\nand `$lte`. Comparison clauses evaluate typed metadata (`number`, `decimal`, `datetime`, or `date`) and\nraise detailed validation errors when operands cannot be coerced. Regex filters allow the optional `i` flag\nfor case-insensitive matching, while `$contains` performs substring checks (case-insensitive by default,\nconfigurable via `case_sensitive`). Filters can be nested freely, for example:\n\n```json\n{\n \"$and\": [\n {\"category\": \"policy\"},\n {\"$or\": [{\"region\": \"emea\"}, {\"priority\": {\"$in\": [\"p0\", \"p1\"]}}]}\n ]\n}\n```\nReturns a list of `ChunkResult` objects ordered by relevance.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /retrieve/chunks","href":"/api-reference/retrieve-chunks"},{"title":"Retrieve Chunks Grouped","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /retrieve/chunks/grouped","href":"/api-reference/retrieve-chunks-grouped"},{"title":"Retrieve Documents","description":"Retrieve relevant documents.\n\n`request.filters` supports equality checks (including scalar-to-array matches) and the same operator set as\n`/retrieve/chunks`: logical composition via `$and`, `$or`, `$nor`, `$not`, plus field predicates `$eq`, `$ne`,\n`$gt`, `$gte`, `$lt`, `$lte`, `$in`, `$nin`, `$exists`, `$type`, `$regex`, and `$contains`. Use the same JSON\nstructure as `/retrieve/chunks` when expressing complex logic. Comparison operators require metadata typed as\n`number`, `decimal`, `datetime`, or `date`.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /retrieve/docs","href":"/api-reference/retrieve-documents"},{"title":"Search Documents By Name","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /search/documents","href":"/api-reference/search-documents-by-name"},{"title":"Batch Get Documents","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /batch/documents","href":"/api-reference/batch-get-documents"},{"title":"Batch Get Chunks","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /batch/chunks","href":"/api-reference/batch-get-chunks"},{"title":"Query Completion","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /query","href":"/api-reference/query-completion"},{"title":"Get Chat History","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /chat/{chat_id}","href":"/api-reference/get-chat-history"},{"title":"Get Available Models For Selection","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /models/available","href":"/api-reference/get-available-models-for-selection"},{"title":"Generate Cloud Uri","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /cloud/generate_uri","href":"/api-reference/generate-cloud-uri"},{"title":"List Cloud Apps","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /apps","href":"/api-reference/list-cloud-apps"},{"title":"Delete Cloud App","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml delete /apps","href":"/api-reference/delete-cloud-app"},{"title":"Rotate App Token","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /apps/rotate_token","href":"/api-reference/rotate-app-token"},{"title":"Rename Cloud App","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml patch /apps/rename","href":"/api-reference/rename-cloud-app"},{"title":"List Chat Conversations","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /chats","href":"/api-reference/list-chat-conversations"},{"title":"Update Chat Title","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml patch /chats/{chat_id}/title","href":"/api-reference/update-chat-title"}]},{"group":"models","pages":[{"title":"Save Model","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /models","href":"/api-reference/models/save-model"},{"title":"List Custom Models","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /models/custom","href":"/api-reference/models/list-custom-models"},{"title":"Delete Model","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml delete /models/{model_id}","href":"/api-reference/models/delete-model"},{"title":"List Api Keys","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /api-keys","href":"/api-reference/models/list-api-keys"},{"title":"Save Api Key","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /api-keys","href":"/api-reference/models/save-api-key"}]},{"group":"health","pages":[{"title":"Ping Health","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /ping","href":"/api-reference/health/ping-health"},{"title":"Health Check","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /health","href":"/api-reference/health/health-check"}]},{"group":"Ingestion","pages":[{"title":"Ingest Text","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ingest/text","href":"/api-reference/ingestion/ingest-text"},{"title":"Ingest File","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ingest/file","href":"/api-reference/ingestion/ingest-file"},{"title":"Batch Ingest Files","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ingest/files","href":"/api-reference/ingestion/batch-ingest-files"},{"title":"Requeue Ingest Jobs","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ingest/requeue","href":"/api-reference/ingestion/requeue-ingest-jobs"},{"title":"Query Document","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ingest/document/query","href":"/api-reference/ingestion/query-document"}]},{"group":"Documents","pages":[{"title":"List Docs","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /documents/list_docs","href":"/api-reference/documents/list-docs"},{"title":"List Docs","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /documents","href":"/api-reference/documents/list-docs-1"},{"title":"Get Document","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /documents/{document_id}","href":"/api-reference/documents/get-document"},{"title":"Delete Document","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml delete /documents/{document_id}","href":"/api-reference/documents/delete-document"},{"title":"Get Document Status","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /documents/{document_id}/status","href":"/api-reference/documents/get-document-status"},{"title":"Get Document Summary","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /documents/{document_id}/summary","href":"/api-reference/documents/get-document-summary"},{"title":"Upsert Document Summary","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml put /documents/{document_id}/summary","href":"/api-reference/documents/upsert-document-summary"},{"title":"Get Document By Filename","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /documents/filename/{filename}","href":"/api-reference/documents/get-document-by-filename"},{"title":"Get Document Download Url","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /documents/{document_id}/download_url","href":"/api-reference/documents/get-document-download-url"},{"title":"Download Document File","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /documents/{document_id}/file","href":"/api-reference/documents/download-document-file"},{"title":"Update Document Text","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /documents/{document_id}/update_text","href":"/api-reference/documents/update-document-text"},{"title":"Update Document File","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /documents/{document_id}/update_file","href":"/api-reference/documents/update-document-file"},{"title":"Update Document Metadata","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /documents/{document_id}/update_metadata","href":"/api-reference/documents/update-document-metadata"},{"title":"Extract Document Pages","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /documents/pages","href":"/api-reference/documents/extract-document-pages"}]},{"group":"Folders","pages":[{"title":"List Folders","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /folders","href":"/api-reference/folders/list-folders"},{"title":"Create Folder","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /folders","href":"/api-reference/folders/create-folder"},{"title":"Folder Details","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /folders/details","href":"/api-reference/folders/folder-details"},{"title":"List Folder Summaries","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /folders/summary","href":"/api-reference/folders/list-folder-summaries"},{"title":"Get Folder Summary","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /folders/{folder_id_or_name}/summary","href":"/api-reference/folders/get-folder-summary"},{"title":"Upsert Folder Summary","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml put /folders/{folder_id_or_name}/summary","href":"/api-reference/folders/upsert-folder-summary"},{"title":"Add Document To Folder","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /folders/{folder_id_or_name}/documents/{document_id}","href":"/api-reference/folders/add-document-to-folder"},{"title":"Remove Document From Folder","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml delete /folders/{folder_id_or_name}/documents/{document_id}","href":"/api-reference/folders/remove-document-from-folder"},{"title":"Get Folder","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /folders/{folder_id_or_name}","href":"/api-reference/folders/get-folder"},{"title":"Delete Folder","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml delete /folders/{folder_id_or_name}","href":"/api-reference/folders/delete-folder"}]},{"group":"Logs","pages":[{"title":"Get Logs","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /logs/","href":"/api-reference/logs/get-logs"}]},{"group":"Usage","pages":[{"title":"Get App Storage Usage","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /usage/app-storage","href":"/api-reference/usage/get-app-storage-usage"}]},{"group":"EE - Connectors","pages":[{"title":"Get Auth Status For Connector","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /ee/connectors/{connector_type}/auth_status","href":"/api-reference/ee--connectors/get-auth-status-for-connector"},{"title":"Get Initiate Auth Url","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /ee/connectors/{connector_type}/auth/initiate_url","href":"/api-reference/ee--connectors/get-initiate-auth-url"},{"title":"Connector Oauth Callback","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /ee/connectors/{connector_type}/oauth2callback","href":"/api-reference/ee--connectors/connector-oauth-callback"},{"title":"Finalize Manual Auth","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ee/connectors/{connector_type}/auth/finalize","href":"/api-reference/ee--connectors/finalize-manual-auth"},{"title":"List Files For Connector","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml get /ee/connectors/{connector_type}/files","href":"/api-reference/ee--connectors/list-files-for-connector"},{"title":"Ingest File","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ee/connectors/{connector_type}/ingest","href":"/api-reference/ee--connectors/ingest-file"},{"title":"Ingest Repository","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ee/connectors/{connector_type}/ingest-repository","href":"/api-reference/ee--connectors/ingest-repository"},{"title":"Get Status","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ee/connectors/status","href":"/api-reference/ee--connectors/get-status"},{"title":"Initiate Auth","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ee/connectors/initiate-auth","href":"/api-reference/ee--connectors/initiate-auth"},{"title":"Finalize Auth","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ee/connectors/finalize-auth","href":"/api-reference/ee--connectors/finalize-auth"},{"title":"Disconnect","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ee/connectors/disconnect","href":"/api-reference/ee--connectors/disconnect"},{"title":"List Files","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /ee/connectors/list-files","href":"/api-reference/ee--connectors/list-files"}]}]},{"tab":"Python SDK","pages":[{"title":"Python SDK","href":"/python-sdk/morphik"}]},{"tab":"Knowledge Base","pages":[{"title":"Knowledge Base","href":"/knowledge-base/how-do-i-set-up-rag"}]}]},"basePath":"","title":"Retrieve Chunks Grouped - Morphik Documentation","buildId":"dpl_BSPUBxEoKhhK7HzXVDPxdPvWx4xc","deploymentId":"dpl_BSPUBxEoKhhK7HzXVDPxdPvWx4xc","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-Do6EtGSl.js","utils-id4tQ6My.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-Byrixac4.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-nakYa3Zl.js","snippetPresets-Bq-pUS7h.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-CujTC_9K.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-FneVUsVu.js","shallow-DY9WpUCz.js","getApiPlaygroundDisplay-Bz8WpPfA.js","CodeSnippet-DgCuJg4G.js","CodeSnippets-Dub9c4T0.js","Page-CePXnjd1.js","getPastedJson-xdI8y2XB.js","icon--yVw5vkr.js","MethodPill-C47t7MdS.js","DuplicateIcon-BzwJ2LeC.js","createIcon-BzggGy84.js","DynamicMarkdown-AlxJK8VR.js","SectionHeading-CMlwFxdK.js","axios-vUo_bRtp.js","Markdown-BNgNrPsi.js","clsx-apD-Q0Oo.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-qmLwQyWY.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Dc4qTkWx.js"]}