Upload a document to have it extracted, chunked, and ingested into a memory collection in a single request. 60db’s document extraction engine handles 91+ file formats and includes built-in OCR for scanned PDFs and images, so you can send the raw file and let the server do the rest.The browser just posts the file and 60db handles format detection, OCR, chunking, and ingestion.
Display title for the document. Defaults to the uploaded filename.
When the document produces multiple chunks, each chunk is labeled "{title} (part N/M)".
When you POST a file, 60db runs it through this pipeline:
Validate — file present, type allowed, under 200 MB, collection accessible.
Extract — the document extraction engine detects the format (PDF, DOCX, image, etc.) and returns plain text plus metadata (mime_type, page_count, tables, quality_score). OCR is applied automatically for scanned PDFs and images.
Chunk — split the extracted text into overlapping segments of chunk_size characters with chunk_overlap character overlap.
Register collection — ensure the target collection is ready (idempotent, cached).
Ingest — stream all chunks into the memory layer in a single batch.
Return — the response includes one {id, status, message} entry per chunk. Processing continues asynchronously.
For very large documents, prefer a higher chunk_size (e.g. 3000) to keep the per-chunk memory count low. The endpoint rejects uploads that produce more than 100 chunks with a TOO_MANY_CHUNKS error — split such files before upload or use a larger chunk size.
Document upload is two-stage billing — you pay for the extraction and for the resulting ingest.
Stage
Rate
When charged
Refund on failure
Extract fee
$0.003 per MB
Before extraction runs
Yes, auto
Ingest fee
$0.0001 per 1,000 extracted characters
After extraction, before ingest
Yes, auto
The two charges are separate rows in transaction_log (MEMORY_EXTRACT and MEMORY_INGEST) so you can distinguish extraction cost from storage cost in your reporting.Example — uploading a 2 MB PDF that extracts to 50,000 characters of text:
Wallet balance after the extract fee was deducted (set before ingest runs)
x-credit-charged
Just the extract fee
x-credit-charged-total
Extract fee + ingest fee combined
x-billing-tx
UUID of the extract audit row (the ingest row is linked via metadata)
Special failure case — if extraction succeeds but your wallet can’t cover the post-extraction ingest charge, the extract fee is automatically refunded and the response is 402 INSUFFICIENT_CREDITS with details.extract_fee_refunded populated. You pay nothing for the failed attempt.See Pricing & Billing for the full policy.
Wallet cannot cover the extract fee (pre-charge) OR the post-extraction ingest fee (in which case details.extract_fee_refunded is populated).
403
POLICY_DENY
Your role (e.g. viewer) is not allowed to create memories.
404
COLLECTION_NOT_FOUND
The specified collection doesn’t exist or you can’t access it.
413
TOO_MANY_CHUNKS
Document produced more than 100 chunks. Increase chunk_size or split the file. Full auto-refund.
422
EMPTY_EXTRACTION
Document contains no extractable text. Full auto-refund.
422
EMPTY_CHUNKS
Chunking produced zero segments. Full auto-refund.
422
EXTRACTION_FAILED
Extraction engine rejected the file. Full auto-refund.
503
MEMORY_INFRA_NOT_READY
The workspace’s memory layer is still provisioning. Retry in ~10s. Full auto-refund.
503
EXTRACTION_SERVICE_UNAVAILABLE
Document extraction is temporarily unavailable. Full auto-refund.
202
MEMORY_QUEUED
Memory layer is temporarily unreachable; chunks were queued and will retry automatically. Both extract and ingest fees are refunded because the work won’t actually happen.
The endpoint returns immediately once chunks are queued — full embedding/indexing happens asynchronously. Poll GET /memory/:id/status with any of the returned chunk IDs to check progress:
Chunks per document: 100 (use a larger chunk_size to fit bigger files)
Chunk text length: 100,000 characters
Supported languages for OCR: 100+ languages including English, Spanish, French, German, Chinese, Japanese, Arabic, Hindi, and more
Rate limit: Same as POST /memory/ingest/batch (30 uploads/min per workspace on default plans)
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"60db","colors":{"primary":"#4A3228","light":"#F5EFE8","dark":"#4A3228"},"logo":{"light":"https://mintcdn.com/60db-c848165a/83Hv-Y-hnK8ZdMCS/logo/60db-logo.svg?fit=max\u0026auto=format\u0026n=83Hv-Y-hnK8ZdMCS\u0026q=85\u0026s=7334adf60f84684685b34f6455a5a071","dark":"https://mintcdn.com/60db-c848165a/83Hv-Y-hnK8ZdMCS/logo/60db-logo-dark.svg?fit=max\u0026auto=format\u0026n=83Hv-Y-hnK8ZdMCS\u0026q=85\u0026s=2912d99ca05c091678a2f08253d2bf5e"},"favicon":"https://mintcdn.com/60db-c848165a/83Hv-Y-hnK8ZdMCS/logo/60db-logo.svg?fit=max\u0026auto=format\u0026n=83Hv-Y-hnK8ZdMCS\u0026q=85\u0026s=7334adf60f84684685b34f6455a5a071","api":{"playground":{"display":"interactive"},"mdx":{"auth":{"method":"bearer"},"server":"https://api.60db.ai"}},"background":{"color":{"light":"#F5EFE8","dark":"#4A3228"}},"navbar":{"links":[{"href":"mailto:[email protected]","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.60db.ai"}},"footer":{"socials":{"twitter":"https://x.com/60dbAi","github":"https://github.com/60db-ai","linkedin":"https://www.linkedin.com/company/60-db"}},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Dashboard","icon":"book-open-cover","href":"https://app.60db.ai"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"60db-c848165a","hasAudioNarration":false,"actualSubdomain":"60db-c848165a","customDomains":["docs.60db.ai"],"gitSource":{"type":"github","owner":"60db-ai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ad0a5f26876b3f850a82f33","collectionId":"fd270072-1322-4464-84a5-2a196fec09dc","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ad0a5f26876b3f850a82f33"},"entitlements":{},"buildId":"6ad0a5f26876b3f850a82f33","clientVersion":"0.0.3966","searchFilterCounts":[{"language":"default","tag":"API Reference","count":115},{"language":"default","tag":"Dialer","count":25},{"language":"default","tag":"CLI Reference","count":23},{"language":"default","tag":"Documentation","count":19},{"language":"default","tag":"MCP Server","count":18},{"language":"default","tag":"Judge","count":14},{"language":"default","tag":"CLI Commands","count":13},{"language":"default","tag":"Core Features","count":13},{"language":"default","tag":"Music","count":9},{"language":"default","tag":"Voices","count":9}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"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":"editor-v7-file-tree","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":"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":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"editor-nav-generations","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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/memory/extract-document","slug":"/api-reference/memory/extract-document","pageMetadata":{"title":"Upload Document","description":"Extract text from a document (PDF, DOCX, XLSX, scanned images...) with built-in OCR and ingest it into a memory collection in a single request","api":"POST /memory/documents/extract","href":"/api-reference/memory/extract-document"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Extract text from a document (PDF, DOCX, XLSX, scanned images…) with built-in OCR and ingest it into a memory collection in a single request\"\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,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Info,ParamField,ResponseField,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Upload a document to have it extracted, chunked, and ingested into a memory collection in a single request. 60db’s document extraction engine handles 91+ file formats and includes built-in OCR for scanned PDFs and images, so you can send the raw file and let the server do the rest.`}),`\n`,_jsx(_components.p,{children:`The browser just posts the file and 60db handles format detection, OCR, chunking, and ingestion.`}),`\n`,_jsxs(Info,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Supported formats`}),` (partial list — 91 total):`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Documents`}),`: PDF, DOCX, DOC, ODT, RTF, TXT, MD, HTML, EPUB`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Spreadsheets`}),`: XLSX, XLS, CSV, ODS`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Presentations`}),`: PPTX, PPT, ODP`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Email`}),`: EML, MSG, PST, MBOX`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Images (OCR)`}),`: PNG, JPG, JPEG, TIFF, BMP, GIF`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Code \u0026 structured`}),`: JSON, XML, YAML, LaTeX, Markdown variants`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Archives`}),`: ZIP, TAR, GZIP, 7Z (extracted recursively)`]}),`\n`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(Heading,{level:`3`,id:`headers`,children:`Headers`}),`\n`,_jsx(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:_jsx(_components.p,{children:`Bearer token with your API key`})}),`\n`,_jsx(ParamField,{header:`Content-Type`,type:`string`,id:`param-content-type`,children:_jsx(_components.p,{children:`multipart/form-data`})}),`\n`,_jsx(Heading,{level:`3`,id:`body-multipart/form-data`,children:`Body (multipart/form-data)`}),`\n`,_jsx(ParamField,{body:`file`,type:`file`,required:true,id:`param-file`,children:_jsx(_components.p,{children:`The document to extract. Max 200 MB per file.`})}),`\n`,_jsx(ParamField,{body:`collection`,type:`string`,id:`param-collection`,children:_jsx(_components.p,{children:`Collection ID to store the extracted chunks in. Defaults to the caller’s personal collection.`})}),`\n`,_jsx(ParamField,{body:`type`,type:`string`,default:`knowledge`,id:`param-type`,children:_jsxs(_components.p,{children:[`Memory type for the ingested chunks. One of: `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`knowledge`}),`, `,_jsx(_components.code,{children:`hive`}),`.\nFor document uploads, `,_jsx(_components.code,{children:`knowledge`}),` is almost always the right choice.`]})}),`\n`,_jsx(ParamField,{body:`title`,type:`string`,id:`param-title`,children:_jsxs(_components.p,{children:[`Display title for the document. Defaults to the uploaded filename.\nWhen the document produces multiple chunks, each chunk is labeled `,_jsx(_components.code,{children:`\"{title} (part N/M)\"`}),`.`]})}),`\n`,_jsx(ParamField,{body:`chunk_size`,type:`integer`,default:`1500`,id:`param-chunk-size`,children:_jsx(_components.p,{children:`Maximum characters per chunk. Larger chunks preserve more context but are less precise for recall.\nMinimum 200, maximum 8000.`})}),`\n`,_jsx(ParamField,{body:`chunk_overlap`,type:`integer`,default:`200`,id:`param-chunk-overlap`,children:_jsxs(_components.p,{children:[`Characters of overlap between adjacent chunks. Helps preserve sentences that span chunk boundaries.\nMust be less than `,_jsx(_components.code,{children:`chunk_size`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,id:`param-success`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` on success.`]})}),`\n`,_jsx(ResponseField,{name:`data`,type:`object`,id:`param-data`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`collection_id`,type:`string`,id:`param-collection-id`,children:_jsx(_components.p,{children:`The collection the chunks were stored in.`})}),_jsx(ResponseField,{name:`collection_label`,type:`string`,id:`param-collection-label`,children:_jsx(_components.p,{children:`Human-readable collection name.`})}),_jsx(ResponseField,{name:`filename`,type:`string`,id:`param-filename`,children:_jsx(_components.p,{children:`Original filename of the uploaded document.`})}),_jsx(ResponseField,{name:`chunks`,type:`integer`,id:`param-chunks`,children:_jsx(_components.p,{children:`Number of chunks produced from the extracted text.`})}),_jsx(ResponseField,{name:`characters`,type:`integer`,id:`param-characters`,children:_jsx(_components.p,{children:`Total characters of extracted text.`})}),_jsx(ResponseField,{name:`memory_type`,type:`string`,id:`param-memory-type`,children:_jsxs(_components.p,{children:[`The memory type used for ingest (`,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`knowledge`}),`, or `,_jsx(_components.code,{children:`hive`}),`).`]})}),_jsx(ResponseField,{name:`total_queued`,type:`integer`,id:`param-total-queued`,children:_jsxs(_components.p,{children:[`Number of memories queued for processing (equals `,_jsx(_components.code,{children:`chunks`}),`).`]})}),_jsx(ResponseField,{name:`results`,type:`array`,id:`param-results`,children:_jsxs(_components.p,{children:[`Array of `,_jsx(_components.code,{children:`{id, status, message}`}),` — one entry per chunk ingested. Use the IDs with `,_jsx(_components.code,{children:`GET /memory/:id/status`}),` to poll for processing completion.`]})}),_jsx(ResponseField,{name:`metadata`,type:`object`,id:`param-metadata`,children:_jsxs(_components.p,{children:[`Extracted document metadata, including `,_jsx(_components.code,{children:`mime_type`}),`, `,_jsx(_components.code,{children:`filename`}),`, `,_jsx(_components.code,{children:`page_count`}),` (for PDFs), `,_jsx(_components.code,{children:`detected_languages`}),`, and `,_jsx(_components.code,{children:`total_chunks`}),`.`]})})]})}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,`\n`,`\n`,_jsx(Heading,{level:`2`,id:`pipeline`,children:`Pipeline`}),`\n`,_jsx(_components.p,{children:`When you POST a file, 60db runs it through this pipeline:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Validate`}),` — file present, type allowed, under 200 MB, collection accessible.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Extract`}),` — the document extraction engine detects the format (PDF, DOCX, image, etc.) and returns plain text plus metadata (`,_jsx(_components.code,{children:`mime_type`}),`, `,_jsx(_components.code,{children:`page_count`}),`, `,_jsx(_components.code,{children:`tables`}),`, `,_jsx(_components.code,{children:`quality_score`}),`). OCR is applied automatically for scanned PDFs and images.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Chunk`}),` — split the extracted text into overlapping segments of `,_jsx(_components.code,{children:`chunk_size`}),` characters with `,_jsx(_components.code,{children:`chunk_overlap`}),` character overlap.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Register collection`}),` — ensure the target collection is ready (idempotent, cached).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Ingest`}),` — stream all chunks into the memory layer in a single batch.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Return`}),` — the response includes one `,_jsx(_components.code,{children:`{id, status, message}`}),` entry per chunk. Processing continues asynchronously.`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`For very large documents, prefer a higher `,_jsx(_components.code,{children:`chunk_size`}),` (e.g. 3000) to keep the per-chunk memory count low. The endpoint rejects uploads that produce more than 100 chunks with a `,_jsx(_components.code,{children:`TOO_MANY_CHUNKS`}),` error — split such files before upload or use a larger chunk size.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`tuning`,children:`Tuning`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Document type`}),_jsxs(_components.th,{children:[`Recommended `,_jsx(_components.code,{children:`chunk_size`})]}),_jsx(_components.th,{children:_jsx(_components.code,{children:`chunk_overlap`})}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Technical docs / API refs`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1500`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`200`}),_jsx(_components.td,{children:`Default. Balances recall precision and context.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Long-form prose / books`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2500`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`300`}),_jsx(_components.td,{children:`Fewer chunks, more context per result.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`FAQs / short snippets`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`800`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`100`}),_jsx(_components.td,{children:`Higher precision — each Q\u0026A becomes its own chunk.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Spreadsheet exports`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3000`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`0`}),_jsx(_components.td,{children:`Tables should stay contiguous; overlap hurts.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Scanned PDFs (OCR)`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2000`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`250`}),_jsx(_components.td,{children:`OCR adds whitespace noise; slightly longer chunks help.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`billing`,children:`Billing`}),`\n`,_jsxs(_components.p,{children:[`Document upload is `,_jsx(_components.strong,{children:`two-stage billing`}),` — you pay for the extraction and for the resulting ingest.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Stage`}),_jsx(_components.th,{children:`Rate`}),_jsx(_components.th,{children:`When charged`}),_jsx(_components.th,{children:`Refund on failure`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Extract fee`})}),_jsx(_components.td,{children:`$0.003 per MB`}),_jsx(_components.td,{children:`Before extraction runs`}),_jsx(_components.td,{children:`Yes, auto`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Ingest fee`})}),_jsx(_components.td,{children:`$0.0001 per 1,000 extracted characters`}),_jsx(_components.td,{children:`After extraction, before ingest`}),_jsx(_components.td,{children:`Yes, auto`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`The two charges are separate rows in `,_jsx(_components.code,{children:`transaction_log`}),` (`,_jsx(_components.code,{children:`MEMORY_EXTRACT`}),` and `,_jsx(_components.code,{children:`MEMORY_INGEST`}),`) so you can distinguish extraction cost from storage cost in your reporting.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example`}),` — uploading a 2 MB PDF that extracts to 50,000 characters of text:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Extract fee: 2 × $0.003 = $0.006`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Ingest fee: (50,000 / 1000) × $0.0001 = $0.005`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Total: $0.011`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Response headers`}),` on success:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`x-credit-balance`})}),_jsxs(_components.td,{children:[`Wallet balance after the `,_jsx(_components.strong,{children:`extract fee`}),` was deducted (set before ingest runs)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`x-credit-charged`})}),_jsx(_components.td,{children:`Just the extract fee`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`x-credit-charged-total`})}),_jsx(_components.td,{children:`Extract fee + ingest fee combined`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`x-billing-tx`})}),_jsxs(_components.td,{children:[`UUID of the `,_jsx(_components.strong,{children:`extract`}),` audit row (the ingest row is linked via metadata)`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Special failure case`}),` — if extraction succeeds but your wallet can’t cover the post-extraction ingest charge, the extract fee is automatically refunded and the response is `,_jsx(_components.code,{children:`402 INSUFFICIENT_CREDITS`}),` with `,_jsx(_components.code,{children:`details.extract_fee_refunded`}),` populated. You pay nothing for the failed attempt.`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/api-reference/memory/pricing`,children:`Pricing \u0026 Billing`}),` for the full policy.`]}),`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`NO_FILE`})}),_jsx(_components.td,{children:`No file was attached to the request.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`INVALID_TYPE`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`type`}),` must be `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`knowledge`}),`, or `,_jsx(_components.code,{children:`hive`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`402`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`INSUFFICIENT_CREDITS`})}),_jsxs(_components.td,{children:[`Wallet cannot cover the extract fee (pre-charge) OR the post-extraction ingest fee (in which case `,_jsx(_components.code,{children:`details.extract_fee_refunded`}),` is populated).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`POLICY_DENY`})}),_jsxs(_components.td,{children:[`Your role (e.g. `,_jsx(_components.code,{children:`viewer`}),`) is not allowed to create memories.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`COLLECTION_NOT_FOUND`})}),_jsxs(_components.td,{children:[`The specified `,_jsx(_components.code,{children:`collection`}),` doesn’t exist or you can’t access it.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`413`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`TOO_MANY_CHUNKS`})}),_jsxs(_components.td,{children:[`Document produced more than 100 chunks. Increase `,_jsx(_components.code,{children:`chunk_size`}),` or split the file. Full auto-refund.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`EMPTY_EXTRACTION`})}),_jsx(_components.td,{children:`Document contains no extractable text. Full auto-refund.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`EMPTY_CHUNKS`})}),_jsx(_components.td,{children:`Chunking produced zero segments. Full auto-refund.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`EXTRACTION_FAILED`})}),_jsx(_components.td,{children:`Extraction engine rejected the file. Full auto-refund.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`MEMORY_INFRA_NOT_READY`})}),_jsx(_components.td,{children:`The workspace’s memory layer is still provisioning. Retry in ~10s. Full auto-refund.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`EXTRACTION_SERVICE_UNAVAILABLE`})}),_jsx(_components.td,{children:`Document extraction is temporarily unavailable. Full auto-refund.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`202`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`MEMORY_QUEUED`})}),_jsx(_components.td,{children:`Memory layer is temporarily unreachable; chunks were queued and will retry automatically. Both extract and ingest fees are refunded because the work won’t actually happen.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`checking-ingestion-status`,children:`Checking ingestion status`}),`\n`,_jsxs(_components.p,{children:[`The endpoint returns immediately once chunks are queued — full embedding/indexing happens asynchronously. Poll `,_jsx(_components.code,{children:`GET /memory/:id/status`}),` with any of the returned chunk IDs to check progress:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.60db.ai/memory/mem_01HV8K.../status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk_abc123\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Statuses: `,_jsx(_components.code,{children:`pending`}),` → `,_jsx(_components.code,{children:`processing`}),` → `,_jsx(_components.code,{children:`ready`}),` (or `,_jsx(_components.code,{children:`failed`}),`).`]}),`\n`,_jsx(Heading,{level:`2`,id:`size-limits`,children:`Size limits`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Per file`}),`: 200 MB`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Chunks per document`}),`: 100 (use a larger `,_jsx(_components.code,{children:`chunk_size`}),` to fit bigger files)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Chunk text length`}),`: 100,000 characters`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Supported languages for OCR`}),`: 100+ languages including English, Spanish, French, German, Chinese, Japanese, Arabic, Hindi, and more`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Rate limit`}),`: Same as `,_jsx(_components.code,{children:`POST /memory/ingest/batch`}),` (30 uploads/min per workspace on default plans)`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Upload Document","description":"Extract text from a document (PDF, DOCX, XLSX, scanned images...) with built-in OCR and ingest it into a memory collection in a single request","api":"POST /memory/documents/extract","href":"/api-reference/memory/extract-document"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Info,ParamField,RequestExample,ResponseExample,ResponseField,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Upload a document to have it extracted, chunked, and ingested into a memory collection in a single request. 60db’s document extraction engine handles 91+ file formats and includes built-in OCR for scanned PDFs and images, so you can send the raw file and let the server do the rest.`}),`\n`,_jsx(_components.p,{children:`The browser just posts the file and 60db handles format detection, OCR, chunking, and ingestion.`}),`\n`,_jsxs(Info,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Supported formats`}),` (partial list — 91 total):`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Documents`}),`: PDF, DOCX, DOC, ODT, RTF, TXT, MD, HTML, EPUB`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Spreadsheets`}),`: XLSX, XLS, CSV, ODS`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Presentations`}),`: PPTX, PPT, ODP`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Email`}),`: EML, MSG, PST, MBOX`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Images (OCR)`}),`: PNG, JPG, JPEG, TIFF, BMP, GIF`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Code \u0026 structured`}),`: JSON, XML, YAML, LaTeX, Markdown variants`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Archives`}),`: ZIP, TAR, GZIP, 7Z (extracted recursively)`]}),`\n`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(Heading,{level:`3`,id:`headers`,children:`Headers`}),`\n`,_jsx(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:_jsx(_components.p,{children:`Bearer token with your API key`})}),`\n`,_jsx(ParamField,{header:`Content-Type`,type:`string`,id:`param-content-type`,children:_jsx(_components.p,{children:`multipart/form-data`})}),`\n`,_jsx(Heading,{level:`3`,id:`body-multipart/form-data`,children:`Body (multipart/form-data)`}),`\n`,_jsx(ParamField,{body:`file`,type:`file`,required:true,id:`param-file`,children:_jsx(_components.p,{children:`The document to extract. Max 200 MB per file.`})}),`\n`,_jsx(ParamField,{body:`collection`,type:`string`,id:`param-collection`,children:_jsx(_components.p,{children:`Collection ID to store the extracted chunks in. Defaults to the caller’s personal collection.`})}),`\n`,_jsx(ParamField,{body:`type`,type:`string`,default:`knowledge`,id:`param-type`,children:_jsxs(_components.p,{children:[`Memory type for the ingested chunks. One of: `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`knowledge`}),`, `,_jsx(_components.code,{children:`hive`}),`.\nFor document uploads, `,_jsx(_components.code,{children:`knowledge`}),` is almost always the right choice.`]})}),`\n`,_jsx(ParamField,{body:`title`,type:`string`,id:`param-title`,children:_jsxs(_components.p,{children:[`Display title for the document. Defaults to the uploaded filename.\nWhen the document produces multiple chunks, each chunk is labeled `,_jsx(_components.code,{children:`\"{title} (part N/M)\"`}),`.`]})}),`\n`,_jsx(ParamField,{body:`chunk_size`,type:`integer`,default:`1500`,id:`param-chunk-size`,children:_jsx(_components.p,{children:`Maximum characters per chunk. Larger chunks preserve more context but are less precise for recall.\nMinimum 200, maximum 8000.`})}),`\n`,_jsx(ParamField,{body:`chunk_overlap`,type:`integer`,default:`200`,id:`param-chunk-overlap`,children:_jsxs(_components.p,{children:[`Characters of overlap between adjacent chunks. Helps preserve sentences that span chunk boundaries.\nMust be less than `,_jsx(_components.code,{children:`chunk_size`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,id:`param-success`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` on success.`]})}),`\n`,_jsx(ResponseField,{name:`data`,type:`object`,id:`param-data`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`collection_id`,type:`string`,id:`param-collection-id`,children:_jsx(_components.p,{children:`The collection the chunks were stored in.`})}),_jsx(ResponseField,{name:`collection_label`,type:`string`,id:`param-collection-label`,children:_jsx(_components.p,{children:`Human-readable collection name.`})}),_jsx(ResponseField,{name:`filename`,type:`string`,id:`param-filename`,children:_jsx(_components.p,{children:`Original filename of the uploaded document.`})}),_jsx(ResponseField,{name:`chunks`,type:`integer`,id:`param-chunks`,children:_jsx(_components.p,{children:`Number of chunks produced from the extracted text.`})}),_jsx(ResponseField,{name:`characters`,type:`integer`,id:`param-characters`,children:_jsx(_components.p,{children:`Total characters of extracted text.`})}),_jsx(ResponseField,{name:`memory_type`,type:`string`,id:`param-memory-type`,children:_jsxs(_components.p,{children:[`The memory type used for ingest (`,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`knowledge`}),`, or `,_jsx(_components.code,{children:`hive`}),`).`]})}),_jsx(ResponseField,{name:`total_queued`,type:`integer`,id:`param-total-queued`,children:_jsxs(_components.p,{children:[`Number of memories queued for processing (equals `,_jsx(_components.code,{children:`chunks`}),`).`]})}),_jsx(ResponseField,{name:`results`,type:`array`,id:`param-results`,children:_jsxs(_components.p,{children:[`Array of `,_jsx(_components.code,{children:`{id, status, message}`}),` — one entry per chunk ingested. Use the IDs with `,_jsx(_components.code,{children:`GET /memory/:id/status`}),` to poll for processing completion.`]})}),_jsx(ResponseField,{name:`metadata`,type:`object`,id:`param-metadata`,children:_jsxs(_components.p,{children:[`Extracted document metadata, including `,_jsx(_components.code,{children:`mime_type`}),`, `,_jsx(_components.code,{children:`filename`}),`, `,_jsx(_components.code,{children:`page_count`}),` (for PDFs), `,_jsx(_components.code,{children:`detected_languages`}),`, and `,_jsx(_components.code,{children:`total_chunks`}),`.`]})})]})}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`6`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.60db.ai/memory/documents/extract`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer your-api-key\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"[email protected]\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"collection=company_handbook\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type=knowledge\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"title=Q4 2026 Report\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`15`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` form`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` FormData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`form`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`append`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'file'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pdfFile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`form`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`append`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'collection'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'company_handbook'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`form`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`append`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'knowledge'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`form`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`append`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'title'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Q4 2026 Report'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'https://api.60db.ai/memory/documents/extract'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Bearer your-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` form`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`success`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Ingested \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chunks`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` chunks from `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`filename`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`16`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'quarterly-report.pdf'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'rb'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.60db.ai/memory/documents/extract'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Bearer your-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` files`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'file'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: (`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'quarterly-report.pdf'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, f, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'application/pdf'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'collection'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'company_handbook'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'knowledge'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'title'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Q4 2026 Report'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Ingested `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`result[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'data'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'chunks'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` chunks\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})})]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`Response`,numberOfLines:`24`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`24`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"collection_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"company_handbook\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"collection_label\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Company Handbook\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"filename\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"quarterly-report.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"chunks\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`18`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"characters\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`24680`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"memory_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"knowledge\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_queued\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`18`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"results\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"mem_01HV8K...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"pending\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Queued for processing\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"mem_01HV8L...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"pending\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Queued for processing\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"metadata\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"source\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"document_upload\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"filename\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"quarterly-report.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"mime_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"page_count\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`24`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"detected_languages\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"eng\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_chunks\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`18`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`pipeline`,children:`Pipeline`}),`\n`,_jsx(_components.p,{children:`When you POST a file, 60db runs it through this pipeline:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Validate`}),` — file present, type allowed, under 200 MB, collection accessible.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Extract`}),` — the document extraction engine detects the format (PDF, DOCX, image, etc.) and returns plain text plus metadata (`,_jsx(_components.code,{children:`mime_type`}),`, `,_jsx(_components.code,{children:`page_count`}),`, `,_jsx(_components.code,{children:`tables`}),`, `,_jsx(_components.code,{children:`quality_score`}),`). OCR is applied automatically for scanned PDFs and images.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Chunk`}),` — split the extracted text into overlapping segments of `,_jsx(_components.code,{children:`chunk_size`}),` characters with `,_jsx(_components.code,{children:`chunk_overlap`}),` character overlap.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Register collection`}),` — ensure the target collection is ready (idempotent, cached).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Ingest`}),` — stream all chunks into the memory layer in a single batch.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Return`}),` — the response includes one `,_jsx(_components.code,{children:`{id, status, message}`}),` entry per chunk. Processing continues asynchronously.`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`For very large documents, prefer a higher `,_jsx(_components.code,{children:`chunk_size`}),` (e.g. 3000) to keep the per-chunk memory count low. The endpoint rejects uploads that produce more than 100 chunks with a `,_jsx(_components.code,{children:`TOO_MANY_CHUNKS`}),` error — split such files before upload or use a larger chunk size.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`tuning`,children:`Tuning`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Document type`}),_jsxs(_components.th,{children:[`Recommended `,_jsx(_components.code,{children:`chunk_size`})]}),_jsx(_components.th,{children:_jsx(_components.code,{children:`chunk_overlap`})}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Technical docs / API refs`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1500`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`200`}),_jsx(_components.td,{children:`Default. Balances recall precision and context.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Long-form prose / books`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2500`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`300`}),_jsx(_components.td,{children:`Fewer chunks, more context per result.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`FAQs / short snippets`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`800`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`100`}),_jsx(_components.td,{children:`Higher precision — each Q\u0026A becomes its own chunk.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Spreadsheet exports`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3000`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`0`}),_jsx(_components.td,{children:`Tables should stay contiguous; overlap hurts.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Scanned PDFs (OCR)`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2000`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`250`}),_jsx(_components.td,{children:`OCR adds whitespace noise; slightly longer chunks help.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`billing`,children:`Billing`}),`\n`,_jsxs(_components.p,{children:[`Document upload is `,_jsx(_components.strong,{children:`two-stage billing`}),` — you pay for the extraction and for the resulting ingest.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Stage`}),_jsx(_components.th,{children:`Rate`}),_jsx(_components.th,{children:`When charged`}),_jsx(_components.th,{children:`Refund on failure`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Extract fee`})}),_jsx(_components.td,{children:`$0.003 per MB`}),_jsx(_components.td,{children:`Before extraction runs`}),_jsx(_components.td,{children:`Yes, auto`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Ingest fee`})}),_jsx(_components.td,{children:`$0.0001 per 1,000 extracted characters`}),_jsx(_components.td,{children:`After extraction, before ingest`}),_jsx(_components.td,{children:`Yes, auto`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`The two charges are separate rows in `,_jsx(_components.code,{children:`transaction_log`}),` (`,_jsx(_components.code,{children:`MEMORY_EXTRACT`}),` and `,_jsx(_components.code,{children:`MEMORY_INGEST`}),`) so you can distinguish extraction cost from storage cost in your reporting.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example`}),` — uploading a 2 MB PDF that extracts to 50,000 characters of text:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Extract fee: 2 × $0.003 = $0.006`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Ingest fee: (50,000 / 1000) × $0.0001 = $0.005`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Total: $0.011`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Response headers`}),` on success:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`x-credit-balance`})}),_jsxs(_components.td,{children:[`Wallet balance after the `,_jsx(_components.strong,{children:`extract fee`}),` was deducted (set before ingest runs)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`x-credit-charged`})}),_jsx(_components.td,{children:`Just the extract fee`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`x-credit-charged-total`})}),_jsx(_components.td,{children:`Extract fee + ingest fee combined`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`x-billing-tx`})}),_jsxs(_components.td,{children:[`UUID of the `,_jsx(_components.strong,{children:`extract`}),` audit row (the ingest row is linked via metadata)`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Special failure case`}),` — if extraction succeeds but your wallet can’t cover the post-extraction ingest charge, the extract fee is automatically refunded and the response is `,_jsx(_components.code,{children:`402 INSUFFICIENT_CREDITS`}),` with `,_jsx(_components.code,{children:`details.extract_fee_refunded`}),` populated. You pay nothing for the failed attempt.`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/api-reference/memory/pricing`,children:`Pricing \u0026 Billing`}),` for the full policy.`]}),`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`NO_FILE`})}),_jsx(_components.td,{children:`No file was attached to the request.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`INVALID_TYPE`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`type`}),` must be `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`knowledge`}),`, or `,_jsx(_components.code,{children:`hive`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`402`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`INSUFFICIENT_CREDITS`})}),_jsxs(_components.td,{children:[`Wallet cannot cover the extract fee (pre-charge) OR the post-extraction ingest fee (in which case `,_jsx(_components.code,{children:`details.extract_fee_refunded`}),` is populated).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`POLICY_DENY`})}),_jsxs(_components.td,{children:[`Your role (e.g. `,_jsx(_components.code,{children:`viewer`}),`) is not allowed to create memories.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`COLLECTION_NOT_FOUND`})}),_jsxs(_components.td,{children:[`The specified `,_jsx(_components.code,{children:`collection`}),` doesn’t exist or you can’t access it.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`413`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`TOO_MANY_CHUNKS`})}),_jsxs(_components.td,{children:[`Document produced more than 100 chunks. Increase `,_jsx(_components.code,{children:`chunk_size`}),` or split the file. Full auto-refund.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`EMPTY_EXTRACTION`})}),_jsx(_components.td,{children:`Document contains no extractable text. Full auto-refund.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`EMPTY_CHUNKS`})}),_jsx(_components.td,{children:`Chunking produced zero segments. Full auto-refund.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`EXTRACTION_FAILED`})}),_jsx(_components.td,{children:`Extraction engine rejected the file. Full auto-refund.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`MEMORY_INFRA_NOT_READY`})}),_jsx(_components.td,{children:`The workspace’s memory layer is still provisioning. Retry in ~10s. Full auto-refund.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`EXTRACTION_SERVICE_UNAVAILABLE`})}),_jsx(_components.td,{children:`Document extraction is temporarily unavailable. Full auto-refund.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`202`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`MEMORY_QUEUED`})}),_jsx(_components.td,{children:`Memory layer is temporarily unreachable; chunks were queued and will retry automatically. Both extract and ingest fees are refunded because the work won’t actually happen.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`checking-ingestion-status`,children:`Checking ingestion status`}),`\n`,_jsxs(_components.p,{children:[`The endpoint returns immediately once chunks are queued — full embedding/indexing happens asynchronously. Poll `,_jsx(_components.code,{children:`GET /memory/:id/status`}),` with any of the returned chunk IDs to check progress:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.60db.ai/memory/mem_01HV8K.../status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk_abc123\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Statuses: `,_jsx(_components.code,{children:`pending`}),` → `,_jsx(_components.code,{children:`processing`}),` → `,_jsx(_components.code,{children:`ready`}),` (or `,_jsx(_components.code,{children:`failed`}),`).`]}),`\n`,_jsx(Heading,{level:`2`,id:`size-limits`,children:`Size limits`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Per file`}),`: 200 MB`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Chunks per document`}),`: 100 (use a larger `,_jsx(_components.code,{children:`chunk_size`}),` to fit bigger files)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Chunk text length`}),`: 100,000 characters`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Supported languages for OCR`}),`: 100+ languages including English, Spanish, French, German, Chinese, Japanese, Arabic, Hindi, and more`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Rate limit`}),`: Same as `,_jsx(_components.code,{children:`POST /memory/ingest/batch`}),` (30 uploads/min per workspace on default plans)`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Upload Document","description":"Extract text from a document (PDF, DOCX, XLSX, scanned images...) with built-in OCR and ingest it into a memory collection in a single request","api":"POST /memory/documents/extract","href":"/api-reference/memory/extract-document"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Request","slug":"request","depth":2,"children":[{"title":"Headers","slug":"headers","depth":3,"children":[]},{"title":"Body (multipart/form-data)","slug":"body-multipart/form-data","depth":3,"children":[]}]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[]},{"title":"Pipeline","slug":"pipeline","depth":2,"children":[]},{"title":"Tuning","slug":"tuning","depth":2,"children":[]},{"title":"Billing","slug":"billing","depth":2,"children":[]},{"title":"Error responses","slug":"error-responses","depth":2,"children":[]},{"title":"Checking ingestion status","slug":"checking-ingestion-status","depth":2,"children":[]},{"title":"Size limits","slug":"size-limits","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"6\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://api.60db.ai/memory/documents/extract\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization: Bearer your-api-key\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -F\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"[email protected]\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -F\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"collection=company_handbook\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -F\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"type=knowledge\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -F\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"title=Q4 2026 Report\"\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"15\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> form\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> new\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> FormData\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">form\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">append\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'file'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">pdfFile\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">form\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">append\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'collection'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'company_handbook'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">form\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">append\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'type'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'knowledge'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">form\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">append\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'title'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Q4 2026 Report'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> response\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> fetch\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'https://api.60db.ai/memory/documents/extract'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> method:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'POST'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> headers:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Authorization'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Bearer your-api-key'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> body:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> form\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\">success\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\">data\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> } \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">json\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">`Ingested \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">chunks\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> chunks from \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">filename\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">`\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"16\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">with\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\"> open\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'quarterly-report.pdf'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'rb'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">) \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">as\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> f:\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> response \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests.post(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'https://api.60db.ai/memory/documents/extract'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> headers\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Authorization'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Bearer your-api-key'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> files\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'file'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: (\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'quarterly-report.pdf'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, f, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'application/pdf'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> data\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'collection'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'company_handbook'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'type'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'knowledge'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'title'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Q4 2026 Report'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> )\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">result \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> response.json()\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">f\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Ingested \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">{\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">result[\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'data'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">][\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'chunks'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">]\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> chunks\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Response","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"24\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">true\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"data\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"collection_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"company_handbook\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"collection_label\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Company Handbook\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"filename\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"quarterly-report.pdf\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"chunks\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">18\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"characters\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">24680\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"memory_type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"knowledge\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"total_queued\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">18\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"results\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\">\"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"mem_01HV8K...\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\">\"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"pending\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\">\"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Queued for processing\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\">\"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"mem_01HV8L...\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\">\"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"pending\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\">\"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Queued for processing\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"metadata\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"source\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"document_upload\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"filename\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"quarterly-report.pdf\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"mime_type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"application/pdf\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"page_count\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">24\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"detected_languages\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"eng\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"total_chunks\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">18\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Upload Document","path":"/memory/documents/extract","servers":[{"url":"https://api.60db.ai"}],"method":"post","request":{"security":[{"title":"Bearer Auth","parameters":{"header":{"Authorization":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token."}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{"Authorization":{"schema":[{"type":"string","description":"Bearer token with your API key","required":true}]},"Content-Type":{"schema":[{"type":"string","description":"multipart/form-data"}]}},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"file":[{"type":"file","description":"The document to extract. Max 200 MB per file.","required":true}],"collection":[{"type":"string","description":"Collection ID to store the extracted chunks in. Defaults to the caller’s personal collection."}],"type":[{"type":"string","description":"Memory type for the ingested chunks. One of: `user` , `knowledge` , `hive` . For document uploads, `knowledge` is almost always the right choice."}],"title":[{"type":"string","description":"Display title for the document. Defaults to the uploaded filename. When the document produces multiple chunks, each chunk is labeled `\"{title} (part N/M)\"` ."}],"chunk_size":[{"type":"integer","description":"Maximum characters per chunk. Larger chunks preserve more context but are less precise for recall. Minimum 200, maximum 8000."}],"chunk_overlap":[{"type":"integer","description":"Characters of overlap between adjacent chunks. Helps preserve sentences that span chunk boundaries. Must be less than `chunk_size` ."}]}}],"examples":{"example":{"value":{"collection":"\u003cstring>","type":"\u003cstring>","title":"\u003cstring>","chunk_size":123,"chunk_overlap":123}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"success":[{"type":"boolean","description":"`true` on success."}],"data":[{"type":"object","properties":{"collection_id":[{"type":"string","description":"The collection the chunks were stored in."}],"collection_label":[{"type":"string","description":"Human-readable collection name."}],"filename":[{"type":"string","description":"Original filename of the uploaded document."}],"chunks":[{"type":"integer","description":"Number of chunks produced from the extracted text."}],"characters":[{"type":"integer","description":"Total characters of extracted text."}],"memory_type":[{"type":"string","description":"The memory type used for ingest ( `user` , `knowledge` , or `hive` )."}],"total_queued":[{"type":"integer","description":"Number of memories queued for processing (equals `chunks` )."}],"results":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"Array of `{id, status, message}` — one entry per chunk ingested. Use the IDs with `GET /memory/:id/status` to poll for processing completion."}],"metadata":[{"type":"object","properties":{},"description":"Extracted document metadata, including `mime_type` , `filename` , `page_count` (for PDFs), `detected_languages` , and `total_chunks` ."}]}}]}}],"examples":{"example":{"value":{"success":true,"data":{"collection_id":"\u003cstring>","collection_label":"\u003cstring>","filename":"\u003cstring>","chunks":123,"characters":123,"memory_type":"\u003cstring>","total_queued":123,"results":[{}],"metadata":{}}}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"60db-c848165a","siteName":"60db","title":"Upload Document - 60db","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-06T06:47:50.022Z","originalFileLocation":"api-reference/memory/extract-document.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=\"system\"}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=\"Extract text from a document (PDF, DOCX, XLSX, scanned images...) with built-in OCR and ingest it into a memory collection in a single request\">\u003cmeta data-mint-head name=\"application-name\" content=\"60db\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/60db-c848165a/CC00PK6eC4HKg2Rz/_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/60db-c848165a/CC00PK6eC4HKg2Rz/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/60db-c848165a/CC00PK6eC4HKg2Rz/_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/60db-c848165a/CC00PK6eC4HKg2Rz/_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/60db-c848165a/CC00PK6eC4HKg2Rz/_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/60db-c848165a/CC00PK6eC4HKg2Rz/_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/60db-c848165a/CC00PK6eC4HKg2Rz/_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/60db-c848165a/CC00PK6eC4HKg2Rz/_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/60db-c848165a/CC00PK6eC4HKg2Rz/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Upload Document - 60db\">\u003cmeta data-mint-head property=\"og:description\" content=\"Extract text from a document (PDF, DOCX, XLSX, scanned images...) with built-in OCR and ingest it into a memory collection in a single request\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"60db\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.60db.ai/api-reference/memory/extract-document\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://60db-c848165a.mintlify.app/_mintlify/api/og/v2?division=Memory+%26+RAG\u0026amp;title=Upload+Document\u0026amp;description=Extract+text+from+a+document+%28PDF%2C+DOCX%2C+XLSX%2C+scanned+images...%29+with+built-in+OCR+and+ingest+it+into+a+memory+collection+in+a+single+request\u0026amp;theme=285fc077b6c10621f332e454\u0026amp;signature=80f4ac14fd177c409dc23b77d5334a98751c4182493552ed68ece4c9cb5b425e\">\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=\"Upload Document - 60db\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Extract text from a document (PDF, DOCX, XLSX, scanned images...) with built-in OCR and ingest it into a memory collection in a single request\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://60db-c848165a.mintlify.app/_mintlify/api/og/v2?division=Memory+%26+RAG\u0026amp;title=Upload+Document\u0026amp;description=Extract+text+from+a+document+%28PDF%2C+DOCX%2C+XLSX%2C+scanned+images...%29+with+built-in+OCR+and+ingest+it+into+a+memory+collection+in+a+single+request\u0026amp;theme=285fc077b6c10621f332e454\u0026amp;signature=80f4ac14fd177c409dc23b77d5334a98751c4182493552ed68ece4c9cb5b425e\">\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/60db-c848165a/CC00PK6eC4HKg2Rz/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"60db\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4A3228\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.60db.ai/api-reference/memory/extract-document\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/memory/extract-document.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.60db.ai/#organization\",\"name\":\"60db\",\"url\":\"https://docs.60db.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/60db-c848165a/83Hv-Y-hnK8ZdMCS/logo/60db-logo.svg?fit=max\u0026auto=format\u0026n=83Hv-Y-hnK8ZdMCS\u0026q=85\u0026s=7334adf60f84684685b34f6455a5a071\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.60db.ai#website\",\"name\":\"60db\",\"url\":\"https://docs.60db.ai\",\"publisher\":{\"@id\":\"https://docs.60db.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.60db.ai/api-reference/memory/extract-document#webpage\",\"url\":\"https://docs.60db.ai/api-reference/memory/extract-document\",\"name\":\"Upload Document\",\"description\":\"Extract text from a document (PDF, DOCX, XLSX, scanned images...) with built-in OCR and ingest it into a memory collection in a single request\",\"dateModified\":\"2026-10-06T06:47:50.022Z\",\"isPartOf\":{\"@id\":\"https://docs.60db.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.60db.ai/api-reference/memory/extract-document#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.60db.ai/api-reference/memory/extract-document#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Memory \u0026 RAG\",\"item\":\"https://docs.60db.ai/api-reference/memory/ingest\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Upload Document\",\"item\":\"https://docs.60db.ai/api-reference/memory/extract-document\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.60db.ai/api-reference/memory/extract-document#apireference\",\"headline\":\"Upload Document\",\"name\":\"Upload Document\",\"description\":\"Extract text from a document (PDF, DOCX, XLSX, scanned images...) with built-in OCR and ingest it into a memory collection in a single request\",\"url\":\"https://docs.60db.ai/api-reference/memory/extract-document\",\"mainEntityOfPage\":{\"@id\":\"https://docs.60db.ai/api-reference/memory/extract-document#webpage\"},\"dateModified\":\"2026-10-06T06:47:50.022Z\",\"publisher\":{\"@id\":\"https://docs.60db.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.60db.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"60db\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"60db","nav":{"global":{"anchors":[{"anchor":"Dashboard","icon":"book-open-cover","href":"https://app.60db.ai"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"WebSocket API","pages":[{"title":"WebSocket API","href":"/websocket-api"}]},{"tab":"API Reference","groups":[{"group":"API Documentation","pages":[{"title":"API Reference","href":"/api-reference/introduction"},{"title":"API Playground Troubleshooting","href":"/api-reference/troubleshooting"}]},{"group":"WebSocket Reference","pages":[{"title":"WebSocket Introduction","href":"/api-reference/websocket/introduction"},{"title":"STT WebSocket","api":"WebSocket /ws/stt","href":"/api-reference/websocket/stt"},{"title":"TTS WebSocket","api":"WebSocket /ws/tts","href":"/api-reference/websocket/tts"}]},{"group":"Text-to-Speech","pages":[{"title":"Text to Speech","api":"POST /tts-synthesize","href":"/api-reference/tts/text-to-speech"},{"title":"Text to Speech Stream","api":"POST /tts-stream","href":"/api-reference/tts/text-to-speech-stream"},{"title":"Enhance Text","api":"POST /tts/enhance","href":"/api-reference/tts/enhance-text"},{"title":"Get TTS Languages","api":"GET /tts/languages","href":"/api-reference/tts/text-to-speech-languages"}]},{"group":"Speech-to-Text","pages":[{"title":"Speech to Text","api":"POST /stt","href":"/api-reference/stt/speech-to-text"},{"title":"Get Languages","api":"GET /stt/languages","href":"/api-reference/stt/get-languages"}]},{"group":"LLM \u0026 Chat","pages":[{"title":"Chat","api":"POST /v1/chat/completions","href":"/api-reference/llm/chat-completion"}]},{"group":"Memory \u0026 RAG","pages":[{"title":"Ingest Memory","description":"Store a memory (user, knowledge, or hive) in a collection","api":"POST /memory/ingest","href":"/api-reference/memory/ingest"},{"title":"Upload Document","api":"POST /memory/documents/extract","href":"/api-reference/memory/extract-document"},{"title":"Search Memories","description":"Hybrid semantic + keyword search with cross-encoder reranking","api":"POST /memory/search","href":"/api-reference/memory/search"},{"title":"Assemble Context (RAG)","api":"POST /memory/context","href":"/api-reference/memory/context"},{"title":"Collections","href":"/api-reference/memory/collections"},{"title":"Get Memory Usage","api":"GET /memory/usage","href":"/api-reference/memory/usage"},{"title":"Pricing \u0026 Billing","href":"/api-reference/memory/pricing"}]},{"group":"Judge","pages":[{"title":"Evaluate","api":"POST /v1/systemone","href":"/api-reference/judge/systemone"},{"title":"Extract","api":"POST /v1/extract","href":"/api-reference/judge/extract-v1"},{"title":"List models","api":"GET /judge/models","href":"/api-reference/judge/models"},{"title":"List rubrics","api":"GET /judge/rubrics","href":"/api-reference/judge/list-rubrics"},{"title":"Create rubric","api":"POST /judge/rubrics","href":"/api-reference/judge/create-rubric"},{"title":"Get rubric","api":"GET /judge/rubrics/{id}","href":"/api-reference/judge/get-rubric"},{"title":"Update rubric","api":"PATCH /judge/rubrics/{id}","href":"/api-reference/judge/update-rubric"},{"title":"Delete rubric","api":"DELETE /judge/rubrics/{id}","href":"/api-reference/judge/delete-rubric"},{"title":"List runs","api":"GET /judge/evaluations","href":"/api-reference/judge/list-runs"},{"title":"Get run","api":"GET /judge/evaluations/{id}","href":"/api-reference/judge/get-run"},{"title":"Delete run","api":"DELETE /judge/evaluations/{id}","href":"/api-reference/judge/delete-run"},{"title":"Usage","api":"GET /judge/usage","href":"/api-reference/judge/usage"},{"title":"Health","api":"GET /judge/health","href":"/api-reference/judge/health"},{"title":"Pricing \u0026 Billing","href":"/api-reference/judge/pricing"}]},{"group":"Models","pages":[{"title":"Get TTS Models","api":"GET /tts/models","href":"/api-reference/models/get-models"},{"title":"Get STT Models","api":"GET /stt/models","href":"/api-reference/models/get-stt-models"}]},{"group":"Voices","pages":[{"title":"Get Voices","api":"GET /voices","href":"/api-reference/voices/get-voices"},{"title":"Get My Voices","api":"GET /myvoices","href":"/api-reference/voices/get-my-voices"},{"title":"Get Voice by ID","api":"GET /voices/:id","href":"/api-reference/voices/get-voice"},{"title":"Create Voice","api":"POST /voices","href":"/api-reference/voices/create-voice"},{"title":"Update Voice","api":"PUT /voices/:id","href":"/api-reference/voices/update-voice"},{"title":"Delete Voice","api":"DELETE /voices/:id","href":"/api-reference/voices/delete-voice"},{"title":"Get Voice Limits","api":"GET /voices/quota","href":"/api-reference/voices/get-voice-quota"},{"title":"List Professional Voices","api":"GET /voices/professional/jobs","href":"/api-reference/voices/list-professional-voices"},{"title":"Get Marketplace Eligibility","api":"GET /voices/professional/marketplace-eligibility","href":"/api-reference/voices/get-marketplace-eligibility"}]},{"group":"Music","pages":[{"title":"Create Song","api":"POST /songs","href":"/api-reference/music/create-song"},{"title":"List Songs","api":"GET /songs","href":"/api-reference/music/list-songs"},{"title":"Get Song","api":"GET /songs/:id","href":"/api-reference/music/get-song"},{"title":"Update Song","api":"PATCH /songs/:id","href":"/api-reference/music/update-song"},{"title":"Delete Song","api":"DELETE /songs/:id","href":"/api-reference/music/delete-song"},{"title":"Download Song","api":"GET /songs/:id/download","href":"/api-reference/music/download-song"},{"title":"List Voices","api":"GET /songs/voices","href":"/api-reference/music/list-voices"},{"title":"Create Voice","api":"POST /songs/voices","href":"/api-reference/music/create-voice"},{"title":"Health Check","api":"GET /songs/health","href":"/api-reference/music/health"}]},{"group":"Dialer","pages":[{"title":"Get Status","api":"GET /dialer/status","href":"/api-reference/dialer/get-status"},{"title":"Search Numbers","api":"GET /dialer/pool","href":"/api-reference/dialer/search-numbers"},{"title":"Buy Number","api":"POST /dialer/pool/allocate","href":"/api-reference/dialer/buy-number"},{"title":"List Numbers","api":"GET /dialer/numbers","href":"/api-reference/dialer/list-numbers"},{"title":"Release Number","api":"DELETE /dialer/numbers/:e164","href":"/api-reference/dialer/release-number"},{"title":"Set Caller ID","api":"PUT /dialer/caller-id","href":"/api-reference/dialer/set-caller-id"},{"title":"List Calls","api":"GET /dialer/logs","href":"/api-reference/dialer/list-calls"},{"title":"Get Call","api":"GET /dialer/calls/:id","href":"/api-reference/dialer/get-call"},{"title":"Live Calls","api":"GET /dialer/live","href":"/api-reference/dialer/live-calls"},{"title":"Line Status","api":"GET /dialer/calls/line-status","href":"/api-reference/dialer/line-status"},{"title":"Reserve Call","api":"POST /dialer/calls","href":"/api-reference/dialer/reserve-call"},{"title":"List Recordings","api":"GET /dialer/recordings","href":"/api-reference/dialer/list-recordings"},{"title":"Get Playback URL","api":"POST /dialer/recordings/:id/playback-url","href":"/api-reference/dialer/recording-playback-url"},{"title":"Get Transcript","api":"POST /dialer/recordings/:id/transcript","href":"/api-reference/dialer/recording-transcript"},{"title":"Delete Recording","api":"DELETE /dialer/recordings/:id","href":"/api-reference/dialer/delete-recording"},{"title":"Toggle Recording","api":"PUT /dialer/recording","href":"/api-reference/dialer/toggle-recording"},{"title":"List Subscriptions","api":"GET /dialer/subscriptions","href":"/api-reference/dialer/list-subscriptions"},{"title":"Get Usage","api":"GET /dialer/usage","href":"/api-reference/dialer/get-usage"},{"title":"List Webhooks","api":"GET /dialer/webhooks","href":"/api-reference/dialer/list-webhooks"},{"title":"Create Webhook","api":"POST /dialer/webhooks","href":"/api-reference/dialer/create-webhook"},{"title":"Update Webhook","api":"PATCH /dialer/webhooks/:id","href":"/api-reference/dialer/update-webhook"},{"title":"Delete Webhook","api":"DELETE /dialer/webhooks/:id","href":"/api-reference/dialer/delete-webhook"},{"title":"Rotate Webhook Secret","api":"POST /dialer/webhooks/:id/rotate-secret","href":"/api-reference/dialer/webhook-rotate-key"},{"title":"Test Webhook","api":"POST /dialer/webhooks/:id/test","href":"/api-reference/dialer/test-webhook"},{"title":"List Deliveries","api":"GET /dialer/webhooks/:id/deliveries","href":"/api-reference/dialer/list-webhook-deliveries"}]},{"group":"60db Flow","pages":[{"title":"Get Flow plan","api":"GET /60db/flow/plan","href":"/api-reference/flow/get-plan"},{"title":"List seats","api":"GET /60db/license/:license_id/seats","href":"/api-reference/flow/list-seats"},{"title":"Invite by email","api":"POST /60db/license/:license_id/seats","href":"/api-reference/flow/invite-seat"},{"title":"Remove seat","api":"DELETE /60db/license/:license_id/seats/:user_id","href":"/api-reference/flow/remove-seat"},{"title":"List my invites","api":"GET /60db/license/invites","href":"/api-reference/flow/list-invites"},{"title":"Accept invite","api":"POST /60db/license/:license_id/seats/accept","href":"/api-reference/flow/accept-invite"},{"title":"Decline invite","api":"POST /60db/license/:license_id/seats/decline","href":"/api-reference/flow/decline-invite"}]},{"group":"Click-to-Call","pages":[{"title":"Place Click-to-Call","api":"POST /dialer/click2call","href":"/api-reference/click2call/place-call"},{"title":"Get Click-to-Call","api":"GET /dialer/click2call/{id}","href":"/api-reference/click2call/get-call"},{"title":"List Click-to-Calls","api":"GET /dialer/click2call","href":"/api-reference/click2call/list-calls"},{"title":"List Call Events","api":"GET /dialer/click2call/{id}/events","href":"/api-reference/click2call/list-events"},{"title":"Get Recording URL","api":"POST /dialer/click2call/{id}/recording","href":"/api-reference/click2call/recording-url"},{"title":"Get Click-to-Call Config","api":"GET /dialer/click2call/config","href":"/api-reference/click2call/get-config"},{"title":"Click-to-Call Webhook Events","href":"/api-reference/click2call/webhook-events"}]},{"group":"WhatsApp","pages":[{"title":"Send WhatsApp message","api":"POST /whatsapp/messages","href":"/api-reference/whatsapp/send-message"},{"title":"WhatsApp attachments","href":"/api-reference/whatsapp/media"},{"title":"WhatsApp assistant","href":"/api-reference/whatsapp/assistant"},{"title":"WhatsApp broadcasts","href":"/api-reference/whatsapp/broadcasts"},{"title":"WhatsApp resources","href":"/api-reference/whatsapp/resources"},{"title":"WhatsApp webhook events","href":"/api-reference/whatsapp/webhook-events"}]},{"group":"API Keys","pages":[{"title":"Get API Keys","api":"GET /developer/api","href":"/api-reference/api-keys/get-api-keys"},{"title":"Create API Key","api":"POST /developer/api","href":"/api-reference/api-keys/create-api-key"},{"title":"Delete API Key","api":"DELETE /developer/api/:id","href":"/api-reference/api-keys/delete-api-key"}]},{"group":"Webhooks","pages":[{"title":"Get Webhooks","api":"GET /webhooks","href":"/api-reference/webhooks/get-webhooks"},{"title":"Create Webhook","api":"POST /webhooks","href":"/api-reference/webhooks/create-webhook"},{"title":"Delete Webhook","api":"DELETE /webhooks/:id","href":"/api-reference/webhooks/delete-webhook"}]},{"group":"Workspaces","pages":[{"title":"Get Workspaces","api":"GET /workspaces","href":"/api-reference/workspaces/get-workspaces"},{"title":"Create Workspace","api":"POST /workspaces","href":"/api-reference/workspaces/create-workspace"}]},{"group":"Billing","pages":[{"title":"List Plans","api":"GET /plans","href":"/api-reference/billing/plans"},{"title":"Subscribe to a Plan","api":"POST /billing/subscribe","href":"/api-reference/billing/subscribe"},{"title":"Current Plan","api":"GET /billing/current-plan","href":"/api-reference/billing/current-plan"},{"title":"Top-up Info","api":"GET /billing/topup","href":"/api-reference/billing/topup-info"},{"title":"Top-up Quote","api":"GET /billing/topup/quote","href":"/api-reference/billing/topup-quote"},{"title":"Add Funds","api":"POST /billing/add-funds","href":"/api-reference/billing/add-funds"},{"title":"Usage Logs","api":"GET /billing/usage-logs","href":"/api-reference/billing/usage-logs"},{"title":"Payment Transactions","api":"GET /billing/transactions","href":"/api-reference/billing/transactions"}]},{"group":"Analytics","pages":[{"title":"Get Usage","api":"GET /analytics/usage","href":"/api-reference/analytics/get-usage"}]}]},{"tab":"CLI Reference","pages":[{"title":"CLI Reference","href":"/cli-reference/introduction"}]},{"tab":"MCP Server","pages":[{"title":"MCP Server","href":"/mcp-server/introduction"}]},{"tab":"Codex / Claude","pages":[{"title":"Codex / Claude","href":"/skills/introduction"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/livekit"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"title":"Upload Document - 60db","buildId":"dpl_cadrRc5H9XQiJQbDFN5mcYRs2PAj","deploymentId":"dpl_cadrRc5H9XQiJQbDFN5mcYRs2PAj","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-DKJwRUt2.js","utils-CWD_VS3u.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-oFjciODD.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-C76WsxC3.js","snippetPresets-DvPMxpX_.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CuNQfndH.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BVFpVUoF.js","shallow-t59Jg5Kr.js","getApiPlaygroundDisplay-C_JZ4amX.js","CodeSnippet-CLRDnx_h.js","CodeSnippets-C2myU4kc.js","Page-7TwLLapg.js","getPastedJson-B-JaVXw7.js","icon-BA-iDhH3.js","MethodPill-D4qZABFp.js","DuplicateIcon-THIDKO1O.js","createIcon-CYYJwgFd.js","DynamicMarkdown-UGQuxDKp.js","SectionHeading-jYELb23h.js","axios-vUo_bRtp.js"]}