This endpoint supports two methods, selected by the method field:
file-upload - import an existing file from a URL or multipart upload
template - generate a PDF from a Lumin PDF template and optionally prefill fields
Copy examples from the dropdown to quickly get the sample request body for each method.The response returns a document_id in the id field. Use that ID with PDF operation endpoints such as Merge Documents or Compress Document.
Upload from file
Set method to file-upload and provide the file in one of two ways:
From a URL - send a JSON request (application/json) with document_data.file_url.
From your computer - send a multipart/form-data request with the file in the document_data[file] part. Use bracket notation for nested fields (location[type], location[folder_id]); dotted names such as location.type are not supported.
In the API playground, switch the request body type to multipart/form-data to upload a local file. The application/json body only accepts file_url.
Only PDF templates (pdf_ prefix) are supported for document creation.
Field
Description
document_data.template_id
PDF template ID (must start with pdf_).
document_data.fields
Optional key–value pairs for form fields defined in the template. Supports text and checkbox fields.
Required scopes (OAuth 2.0)
This endpoint requires the following scope:pdf:files
Authorizations
ApiKeyBearerAuth
X-API-Key
string
header
required
Provide your API key in the X-API-Key header, e.g., X-API-Key: YOUR_API_KEY.
Scopes
pdf:files
Create, edit, and delete PDF files in a Workspace.
Body
application/jsonmultipart/form-data
file-upload
template
method
enum<string>
required
Import from a file (PDF or other supported formats).
Available options:
file-upload
document_name
string
required
Human-friendly title of the document (1–255 characters).
Required string length: 1 - 255
location
object
required
Hide child attributes
location.type
enum<string>
required
Location type.
Available options:
personal,
space,
workspace
location.space_id
string
ID of a specific Space in the Workspace. Required if type = space.
location.folder_id
string
ID of a specific folder within the chosen location.
document_data
object
required
Payload for the file-upload method in a JSON request. JSON requests can only import a file from a URL.
To upload a local file, send a multipart/form-data request with the document_data[file] part instead.
Hide child attributes
document_data.file_url
string<uri>
required
HTTPS URL to download the source file.
Response
Returns the summary of the created document.
id
string
required
Unique identifier of the document in Lumin.
name
string
required
Human-friendly name of the document.
created_at
integer<unix-epoch>
required
Unix timestamp (milliseconds) when the document was created.
updated_at
integer<unix-epoch>
required
Unix timestamp (milliseconds) when the document was last updated.
location
object
required
Where the document is stored.
Hide child attributes
location.type
enum<string>
One of:
workspace — Workspace's shared document list
space — Space's shared document list
personal — Personal document list
Available options:
workspace,
space,
personal
location.workspace_id
string
ID of the Workspace that owns this document (derived from the auth token).
location.space_id
string
ID of the Space that contains the document if location.type is space. Blank otherwise.
location.folder_id
string
ID of the folder that contains the document, if any. Blank otherwise.
size
integer
required
Size of the PDF file in bytes.
mime_type
string
required
MIME type of the file (e.g. application/pdf).
preview_url
string<uri>
required
URL to open the document in Lumin's viewer.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Lumin Developer Docs","colors":{"primary":"#171717","light":"#FFFFFF","dark":"#D4D4D4"},"logo":{"light":"https://mintcdn.com/luminpdf-82c12c3f/S8lnm3z-VpB7-Jo7/logo/logo-light.svg?fit=max\u0026auto=format\u0026n=S8lnm3z-VpB7-Jo7\u0026q=85\u0026s=7efd61a54cbb6df606831ac070f96525","dark":"https://mintcdn.com/luminpdf-82c12c3f/S8lnm3z-VpB7-Jo7/logo/logo-dark.svg?fit=max\u0026auto=format\u0026n=S8lnm3z-VpB7-Jo7\u0026q=85\u0026s=a85445ea50bdbdd58bb06a604a7b81d6","href":"/"},"favicon":"https://mintcdn.com/luminpdf-82c12c3f/S8lnm3z-VpB7-Jo7/favicon.png?fit=max\u0026auto=format\u0026n=S8lnm3z-VpB7-Jo7\u0026q=85\u0026s=a8770eb57248f1a494c24b10227b64f7","api":{"openapi":"tabs/api-reference/lumin-openapi.yaml","params":{"expanded":"all"},"examples":{"defaults":"all","prefill":true}},"appearance":{"default":"light"},"navbar":{"links":[{"href":"mailto:[email protected]","label":"Contact developer support"}]},"footer":{"socials":{"website":"https://www.luminpdf.com","github":"https://github.com/luminpdf","linkedin":"https://www.linkedin.com/company/luminpdf"}},"seo":{"metatags":{"canonical":"https://developers.luminpdf.com"}},"styling":{"codeblocks":{"theme":{"light":"github-light","dark":"github-dark"}},"latex":false},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"navigation":{"global":{"anchors":[{"anchor":"Terms of Use","icon":"newspaper","href":"https://www.luminpdf.com/terms-of-use"},{"anchor":"Help Center","icon":"circle-question","href":"https://help.luminpdf.com/"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"luminpdf-82c12c3f","hasAudioNarration":false,"actualSubdomain":"luminpdf-82c12c3f","customDomains":["developers.luminpdf.com"],"gitSource":{"type":"github","owner":"luminpdf","repo":"lumin-dev-docs","deployBranch":"production","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae803e977aac486e9a5020b","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"API Reference","count":34},{"language":"default","tag":"Lumin API reference","count":33},{"language":"default","tag":"Guides","count":13},{"language":"default","tag":"Signature requests","count":10},{"language":"default","tag":"Documents","count":9},{"language":"default","tag":"Workspaces","count":5},{"language":"default","tag":"Templates","count":4},{"language":"default","tag":"Walkthroughs","count":4},{"language":"default","tag":"Webhooks","count":4},{"language":"default","tag":"Agreements","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"tabs/api-reference/api/documents/create-document","slug":"/tabs/api-reference/api/documents/create-document","pageMetadata":{"title":"Upload Document","description":"Create and save a document in the Workspace using file upload or a PDF template.","openapi":"tabs/api-reference/lumin-openapi.yaml POST /documents","href":"/tabs/api-reference/api/documents/create-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: \"Create and save a document in the Workspace using file upload or a PDF template.\"\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},{Accordion,CodeBlock,Heading,Note,Table}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`This endpoint supports two methods, selected by the `,_jsx(_components.code,{children:`method`}),` field:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`file-upload`})}),` - import an existing file from a URL or multipart upload`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`template`})}),` - generate a PDF from a Lumin PDF template and optionally prefill fields`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Copy examples from the dropdown to quickly get the sample request body for each method.`}),`\n`,_jsxs(_components.p,{children:[`The response returns a `,_jsx(_components.code,{children:`document_id`}),` in the `,_jsx(_components.code,{children:`id`}),` field. Use that ID with PDF operation endpoints such as `,_jsx(_components.a,{href:`/tabs/api-reference/api/documents/merge-documents`,children:`Merge Documents`}),` or `,_jsx(_components.a,{href:`/tabs/api-reference/api/documents/compress-document`,children:`Compress Document`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`upload-from-file`,children:`Upload from file`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`method`}),` to `,_jsx(_components.code,{children:`file-upload`}),` and provide the file in one of two ways:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`From a URL`}),` - send a JSON request (`,_jsx(_components.code,{children:`application/json`}),`) with `,_jsx(_components.code,{children:`document_data.file_url`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`From your computer`}),` - send a `,_jsx(_components.code,{children:`multipart/form-data`}),` request with the file in the `,_jsx(_components.code,{children:`document_data[file]`}),` part. Use bracket notation for nested fields (`,_jsx(_components.code,{children:`location[type]`}),`, `,_jsx(_components.code,{children:`location[folder_id]`}),`); dotted names such as `,_jsx(_components.code,{children:`location.type`}),` are not supported.`]}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`In the API playground, switch the request body type to `,_jsx(_components.code,{children:`multipart/form-data`}),` to upload a local file. The `,_jsx(_components.code,{children:`application/json`}),` body only accepts `,_jsx(_components.code,{children:`file_url`}),`.`]})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -X`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` POST`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` https://api.luminpdf.com/v1/documents`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"X-API-KEY: YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -F`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"method=file-upload\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -F`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"document_name=Patient Form\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -F`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"location[type]=workspace\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -F`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"document_data[file]=@/path/to/file.pdf;type=application/pdf\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`supported-file-formats`,children:`Supported file formats`}),`\n`,_jsx(_components.p,{children:`PDF, DOCX, XLSX, PPTX, DOC, XLS, PNG, JPEG/JPG`}),`\n`,_jsx(Heading,{level:`3`,id:`file-size-limits`,children:`File size limits`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Plan`}),_jsx(_components.th,{children:`Max size`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Free`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`20 MB`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Paid`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`200 MB`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`create-from-template`,children:`Create from template`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`method`}),` to `,_jsx(_components.code,{children:`template`}),`, provide a `,_jsx(_components.code,{children:`pdf_`}),` template ID, and optionally prefill form fields.`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`List templates with `,_jsx(_components.a,{href:`/tabs/api-reference/api/templates/list-templates`,children:`List Templates`}),` and find a template whose ID starts with `,_jsx(_components.code,{children:`pdf_`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Optionally inspect fields with `,_jsx(_components.a,{href:`/tabs/api-reference/api/templates/get-template-details`,children:`Get Template Details`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Only PDF templates (`,_jsx(_components.code,{children:`pdf_`}),` prefix) are supported for document creation.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`document_data.template_id`})}),_jsxs(_components.td,{children:[`PDF template ID (must start with `,_jsx(_components.code,{children:`pdf_`}),`).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`document_data.fields`})}),_jsx(_components.td,{children:`Optional key–value pairs for form fields defined in the template. Supports text and checkbox fields.`})]})]})]}),`\n`,_jsxs(Accordion,{title:`Required scopes (OAuth 2.0)`,icon:`key`,id:`required-scopes-oauth-2-0`,children:[_jsx(_components.p,{children:`This endpoint requires the following scope:`}),_jsx(_components.p,{children:_jsx(_components.code,{children:`pdf:files`})})]})]})}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":{"theme":{"light":"github-light","dark":"github-dark"}},"config":{},"pageMetadata":{"title":"Upload Document","description":"Create and save a document in the Workspace using file upload or a PDF template.","openapi":"tabs/api-reference/lumin-openapi.yaml POST /documents","href":"/tabs/api-reference/api/documents/create-document"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Upload from file","slug":"upload-from-file","depth":2,"children":[{"title":"Supported file formats","slug":"supported-file-formats","depth":3,"children":[]},{"title":"File size limits","slug":"file-size-limits","depth":3,"children":[]}]},{"title":"Create from template","slug":"create-from-template","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Create Document","description":"Create and save a document in the Workspace using file upload or a PDF template.","security":["d4f2f80c-4c1b-40a2-b70a-211abecd1853","fe0ed717-f540-4cb1-b604-9509befd8585"],"tags":["Documents"],"requestBody":"93a04d33-034a-4ac1-b16c-c83eabbee93a","responses":{"201":"8db0f59f-3a35-4586-bc68-844aed8f936a","4XX":"0b48e6fc-f96a-4d1c-8a21-ee2f76e79c52"},"method":"post","type":"path","servers":["202e8aa8-5179-43c5-b94e-e9e3b6777055"],"path":"/documents","baseUrlOptions":["https://api.luminpdf.com/v1"],"title":"Create Document","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.oneOf.0.method":"file-upload","body.oneOf.0.document_name":"Patient Form","body.oneOf.0.location.type":"workspace","body.oneOf.0.location.folder_id":"123456","body.oneOf.0.document_data.file_url":"https://files.luminpdf.com/download/nda-acmecorp-abc123.pdf"},{"body.oneOf.0.method":"file-upload","body.oneOf.0.document_name":"Q4 Sales Report","body.oneOf.0.location.type":"space","body.oneOf.0.location.space_id":"69d74983d0cbaa0977be7997","body.oneOf.0.location.folder_id":"789012","body.oneOf.0.document_data.file_url":"https://my-bucket.s3.amazonaws.com/docs/q4-report.pdf"},{"body.oneOf.0.method":"file-upload","body.oneOf.0.document_name":"My Notes","body.oneOf.0.location.type":"personal","body.oneOf.0.document_data.file_url":"https://files.luminpdf.com/download/notes-abc123.pdf"},{"body.oneOf.1.method":"template","body.oneOf.1.document_name":"Patient Information Form","body.oneOf.1.location.type":"workspace","body.oneOf.1.location.folder_id":"123456","body.oneOf.1.document_data.template_id":"pdf_12312321","body.oneOf.1.document_data.fields":{"Client.Name":"Acme Corp","Document.EffectiveDate":"2025-08-01"}},{"body.oneOf.1.method":"template","body.oneOf.1.document_name":"Onboarding Packet","body.oneOf.1.location.type":"space","body.oneOf.1.location.space_id":"69d74983d0cbaa0977be7997","body.oneOf.1.document_data.template_id":"pdf_98765432","body.oneOf.1.document_data.fields":{"Employee.Name":"Jane Doe","Employee.StartDate":"2026-01-15"}},{"body.oneOf.1.method":"template","body.oneOf.1.document_name":"Tax Worksheet","body.oneOf.1.location.type":"personal","body.oneOf.1.document_data.template_id":"pdf_55555555","body.oneOf.1.document_data.fields":{"TaxYear":"2025","Filer.Name":"John Smith"}}]},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"file-upload","required":["method","document_name","location","document_data"],"properties":{"method":{"type":"string","enum":["file-upload"],"description":"Import from a file (PDF or other supported formats).","isRequired":true,"uniqueKey":"oneOf.0.method","typeLabel":"enum\u003cstring>"},"document_name":{"type":"string","minLength":1,"maxLength":255,"description":"Human-friendly title of the document (1–255 characters).","isRequired":true,"uniqueKey":"oneOf.0.document_name","typeLabel":"string"},"location":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Location type.","enum":["personal","space","workspace"],"isRequired":true,"uniqueKey":"oneOf.0.location.type","typeLabel":"enum\u003cstring>"},"space_id":{"type":"string","description":"ID of a specific Space in the Workspace. Required if `type` = `space`.","uniqueKey":"oneOf.0.location.space_id","typeLabel":"string"},"folder_id":{"type":"string","description":"ID of a specific folder within the chosen location.","uniqueKey":"oneOf.0.location.folder_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.0.location","typeLabel":"object"},"document_data":{"type":"object","description":"Payload for the file-upload method in a JSON request. JSON requests can only import a file from a URL.\nTo upload a local file, send a `multipart/form-data` request with the `document_data[file]` part instead.\n","required":["file_url"],"properties":{"file_url":{"type":"string","format":"uri","description":"HTTPS URL to download the source file.","isRequired":true,"uniqueKey":"oneOf.0.document_data.file_url","typeLabel":"string\u003curi>"}},"isRequired":true,"uniqueKey":"oneOf.0.document_data","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"file-upload · object"},{"type":"object","title":"template","required":["method","document_name","location","document_data"],"properties":{"method":{"type":"string","enum":["template"],"description":"Create from a PDF template (only templates with `pdf_` prefix are supported).","isRequired":true,"uniqueKey":"oneOf.1.method","typeLabel":"enum\u003cstring>"},"document_name":{"type":"string","minLength":1,"maxLength":255,"description":"Human-friendly title of the document (1–255 characters).","isRequired":true,"uniqueKey":"oneOf.1.document_name","typeLabel":"string"},"location":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Location type.","enum":["personal","space","workspace"],"isRequired":true,"uniqueKey":"oneOf.1.location.type","typeLabel":"enum\u003cstring>"},"space_id":{"type":"string","description":"ID of a specific Space in the Workspace. Required if `type` = `space`.","uniqueKey":"oneOf.1.location.space_id","typeLabel":"string"},"folder_id":{"type":"string","description":"ID of a specific folder within the chosen location.","uniqueKey":"oneOf.1.location.folder_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.1.location","typeLabel":"object"},"document_data":{"type":"object","description":"Payload for template method. Only PDF templates (template_id with `pdf_` prefix) are supported.","required":["template_id"],"properties":{"template_id":{"type":"string","description":"Unique identifier of the PDF template. Obtainable from the Template list API.\nOnly PDF templates (IDs starting with `pdf_` prefix) are supported for document creation.\n","isRequired":true,"uniqueKey":"oneOf.1.document_data.template_id","typeLabel":"string"},"fields":{"type":"object","description":"Key–value pairs for **Form Fields** defined in the template. Keys must match field names. Values prefill the corresponding form fields in the generated document. Currently supports: **checkbox, text field**.\n","uniqueKey":"oneOf.1.document_data.fields","typeLabel":"object"}},"isRequired":true,"uniqueKey":"oneOf.1.document_data","typeLabel":"object"}},"uniqueKey":"oneOf.1","typeLabel":"template · object"}],"uniqueKey":"","typeLabel":"file-upload · object | template · object"},"examples":{"upload-workspace":{"title":"upload-workspace","summary":"File upload to Workspace","value":{"method":"file-upload","document_name":"Patient Form","location":{"type":"workspace","folder_id":"123456"},"document_data":{"file_url":"https://files.luminpdf.com/download/nda-acmecorp-abc123.pdf"}}},"upload-space":{"title":"upload-space","summary":"File upload to Space","value":{"method":"file-upload","document_name":"Q4 Sales Report","location":{"type":"space","space_id":"69d74983d0cbaa0977be7997","folder_id":"789012"},"document_data":{"file_url":"https://my-bucket.s3.amazonaws.com/docs/q4-report.pdf"}}},"upload-personal":{"title":"upload-personal","summary":"File upload to Personal","value":{"method":"file-upload","document_name":"My Notes","location":{"type":"personal"},"document_data":{"file_url":"https://files.luminpdf.com/download/notes-abc123.pdf"}}},"template-workspace":{"title":"template-workspace","summary":"PDF template to Workspace","value":{"method":"template","document_name":"Patient Information Form","location":{"type":"workspace","folder_id":"123456"},"document_data":{"template_id":"pdf_12312321","fields":{"Client.Name":"Acme Corp","Document.EffectiveDate":"2025-08-01"}}}},"template-space":{"title":"template-space","summary":"PDF template to Space","value":{"method":"template","document_name":"Onboarding Packet","location":{"type":"space","space_id":"69d74983d0cbaa0977be7997"},"document_data":{"template_id":"pdf_98765432","fields":{"Employee.Name":"Jane Doe","Employee.StartDate":"2026-01-15"}}}},"template-personal":{"title":"template-personal","summary":"PDF template to Personal","value":{"method":"template","document_name":"Tax Worksheet","location":{"type":"personal"},"document_data":{"template_id":"pdf_55555555","fields":{"TaxYear":"2025","Filer.Name":"John Smith"}}}}},"exampleType":"examples"},"multipart/form-data":{"schema":{"type":"object","title":"file-upload (multipart)","description":"Upload a local file. Nested fields use bracket notation as multipart field names\n(for example `location[type]`, `document_data[file]`); dotted names such as `location.type` are not supported.\n","required":["method","document_name","location[type]","document_data[file]"],"properties":{"method":{"type":"string","enum":["file-upload"],"description":"Import from a file (PDF or other supported formats).","isRequired":true,"uniqueKey":"method","typeLabel":"enum\u003cstring>"},"document_name":{"type":"string","minLength":1,"maxLength":255,"description":"Human-friendly title of the document (1–255 characters).","isRequired":true,"uniqueKey":"document_name","typeLabel":"string"},"location[type]":{"type":"string","description":"Location type.","enum":["personal","space","workspace"],"isRequired":true,"uniqueKey":"location[type]","typeLabel":"enum\u003cstring>"},"document_data[file]":{"type":"string","format":"binary","description":"The file to upload from your computer.","isRequired":true,"uniqueKey":"document_data[file]","typeLabel":"file"},"location[space_id]":{"type":"string","description":"ID of a specific Space in the Workspace. Required if `location[type]` = `space`.","uniqueKey":"location[space_id]","typeLabel":"string"},"location[folder_id]":{"type":"string","description":"ID of a specific folder within the chosen location.","uniqueKey":"location[folder_id]","typeLabel":"string"}},"uniqueKey":"","typeLabel":"file-upload (multipart) · object"},"examples":{"upload-workspace":{"title":"upload-workspace","summary":"Upload a local file to Workspace","value":{"method":"file-upload","document_name":"Patient Form","location[type]":"workspace","location[folder_id]":"123456","document_data[file]":"(binary)"}},"upload-space":{"title":"upload-space","summary":"Upload a local file to Space","value":{"method":"file-upload","document_name":"Q4 Sales Report","location[type]":"space","location[space_id]":"69d74983d0cbaa0977be7997","location[folder_id]":"789012","document_data[file]":"(binary)"}},"upload-personal":{"title":"upload-personal","summary":"Upload a local file to Personal","value":{"method":"file-upload","document_name":"My Notes","location[type]":"personal","document_data[file]":"(binary)"}}},"encoding":{"document_data[file]":{"contentType":"application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/msword, application/vnd.ms-excel, image/png, image/jpeg"}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"8db0f59f-3a35-4586-bc68-844aed8f936a":{"description":"Returns the summary of the created document.","content":{"application/json":{"schema":{"type":"object","required":["id","name","created_at","updated_at","location","size","mime_type","preview_url"],"properties":{"id":{"type":"string","description":"Unique identifier of the document in Lumin.","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"name":{"type":"string","description":"Human-friendly name of the document.","isRequired":true,"uniqueKey":"name","typeLabel":"string"},"created_at":{"type":"integer","format":"unix-epoch","description":"Unix timestamp (milliseconds) when the document was created.","isRequired":true,"uniqueKey":"created_at","typeLabel":"integer\u003cunix-epoch>"},"updated_at":{"type":"integer","format":"unix-epoch","description":"Unix timestamp (milliseconds) when the document was last updated.","isRequired":true,"uniqueKey":"updated_at","typeLabel":"integer\u003cunix-epoch>"},"location":{"type":"object","description":"Where the document is stored.","properties":{"type":{"type":"string","description":"One of:\n- `workspace` — Workspace's shared document list\n- `space` — Space's shared document list\n- `personal` — Personal document list\n","enum":["workspace","space","personal"],"uniqueKey":"location.type","typeLabel":"enum\u003cstring>"},"workspace_id":{"type":"string","description":"ID of the Workspace that owns this document (derived from the auth token).","uniqueKey":"location.workspace_id","typeLabel":"string"},"space_id":{"type":"string","description":"ID of the Space that contains the document if `location.type` is `space`. Blank otherwise.","uniqueKey":"location.space_id","typeLabel":"string"},"folder_id":{"type":"string","description":"ID of the folder that contains the document, if any. Blank otherwise.","uniqueKey":"location.folder_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"location","typeLabel":"object"},"size":{"type":"integer","description":"Size of the PDF file in bytes.","isRequired":true,"uniqueKey":"size","typeLabel":"integer"},"mime_type":{"type":"string","description":"MIME type of the file (e.g. `application/pdf`).","isRequired":true,"uniqueKey":"mime_type","typeLabel":"string"},"preview_url":{"type":"string","format":"uri","description":"URL to open the document in Lumin's viewer.","isRequired":true,"uniqueKey":"preview_url","typeLabel":"string\u003curi>"}},"uniqueKey":"","typeLabel":"object"},"example":{"id":"doc_abc123def456","name":"Patient Form","created_at":1748456885430,"updated_at":1748456885430,"location":{"type":"workspace","workspace_id":"123456","folder_id":"789"},"size":245678,"mime_type":"application/pdf","preview_url":"https://app.luminpdf.com/viewer/doc_abc123def456"},"examples":{"Example":{"title":"Example","value":{"id":"doc_abc123def456","name":"Patient Form","created_at":1748456885430,"updated_at":1748456885430,"location":{"type":"workspace","workspace_id":"123456","folder_id":"789"},"size":245678,"mime_type":"application/pdf","preview_url":"https://app.luminpdf.com/viewer/doc_abc123def456"}}},"exampleType":"examples"}},"exampleType":"examples"},"0b48e6fc-f96a-4d1c-8a21-ee2f76e79c52":{"description":"Unexpected error","content":{"application/json":{"schema":{"type":"object","required":["error_code","error_message"],"properties":{"error_code":{"type":"string","description":"The system error code.","isRequired":true,"uniqueKey":"error_code","typeLabel":"string"},"error_message":{"type":"string","description":"The human-readable error message.","isRequired":true,"uniqueKey":"error_message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error_code":"\u003cstring>","error_message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"d4f2f80c-4c1b-40a2-b70a-211abecd1853":{"ApiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Provide your API key in the `X-API-Key` header, e.g., `X-API-Key: YOUR_API_KEY`.\n","scopes":[],"schemeName":"ApiKey"}},"fe0ed717-f540-4cb1-b604-9509befd8585":{"BearerAuth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.luminpdf.com/oauth2/auth","tokenUrl":"https://auth.luminpdf.com/oauth2/token","scopes":{"openid":"Retrieve basic identity details (username, email, profile picture).","offline_access":"Request a refresh token for long-lived access. Private apps only.","profile.read":"View basic user profile information.","workspaces":"View and manage Workspaces and Spaces.","workspaces.read":"View information about the authenticated user's Workspace.","templates":"View and manage templates in a Workspace.","pdf:files":"Create, edit, and delete PDF files in a Workspace.","pdf:files.read":"Retrieve PDF documents stored in a Workspace.","sign:requests":"Create, update, or view signature requests.","sign:requests.read":"Retrieve signature requests.","agreements":"Create, update, or delete AgreementGen documents."}}},"description":"OAuth 2.0 authorization code flow. Provide your access token in the `Authorization` header, e.g., `Authorization: Bearer \u003ctoken>`. See the [OAuth 2.0 guide](/tabs/guides/authentication/oauth2) for details.\n","scopes":["pdf:files"],"schemeName":"BearerAuth"}}},"servers":{"202e8aa8-5179-43c5-b94e-e9e3b6777055":{"url":"https://api.luminpdf.com/v1","description":"Production server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Provide your API key in the `X-API-Key` header, e.g., `X-API-Key: YOUR_API_KEY`.\n","scopes":[],"schemeName":"ApiKey"},"schema":{"title":"X-API-Key","type":"string","description":"Provide your API key in the `X-API-Key` header, e.g., `X-API-Key: YOUR_API_KEY`.\n","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKey","name":"X-API-Key"}],"title":"ApiKey"},{"schemes":[{"scheme":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.luminpdf.com/oauth2/auth","tokenUrl":"https://auth.luminpdf.com/oauth2/token","scopes":{"openid":"Retrieve basic identity details (username, email, profile picture).","offline_access":"Request a refresh token for long-lived access. Private apps only.","profile.read":"View basic user profile information.","workspaces":"View and manage Workspaces and Spaces.","workspaces.read":"View information about the authenticated user's Workspace.","templates":"View and manage templates in a Workspace.","pdf:files":"Create, edit, and delete PDF files in a Workspace.","pdf:files.read":"Retrieve PDF documents stored in a Workspace.","sign:requests":"Create, update, or view signature requests.","sign:requests.read":"Retrieve signature requests.","agreements":"Create, update, or delete AgreementGen documents."}}},"description":"OAuth 2.0 authorization code flow. Provide your access token in the `Authorization` header, e.g., `Authorization: Bearer \u003ctoken>`. See the [OAuth 2.0 guide](/tabs/guides/authentication/oauth2) for details.\n","scopes":["pdf:files"],"schemeName":"BearerAuth"},"schema":{"title":"OAuth2 Auth","type":"string","isRequired":true,"description":"OAuth 2.0 authorization code flow. Provide your access token in the `Authorization` header, e.g., `Authorization: Bearer \u003ctoken>`. See the [OAuth 2.0 guide](/tabs/guides/authentication/oauth2) for details.\n","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"tabs/api-reference/lumin-openapi.yaml"},"subdomain":"luminpdf-82c12c3f","siteName":"Lumin Developer Docs","title":"Upload Document - Lumin Developer Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-02T03:30:55.856Z","originalFileLocation":"tabs/api-reference/api/documents/create-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=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create and save a document in the Workspace using file upload or a PDF template.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Lumin Developer Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/luminpdf-82c12c3f/pSGZfwsnYnu5RQbc/_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/luminpdf-82c12c3f/pSGZfwsnYnu5RQbc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/luminpdf-82c12c3f/pSGZfwsnYnu5RQbc/_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/luminpdf-82c12c3f/pSGZfwsnYnu5RQbc/_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/luminpdf-82c12c3f/pSGZfwsnYnu5RQbc/_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/luminpdf-82c12c3f/pSGZfwsnYnu5RQbc/_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/luminpdf-82c12c3f/pSGZfwsnYnu5RQbc/_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/luminpdf-82c12c3f/pSGZfwsnYnu5RQbc/_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/luminpdf-82c12c3f/pSGZfwsnYnu5RQbc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Upload Document - Lumin Developer Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create and save a document in the Workspace using file upload or a PDF template.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Lumin Developer Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developers.luminpdf.com/tabs/api-reference/api/documents/create-document\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://luminpdf-82c12c3f.mintlify.site/_mintlify/api/og/v2?division=Documents\u0026amp;title=Upload+Document\u0026amp;description=Create+and+save+a+document+in+the+Workspace+using+file+upload+or+a+PDF+template.\u0026amp;theme=3f6489bf8710890e4f2fb5a1\u0026amp;signature=d5b0c1259f1dfaa050eb029dee8135ec356678c3461efa4194e5da618ce796c5\">\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 - Lumin Developer Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create and save a document in the Workspace using file upload or a PDF template.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://luminpdf-82c12c3f.mintlify.site/_mintlify/api/og/v2?division=Documents\u0026amp;title=Upload+Document\u0026amp;description=Create+and+save+a+document+in+the+Workspace+using+file+upload+or+a+PDF+template.\u0026amp;theme=3f6489bf8710890e4f2fb5a1\u0026amp;signature=d5b0c1259f1dfaa050eb029dee8135ec356678c3461efa4194e5da618ce796c5\">\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/luminpdf-82c12c3f/pSGZfwsnYnu5RQbc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Lumin Developer Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#171717\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developers.luminpdf.com/tabs/api-reference/api/documents/create-document\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/tabs/api-reference/api/documents/create-document.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developers.luminpdf.com/#organization\",\"name\":\"Lumin Developer Docs\",\"url\":\"https://developers.luminpdf.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/luminpdf-82c12c3f/S8lnm3z-VpB7-Jo7/logo/logo-light.svg?fit=max\u0026auto=format\u0026n=S8lnm3z-VpB7-Jo7\u0026q=85\u0026s=7efd61a54cbb6df606831ac070f96525\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developers.luminpdf.com#website\",\"name\":\"Lumin Developer Docs\",\"url\":\"https://developers.luminpdf.com\",\"publisher\":{\"@id\":\"https://developers.luminpdf.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developers.luminpdf.com/tabs/api-reference/api/documents/create-document#webpage\",\"url\":\"https://developers.luminpdf.com/tabs/api-reference/api/documents/create-document\",\"name\":\"Upload Document\",\"description\":\"Create and save a document in the Workspace using file upload or a PDF template.\",\"dateModified\":\"2026-11-02T03:30:55.856Z\",\"isPartOf\":{\"@id\":\"https://developers.luminpdf.com#website\"},\"breadcrumb\":{\"@id\":\"https://developers.luminpdf.com/tabs/api-reference/api/documents/create-document#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developers.luminpdf.com/tabs/api-reference/api/documents/create-document#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Lumin API reference\",\"item\":\"https://developers.luminpdf.com/tabs/api-reference/api/agreements/agreements\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Documents\",\"item\":\"https://developers.luminpdf.com/tabs/api-reference/api/documents/documents\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Upload Document\",\"item\":\"https://developers.luminpdf.com/tabs/api-reference/api/documents/create-document\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://developers.luminpdf.com/tabs/api-reference/api/documents/create-document#apireference\",\"headline\":\"Upload Document\",\"name\":\"Upload Document\",\"description\":\"Create and save a document in the Workspace using file upload or a PDF template.\",\"url\":\"https://developers.luminpdf.com/tabs/api-reference/api/documents/create-document\",\"mainEntityOfPage\":{\"@id\":\"https://developers.luminpdf.com/tabs/api-reference/api/documents/create-document#webpage\"},\"dateModified\":\"2026-11-02T03:30:55.856Z\",\"publisher\":{\"@id\":\"https://developers.luminpdf.com/#organization\"},\"isPartOf\":{\"@id\":\"https://developers.luminpdf.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Lumin Developer Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Lumin Developer Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/tabs/api-reference/api/documents/create-document.md","siteName":"Lumin Developer Docs","nav":{"global":{"anchors":[{"anchor":"Terms of Use","icon":"newspaper","href":"https://www.luminpdf.com/terms-of-use"},{"anchor":"Help Center","icon":"circle-question","href":"https://help.luminpdf.com/"}]},"tabs":[{"tab":"Home","pages":[{"title":"Home","href":""}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/tabs/guides/getting-started"}]},{"tab":"API Reference","groups":[{"group":"API Documentation","pages":[{"title":"Lumin API Reference","sidebarTitle":"Introduction","href":"/tabs/api-reference/api/lumin-api-reference"}]},{"group":"Lumin API reference","pages":[{"group":"Agreements","expanded":false,"pages":[{"title":"Agreements","sidebarTitle":"Overview","href":"/tabs/api-reference/api/agreements/agreements"},{"title":"Create Agreement","openapi":"POST /agreements","href":"/tabs/api-reference/api/agreements/create-agreement"},{"title":"Get Agreement File","openapi":"GET /agreements/{agreement_id}/file","href":"/tabs/api-reference/api/agreements/get-agreement-file"}]},{"group":"Signature requests","expanded":false,"pages":[{"title":"Signature Requests","sidebarTitle":"Overview","href":"/tabs/api-reference/api/signature-requests/signature-requests"},{"title":"Get Signature Request","openapi":"GET /signature_request/{signature_request_id}","href":"/tabs/api-reference/api/signature-requests/get-signature-request"},{"title":"Update Signature Request","openapi":"PATCH /signature_request/{signature_request_id}","href":"/tabs/api-reference/api/signature-requests/update-signature-request"},{"title":"Send Signature Request","openapi":"POST /signature_request/send","href":"/tabs/api-reference/api/signature-requests/send-signature-request"},{"title":"Send Signature Request from Template","openapi":"POST /signature_request/send-from-template","href":"/tabs/api-reference/api/signature-requests/send-signature-request-from-template"},{"title":"Get Signing Link","openapi":"POST /signature_request/{signature_request_id}/signing-link","href":"/tabs/api-reference/api/signature-requests/get-signing-link"},{"title":"Create Signing Session","openapi":"POST /signature_request/{signature_request_id}/signing-session","href":"/tabs/api-reference/api/signature-requests/create-signing-session"},{"title":"Send Reminder Emails","openapi":"POST /signature_request/remind/{signature_request_id}","href":"/tabs/api-reference/api/signature-requests/send-reminder-emails"},{"title":"Cancel Signature Request","openapi":"PUT /signature_request/cancel/{signature_request_id}","href":"/tabs/api-reference/api/signature-requests/cancel-signature-request"},{"title":"Get Signature Request File","openapi":"GET /signature_request/{signature_request_id}/file","href":"/tabs/api-reference/api/signature-requests/get-signature-request-file"}]},{"group":"Templates","expanded":false,"pages":[{"title":"Templates","sidebarTitle":"Overview","href":"/tabs/api-reference/api/templates/templates"},{"title":"List Templates","openapi":"GET /templates","href":"/tabs/api-reference/api/templates/list-templates"},{"title":"Get Template Details","openapi":"GET /templates/{template_id}","href":"/tabs/api-reference/api/templates/get-template-details"},{"title":"Generate Document from Template","openapi":"POST /templates/{template_id}/generate-document","href":"/tabs/api-reference/api/templates/generate-document-from-template"}]},{"group":"Documents","expanded":false,"pages":[{"title":"Documents","sidebarTitle":"Overview","description":"Create, upload, and process PDF documents in the Workspace.","href":"/tabs/api-reference/api/documents/documents"},{"title":"Upload Document","openapi":"tabs/api-reference/lumin-openapi.yaml POST /documents","href":"/tabs/api-reference/api/documents/create-document"},{"title":"Merge Documents","description":"Merge multiple documents into a single PDF file and return a temporary download URL.","openapi":"tabs/api-reference/lumin-openapi.yaml POST /documents/merge","href":"/tabs/api-reference/api/documents/merge-documents"},{"title":"Compress Document","openapi":"tabs/api-reference/lumin-openapi.yaml POST /documents/compress","href":"/tabs/api-reference/api/documents/compress-document"},{"title":"Split Document","openapi":"tabs/api-reference/lumin-openapi.yaml POST /documents/split","href":"/tabs/api-reference/api/documents/split-document"},{"title":"Add Password","openapi":"tabs/api-reference/lumin-openapi.yaml POST /documents/add-password","href":"/tabs/api-reference/api/documents/add-password"},{"title":"Remove Password","openapi":"tabs/api-reference/lumin-openapi.yaml POST /documents/remove-password","href":"/tabs/api-reference/api/documents/remove-password"},{"title":"Summarize Document","openapi":"tabs/api-reference/lumin-openapi.yaml POST /documents/summarize","href":"/tabs/api-reference/api/documents/summarize-document"},{"title":"Translate Document","openapi":"tabs/api-reference/lumin-openapi.yaml POST /documents/translate","href":"/tabs/api-reference/api/documents/translate-document"}]},{"group":"Workspaces","expanded":false,"pages":[{"title":"Workspaces","sidebarTitle":"Overview","href":"/tabs/api-reference/api/workspaces/workspaces"},{"title":"Get Workspace Information","openapi":"GET /workspaces/info","href":"/tabs/api-reference/api/workspaces/get-workspace-information"},{"title":"Get Workspace Members","openapi":"GET /workspaces/members","href":"/tabs/api-reference/api/workspaces/get-workspace-members"},{"title":"List Spaces","openapi":"GET /workspaces/spaces","href":"/tabs/api-reference/api/workspaces/list-spaces"},{"title":"Create Space","openapi":"POST /workspaces/spaces","href":"/tabs/api-reference/api/workspaces/create-space"}]},{"group":"Users","expanded":false,"pages":[{"title":"Users","sidebarTitle":"Overview","href":"/tabs/api-reference/api/users/users"},{"title":"Get User Information","openapi":"GET /user/info","href":"/tabs/api-reference/api/users/get-user-information"}]}]}]},{"tab":"Lumin MCP","pages":[{"title":"Lumin MCP","href":"/tabs/mcp/client"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/tabs/changelog"}]}]},"basePath":"","title":"Upload Document - Lumin Developer Docs","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CiUHMMOm.js","snippetPresets-BgfXU7Bw.js","utils-DWvOwgy_.js","style-to-object-BY3JEAdk.js","utils-BN7RXSMJ.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-CFw8bq89.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CAwdfOU2.js","_Uint8Array-BJr8e-ZL.js","isObject-FP1Yky1u.js","ApiExamples-XX0UgMZK.js","usePlaygroundInputsStore-DXDFSa1V.js","shallow-CdX5aREi.js","isEqual-CoOaxexF.js","CodeSnippets-Cg2wpzWm.js","CodeSnippet-D_HwgQO_.js","getApiPlaygroundDisplay-CmCoerhe.js","Page-CVJ-f_k1.js","DynamicMarkdown-CQM9Bhbv.js","SectionHeading-DpbrP8nQ.js","icon-BPCgijHy.js","MethodPill-GQ8DuY0c.js","getPastedJson-Cb5mT31m.js","Check2Icon-a7bUI6e8.js","axios-CsQoIw0U.js","Markdown-CX2QY19L.js","AssistantPageLink-CY3bFglh.js","dist-Dl6_zDnT.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}