Add files to a workspace, list them with their version history, reuse a file
that already exists, and remove one when you no longer need it.
from vectorshift import Workspace, Filew = Workspace.get_or_create(name="Q3 Report Review", portal="Acme Research")# --- 1. Upload local files into the workspace ---files = w.upload("./report.pdf", "./documents/")print(f"1. Uploaded {len(files)} documents.")# --- 2. List the workspace's documents, with their version numbers ---for doc in w.documents.list(): print(f"2. {doc.name} (version {doc.version})")# --- 3. Add an existing file to this workspace ---existing = File.fetch(id=files[0].id)existing.index(w)print("3. Added an existing file to the workspace.")# --- 4. Remove a document from the workspace; the file itself stays ---w.documents.remove(files[0])print("4. Removed one document.\n\nDone.")
Source: examples/workspaces/02_documents.py in the SDK repo.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"VectorShift","colors":{"primary":"#6366f1","light":"#818cf8","dark":"#4f46e5"},"logo":{"light":"https://mintcdn.com/vectorshift/ko1lD3nuBSgpmLV4/logo/vectorshift-logo.png?fit=max\u0026auto=format\u0026n=ko1lD3nuBSgpmLV4\u0026q=85\u0026s=0b909e21221badbcd2332ad0c7b06a8e","dark":"https://mintcdn.com/vectorshift/ko1lD3nuBSgpmLV4/logo/vectorshift-logo.png?fit=max\u0026auto=format\u0026n=ko1lD3nuBSgpmLV4\u0026q=85\u0026s=0b909e21221badbcd2332ad0c7b06a8e"},"favicon":"https://mintcdn.com/vectorshift/PSG1OGMwi51Mi0EL/android-chrome-512x512.png?fit=max\u0026auto=format\u0026n=PSG1OGMwi51Mi0EL\u0026q=85\u0026s=1a5016324923f89a576a8696462ef07e","appearance":{"default":"system","strict":false},"navbar":{"links":[{"href":"/support","label":"Support"},{"href":"https://app.vectorshift.ai/account/api-keys","label":"API Keys"}],"primary":{"type":"button","label":"Platform","href":"https://app.vectorshift.ai"}},"footer":{"socials":{"x":"https://x.com/vectorshiftai","linkedin":"https://linkedin.com/company/vectorshift"}},"search":{"prompt":"Search the SDK, API, and platform docs…"},"seo":{"metatags":{"og:image":"/logo/vectorshift-logo.png"},"indexing":"navigable"},"icons":{"library":"lucide"},"styling":{"codeblocks":{"languages":{}},"latex":true},"contextual":{"options":["copy","view","chatgpt","claude","aistudio","perplexity"],"display":"header"},"navigation":{"global":{"anchors":[{"anchor":"Book a Demo","icon":"calendar","href":"https://calendly.com/albert_mao/vectorshift-intro-chat"},{"anchor":"Changelog","icon":"history","href":"https://vectorshift.ai/blog?tag=changelog"},{"anchor":"Blog","icon":"newspaper","href":"https://vectorshift.ai/blog"},{"anchor":"Tutorials","icon":"youtube","href":"https://www.youtube.com/@VectorShiftAI"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"vectorshift","hasAudioNarration":false,"actualSubdomain":"vectorshift","customDomains":["docs.vectorshift.ai"],"gitSource":{"type":"github","owner":"vectorshift","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a4fe02b59f45c534f1a9960","collectionId":"f85b947e-62c3-492f-9432-347ee09473da","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6a58eb7c7bfe054002014416:success","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"SDK","count":136},{"language":"default","tag":"Documentation","count":124},{"language":"default","tag":"Examples","count":84},{"language":"default","tag":"Nodes","count":65},{"language":"default","tag":"Platform","count":61},{"language":"default","tag":"Pipeline","count":38},{"language":"default","tag":"API Reference","count":30},{"language":"default","tag":"Agent","count":27},{"language":"default","tag":"Knowledge Base","count":24},{"language":"default","tag":"Interfaces","count":20}]},"assistantConfig":{},"basePath":"","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":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"@media (min-width:1024px){.hidden.xl\\:flex{display:flex!important}div.z-10.hidden:has(>div.xl\\:flex){display:block!important}}"}],"page":{"pagePath":"sdk/workspace/examples/documents","slug":"/sdk/workspace/examples/documents","pageMetadata":{"title":"Documents","description":"Upload and manage documents in a workspace","href":"/sdk/workspace/examples/documents"},"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: \"Upload and manage documents in a workspace\"\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={code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Add files to a workspace, list them with their version history, reuse a file\nthat already exists, and remove one when you no longer need it.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`20`,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:`20`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vectorshift `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Workspace, File`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`w `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Workspace.get_or_create(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Q3 Report Review\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`portal`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Acme Research\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# --- 1. Upload local files into the workspace ---`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`files `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` w.upload(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./report.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./documents/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\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:`\"1. Uploaded `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`len`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(files)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` documents.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# --- 2. List the workspace's documents, with their version numbers ---`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` doc `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` w.documents.list():`})]}),`\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:`\"2. `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`doc.name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` (version `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`doc.version`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--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(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# --- 3. Add an existing file to this workspace ---`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`existing `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` File.fetch(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`files[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].id)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`existing.index(w)`})}),`\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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"3. Added an existing file to the workspace.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# --- 4. Remove a document from the workspace; the file itself stays ---`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`w.documents.remove(files[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"4. Removed one document.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Done.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Source: `,_jsx(_components.code,{children:`examples/workspaces/02_documents.py`}),` in the SDK repo.`]})})]})}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":{"codeStyling":{"languages":{}},"config":{},"pageMetadata":{"title":"Documents","description":"Upload and manage documents in a workspace","href":"/sdk/workspace/examples/documents"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"subdomain":"vectorshift","siteName":"VectorShift","title":"Documents - VectorShift","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-29T10:40:58.310Z","originalFileLocation":"sdk/workspace/examples/documents.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=\"Upload and manage documents in a workspace\">\u003cmeta data-mint-head name=\"application-name\" content=\"VectorShift\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_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/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_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/vectorshift/TwRU3RaBNwnTjf5H/_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/vectorshift/TwRU3RaBNwnTjf5H/_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/vectorshift/TwRU3RaBNwnTjf5H/_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/vectorshift/TwRU3RaBNwnTjf5H/_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/vectorshift/TwRU3RaBNwnTjf5H/_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/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Documents - VectorShift\">\u003cmeta data-mint-head property=\"og:description\" content=\"Upload and manage documents in a workspace\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"VectorShift\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.vectorshift.ai/sdk/workspace/examples/documents\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://vectorshift.mintlify.app/logo/vectorshift-logo.png\">\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=\"Documents - VectorShift\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Upload and manage documents in a workspace\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://vectorshift.mintlify.app/logo/vectorshift-logo.png\">\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/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"VectorShift\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6366f1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.vectorshift.ai/sdk/workspace/examples/documents\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdk/workspace/examples/documents.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.vectorshift.ai/#organization\",\"name\":\"VectorShift\",\"url\":\"https://docs.vectorshift.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/vectorshift/ko1lD3nuBSgpmLV4/logo/vectorshift-logo.png?fit=max\u0026auto=format\u0026n=ko1lD3nuBSgpmLV4\u0026q=85\u0026s=0b909e21221badbcd2332ad0c7b06a8e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.vectorshift.ai#website\",\"name\":\"VectorShift\",\"url\":\"https://docs.vectorshift.ai\",\"publisher\":{\"@id\":\"https://docs.vectorshift.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.vectorshift.ai/sdk/workspace/examples/documents#webpage\",\"url\":\"https://docs.vectorshift.ai/sdk/workspace/examples/documents\",\"name\":\"Documents\",\"description\":\"Upload and manage documents in a workspace\",\"dateModified\":\"2026-06-29T10:40:58.310Z\",\"isPartOf\":{\"@id\":\"https://docs.vectorshift.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.vectorshift.ai/sdk/workspace/examples/documents#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.vectorshift.ai/sdk/workspace/examples/documents#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Workspace\",\"item\":\"https://docs.vectorshift.ai/sdk/workspace/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Examples\",\"item\":\"https://docs.vectorshift.ai/sdk/workspace/examples/portal-and-workspace-crud\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Documents\",\"item\":\"https://docs.vectorshift.ai/sdk/workspace/examples/documents\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.vectorshift.ai/sdk/workspace/examples/documents#article\",\"headline\":\"Documents\",\"name\":\"Documents\",\"description\":\"Upload and manage documents in a workspace\",\"url\":\"https://docs.vectorshift.ai/sdk/workspace/examples/documents\",\"mainEntityOfPage\":{\"@id\":\"https://docs.vectorshift.ai/sdk/workspace/examples/documents#webpage\"},\"image\":\"https://docs.vectorshift.ai/logo/vectorshift-logo.png\",\"dateModified\":\"2026-06-29T10:40:58.310Z\",\"publisher\":{\"@id\":\"https://docs.vectorshift.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.vectorshift.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"VectorShift\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"VectorShift","nav":{"global":{"anchors":[{"anchor":"Book a Demo","icon":"calendar","href":"https://calendly.com/albert_mao/vectorshift-intro-chat"},{"anchor":"Changelog","icon":"history","href":"https://vectorshift.ai/blog?tag=changelog"},{"anchor":"Blog","icon":"newspaper","href":"https://vectorshift.ai/blog"},{"anchor":"Tutorials","icon":"youtube","href":"https://www.youtube.com/@VectorShiftAI"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/overview"}]},{"tab":"SDK","groups":[{"group":"Get started","pages":[{"title":"VectorShift Python SDK","sidebarTitle":"Overview","href":"/sdk"},{"title":"Installation","href":"/sdk/installation"},{"title":"Quickstart","href":"/sdk/quickstart"},{"title":"Authentication","href":"/sdk/authentication"},{"title":"Concepts","href":"/sdk/concepts"},{"title":"Errors","href":"/sdk/errors"},{"title":"Building with AI","href":"/sdk/building-with-ai"}]},{"group":"Guides","icon":"map","pages":[{"title":"RAG end-to-end","href":"/sdk/guides/rag-end-to-end"},{"title":"Customer support bot","href":"/sdk/guides/support-bot"},{"title":"Background batch jobs","href":"/sdk/guides/background-batch"},{"title":"Multi-step content workflow","href":"/sdk/guides/content-workflow"},{"title":"Integrations end-to-end","href":"/sdk/guides/integrations-end-to-end"}]},{"group":"Pipeline","icon":"workflow","pages":[{"title":"Pipeline overview","sidebarTitle":"Overview","href":"/sdk/pipeline/overview"},{"title":"Pipeline reference","sidebarTitle":"Reference","href":"/sdk/pipeline/reference"},{"group":"Nodes","pages":[{"title":"Start nodes","sidebarTitle":"Start","href":"/sdk/pipeline/nodes/start"},{"title":"General nodes","sidebarTitle":"General","href":"/sdk/pipeline/nodes/general"},{"title":"Large Language Models (LLMs) nodes","sidebarTitle":"Large Language Models (LLMs)","href":"/sdk/pipeline/nodes/llms"},{"title":"Knowledge nodes","sidebarTitle":"Knowledge","href":"/sdk/pipeline/nodes/knowledge"},{"title":"Data Loaders nodes","sidebarTitle":"Data Loaders","href":"/sdk/pipeline/nodes/data-loaders"},{"title":"Multi-Modal nodes","sidebarTitle":"Multi-Modal","href":"/sdk/pipeline/nodes/multi-modal"},{"title":"Logic nodes","sidebarTitle":"Logic","href":"/sdk/pipeline/nodes/logic"},{"title":"Data Transformation nodes","sidebarTitle":"Data Transformation","href":"/sdk/pipeline/nodes/data-transformation"},{"title":"Chat nodes","sidebarTitle":"Chat","href":"/sdk/pipeline/nodes/chat"},{"title":"Conversational nodes","sidebarTitle":"Conversational","href":"/sdk/pipeline/nodes/conversational"},{"title":"Integration nodes","sidebarTitle":"Integration","href":"/sdk/pipeline/nodes/integration"},{"title":"Triggers nodes","sidebarTitle":"Triggers","href":"/sdk/pipeline/nodes/triggers"}]},{"group":"Examples","pages":[{"title":"LLM pipeline","href":"/sdk/pipeline/examples/llm-pipeline"},{"title":"Text processing pipeline","href":"/sdk/pipeline/examples/text-processing-pipeline"},{"title":"RAG pipeline","href":"/sdk/pipeline/examples/rag-pipeline"},{"title":"Read-JSON pipeline","href":"/sdk/pipeline/examples/read-json-pipeline"},{"title":"Create-list pipeline","href":"/sdk/pipeline/examples/create-list-pipeline"},{"title":"Condition node","href":"/sdk/pipeline/examples/condition-node"},{"title":"AI routing node","href":"/sdk/pipeline/examples/ai-routing-node"},{"title":"Sub-pipelines","href":"/sdk/pipeline/examples/sub-pipeline"},{"title":"Sub-pipelines (list mode)","href":"/sdk/pipeline/examples/sub-pipeline-list-mode"},{"title":"Streaming","href":"/sdk/pipeline/examples/streaming"},{"title":"Streaming (async)","href":"/sdk/pipeline/examples/streaming-async"},{"title":"Streaming with chunks","href":"/sdk/pipeline/examples/streaming-with-chunks"},{"title":"Intermediate results","href":"/sdk/pipeline/examples/intermediate-results"},{"title":"Background runs","href":"/sdk/pipeline/examples/background-run"},{"title":"Background runs (async)","href":"/sdk/pipeline/examples/background-run-async"},{"title":"Run pipeline (async)","href":"/sdk/pipeline/examples/run-pipeline-async"},{"title":"Terminate a run","href":"/sdk/pipeline/examples/terminate-run"},{"title":"Batch config","href":"/sdk/pipeline/examples/batch-config"},{"title":"Button node","href":"/sdk/pipeline/examples/button-node"},{"title":"Gmail node","href":"/sdk/pipeline/examples/gmail-node"},{"title":"Session and overrides","href":"/sdk/pipeline/examples/session-and-overrides"},{"title":"Revert and manage versions","href":"/sdk/pipeline/examples/revert-and-manage"},{"title":"Share and publish","href":"/sdk/pipeline/examples/share-and-publish"},{"title":"Type warnings: parallel search","href":"/sdk/pipeline/examples/type-warnings-parallel-search"}]}]},{"group":"Agent","icon":"bot","pages":[{"title":"Agent overview","sidebarTitle":"Overview","href":"/sdk/agent/overview"},{"title":"Agent reference","sidebarTitle":"Reference","href":"/sdk/agent/reference"},{"group":"Tools","pages":[{"title":"VectorShift tools","sidebarTitle":"VectorShift","href":"/sdk/agent/tools/vectorshift"},{"title":"Web Search tools","sidebarTitle":"Web Search","href":"/sdk/agent/tools/web-search"},{"title":"LLM tools","sidebarTitle":"LLM","href":"/sdk/agent/tools/llm-ai"},{"title":"File Ops tools","sidebarTitle":"File Ops","href":"/sdk/agent/tools/file-ops"},{"title":"Data tools","sidebarTitle":"Data","href":"/sdk/agent/tools/data"},{"title":"Integrations tools","sidebarTitle":"Integrations","href":"/sdk/agent/tools/integrations"}]},{"group":"Examples","pages":[{"group":"Functional Agent","pages":[{"title":"Functional agent run","href":"/sdk/agent/examples/functional-agent-run"},{"title":"Functional agent with typed I/O","href":"/sdk/agent/examples/functional-agent-with-io"}]},{"group":"Conversational Agent","pages":[{"title":"Conversational agent run","href":"/sdk/agent/examples/conversational-agent-run"},{"title":"Agent CRUD","href":"/sdk/agent/examples/agent-crud"},{"title":"Conversational agent with tools","href":"/sdk/agent/examples/conversational-agent-tools"},{"title":"Tool approval config","href":"/sdk/agent/examples/tool-approval-config"},{"title":"Single-turn session","href":"/sdk/agent/examples/session-single-turn"},{"title":"Multi-turn session","href":"/sdk/agent/examples/session-multi-turn"},{"title":"Session send_many","href":"/sdk/agent/examples/session-send-many"},{"title":"Repeated sends","href":"/sdk/agent/examples/session-send-send-send"},{"title":"Streaming tool events","href":"/sdk/agent/examples/session-tool-events"},{"title":"Session approval respond","href":"/sdk/agent/examples/session-approval-respond"},{"title":"Resume a session","href":"/sdk/agent/examples/session-resume"},{"title":"Sending files in a session","href":"/sdk/agent/examples/send-file"},{"title":"Multimodal send_many","href":"/sdk/agent/examples/send-many-multimodal"},{"title":"Terminating a session","href":"/sdk/agent/examples/terminate-session"},{"title":"Chatbot session","href":"/sdk/agent/examples/chatbot-session"},{"title":"Template placeholders","href":"/sdk/agent/examples/template-placeholders"},{"title":"Vs context stringification","href":"/sdk/agent/examples/vs-context-stringification"}]}]}]},{"group":"Knowledge Base","icon":"database","pages":[{"title":"Knowledge Base overview","sidebarTitle":"Overview","href":"/sdk/knowledge-base/overview"},{"title":"Knowledge Base reference","sidebarTitle":"Reference","href":"/sdk/knowledge-base/reference"},{"group":"Examples","pages":[{"title":"Knowledge Base CRUD","href":"/sdk/knowledge-base/examples/kb-crud"},{"title":"Add files","href":"/sdk/knowledge-base/examples/add-files"},{"title":"Add folder","href":"/sdk/knowledge-base/examples/add-folder"},{"title":"Add URLs","href":"/sdk/knowledge-base/examples/add-urls"},{"title":"Add tables","href":"/sdk/knowledge-base/examples/add-tables"},{"title":"Advanced query","href":"/sdk/knowledge-base/examples/query-advanced"},{"title":"Items and folders","href":"/sdk/knowledge-base/examples/items-and-folders"},{"title":"Metadata autogen","href":"/sdk/knowledge-base/examples/metadata-autogen"},{"title":"Async API","href":"/sdk/knowledge-base/examples/async"},{"title":"Resync integration","href":"/sdk/knowledge-base/examples/resync-integration"}]}]},{"group":"Integrations","icon":"plug","pages":[{"title":"Integrations overview","sidebarTitle":"Overview","href":"/sdk/integrations/overview"},{"title":"CLI reference","sidebarTitle":"CLI","href":"/sdk/integrations/cli"},{"title":"Integrations reference","sidebarTitle":"Reference","href":"/sdk/integrations/reference"}]},{"group":"Table","icon":"table","pages":[{"title":"Table overview","sidebarTitle":"Overview","href":"/sdk/table/overview"},{"title":"Table reference","sidebarTitle":"Reference","href":"/sdk/table/reference"},{"group":"Examples","pages":[{"title":"Table CRUD","href":"/sdk/table/examples/table-crud"},{"title":"Table CRUD (async)","href":"/sdk/table/examples/table-crud-async"},{"title":"Rows and filters","href":"/sdk/table/examples/rows-and-filters"},{"title":"Schema and AI-generated columns","href":"/sdk/table/examples/columns-full"},{"title":"Aggregation and run","href":"/sdk/table/examples/aggregation-and-run"},{"title":"Export and query","href":"/sdk/table/examples/export-and-query"},{"title":"Common filter recipes","href":"/sdk/table/examples/all-filter-operators"},{"title":"Compose filters with AND and OR","href":"/sdk/table/examples/compound-filters"},{"title":"End-to-end: a vendor scorecard","href":"/sdk/table/examples/full-workflow"}]}]},{"group":"Transformation","icon":"wand-sparkles","pages":[{"title":"Transformation overview","sidebarTitle":"Overview","href":"/sdk/transformation/overview"},{"title":"Transformation reference","sidebarTitle":"Reference","href":"/sdk/transformation/reference"},{"group":"Examples","pages":[{"title":"Transformation CRUD","href":"/sdk/transformation/examples/transformation-crud"},{"title":"From a Python function","href":"/sdk/transformation/examples/from-function"},{"title":"Run \u0026 I/O types","href":"/sdk/transformation/examples/run-and-io-types"},{"title":"Async API","href":"/sdk/transformation/examples/async"},{"title":"As a pipeline node","href":"/sdk/transformation/examples/pipeline-node"}]}]},{"group":"Session","icon":"messages-square","pages":[{"title":"Session overview","sidebarTitle":"Overview","href":"/sdk/session/overview"},{"title":"Session reference","sidebarTitle":"Reference","href":"/sdk/session/reference"}]},{"group":"Analytics","icon":"chart-line","pages":[{"title":"Analytics overview","sidebarTitle":"Overview","href":"/sdk/analytics/overview"},{"title":"Analytics reference","sidebarTitle":"Reference","href":"/sdk/analytics/reference"},{"group":"Examples","pages":[{"title":"Query basics","href":"/sdk/analytics/examples/query-basics"},{"title":"Async API","href":"/sdk/analytics/examples/query-async"},{"title":"Filters \u0026 overloads","href":"/sdk/analytics/examples/filters-and-overloads"},{"title":"Aggregations \u0026 group-by","href":"/sdk/analytics/examples/aggregations-and-groupby"},{"title":"Events \u0026 traces","href":"/sdk/analytics/examples/events-and-traces"},{"title":"Data tables \u0026 export","href":"/sdk/analytics/examples/table-and-export"}]}]},{"group":"Workspace","icon":"folder-tree","pages":[{"title":"Workspace overview","sidebarTitle":"Overview","href":"/sdk/workspace/overview"},{"title":"Workspace reference","sidebarTitle":"Reference","href":"/sdk/workspace/reference"},{"title":"Portal reference","sidebarTitle":"Portal","href":"/sdk/workspace/portal"},{"title":"Verification reference","sidebarTitle":"Verification","href":"/sdk/workspace/verification"},{"title":"Verification issue reference","sidebarTitle":"Verification issue","href":"/sdk/workspace/issue"},{"group":"Examples","pages":[{"title":"Portals and workspaces","description":"Create and manage portals and workspaces","href":"/sdk/workspace/examples/portal-and-workspace-crud"},{"title":"Documents","href":"/sdk/workspace/examples/documents"},{"title":"Documents and files","description":"Add documents to a workspace and work with files directly","href":"/sdk/workspace/examples/documents-and-files"},{"title":"Chat sessions","href":"/sdk/workspace/examples/sessions"},{"title":"Skills","href":"/sdk/workspace/examples/skills"},{"title":"Verification","href":"/sdk/workspace/examples/verification"},{"title":"Verification (advanced)","href":"/sdk/workspace/examples/verification-advanced"},{"title":"Managing a portal","href":"/sdk/workspace/examples/portal-admin"},{"title":"End-to-end walkthrough","href":"/sdk/workspace/examples/end-to-end"},{"title":"Async usage","href":"/sdk/workspace/examples/async"},{"title":"Async (full surface)","href":"/sdk/workspace/examples/async-full"}]}]}]}]},"title":"Documents - VectorShift","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":[],"chunks":[]}