Learn how to create a document in Essal Office via the API, set permissions, and upload attachments.
Essal Office allows you to create and manage documents programmatically. This guide walks through creating a new document, setting its initial permissions, and attaching a file.
Documents support up to 50 attachments and a maximum single file size of 100 MB. For larger files, use the chunked upload endpoint at /v1/office/files/upload/chunked.
Move a document from draft to published status to make it available to permitted viewers:
POST /v1/office/documents/doc_01HXYZABC/publish
The document status transitions to published and a office.document.published event fires on the event bus.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Essal Developer Docs","colors":{"primary":"#0066FF","light":"#3D8BFF","dark":"#0050B4"},"logo":{"light":"https://mintcdn.com/essal/5qVV5p4Y6tAbM76k/logo/logo.svg?fit=max\u0026auto=format\u0026n=5qVV5p4Y6tAbM76k\u0026q=85\u0026s=706e0f6b7817c8a2af008f21830be42b","dark":"https://mintcdn.com/essal/5qVV5p4Y6tAbM76k/logo/logo.svg?fit=max\u0026auto=format\u0026n=5qVV5p4Y6tAbM76k\u0026q=85\u0026s=706e0f6b7817c8a2af008f21830be42b","href":"https://essal.cloud"},"favicon":"https://mintcdn.com/essal/McBxieepy9CPQ7G0/favicon.png?fit=max\u0026auto=format\u0026n=McBxieepy9CPQ7G0\u0026q=85\u0026s=10fba0b2f9e4f93957e9338d17ef82cb","api":{"playground":{}},"background":{},"footer":{"socials":{"github":"https://github.com/essal","facebook":"https://facebook.com/essal","linkedin":"https://www.linkedin.com/company/essal"},"links":[{"items":[{"label":"Office","href":"https://essal.cloud/products/office"},{"label":"Access","href":"https://essal.cloud/products/access"},{"label":"Sales","href":"https://essal.cloud/products/sales"},{"label":"Careers","href":"https://essal.cloud/products/careers"},{"label":"Project","href":"https://essal.cloud/products/project"},{"label":"Guard","href":"https://essal.cloud/products/guard"}]},{"items":[{"label":"Help Center","href":"https://support.essal.cloud"},{"label":"Training","href":"https://essal.cloud/training"},{"label":"Security Center","href":"https://essal.cloud/security"},{"label":"Legal Center","href":"https://legal.essal.cloud/"},{"label":"Certifications","href":"https://credentials.essal.cloud/"}]},{"items":[{"label":"About Us","href":"https://essal.cloud/about"},{"label":"Careers","href":"https://careers.essal.cloud/"},{"label":"Newsroom","href":"https://newsroom.essal.cloud/"},{"label":"Become a Partner","href":"https://essal.cloud/partners"},{"label":"Brand Assets","href":"https://brand.essal.cloud/"},{"label":"Contact","href":"https://essal.cloud/contact"}]},{"items":[{"label":"Privacy","href":"https://legal.essal.cloud/privacy"},{"label":"Terms of use","href":"https://legal.essal.cloud/terms"},{"label":"Leave Feedback","href":"https://review.essal.cloud/"},{"label":"Status Page","href":"https://status.essal.cloud/"}]}]},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"essal","hasAudioNarration":false,"actualSubdomain":"essal","customDomains":["developers.essal.cloud"],"gitSource":{"type":"github","owner":"essalhq","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"collectionId":"4d503a57-591d-47e7-9d7d-1abd2ae897c8","liveDeploymentHistoryId":"6a5383090b5bb62de3ce1c58","schemaVersion":"v3"},"entitlements":{},"buildId":"6a5383090b5bb62de3ce1c58:success","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"Documentation","count":38},{"language":"default","tag":"API Reference","count":23},{"language":"default","tag":"SDKs \u0026 Tools","count":8},{"language":"default","tag":"Platform Concepts","count":6},{"language":"default","tag":"Getting Started","count":5},{"language":"default","tag":"Integrations","count":5},{"language":"default","tag":"Official SDKs","count":5},{"language":"default","tag":"Webhooks","count":4},{"language":"default","tag":"Changelog","count":4},{"language":"default","tag":"Changelog Updates","count":4}]},"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":"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":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"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":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"a[href*=\"mintlify.com?utm_campaign=poweredBy\"]{display:none!important}"}],"page":{"pagePath":"guides/office/create-document","slug":"/guides/office/create-document","pageMetadata":{"title":"Create a Document","description":"Learn how to create a document in Essal Office via the API, set permissions, and upload attachments.","href":"/guides/office/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: \"Learn how to create a document in Essal Office via the API, set permissions, and upload attachments.\"\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`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Essal Office allows you to create and manage documents programmatically. This guide walks through creating a new document, setting its initial permissions, and attaching a file.`}),`\n`,_jsx(Heading,{level:`2`,id:`creating-a-document`,children:`Creating a Document`}),`\n`,_jsxs(_components.p,{children:[`Send a `,_jsx(_components.code,{children:`POST`}),` request to the documents endpoint with a title and optional initial content:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.essal.cloud/v1/office/documents`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: esk_live_xxxxxxxxxxxxxxxxxxxx\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"title\": \"Q4 Planning Notes\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"\u003ch1>Q4 Planning\u003c/h1>\u003cp>Initial draft.\u003c/p>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content_type\": \"html\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`A successful response returns the full document object:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"doc_01HXYZABC\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"title\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Q4 Planning Notes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"draft\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"owner_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"usr_01HXYZ1234\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-07-10T09:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"updated_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-07-10T09:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"permissions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"visibility\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"private\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"editors\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"viewers\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: []`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`setting-permissions`,children:`Setting Permissions`}),`\n`,_jsx(_components.p,{children:`By default, a new document is private to the creator. Grant access to other users or groups:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`PATCH`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.essal.cloud/v1/office/documents/doc_01HXYZABC/permissions`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"visibility\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"workspace\",`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"editors\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"usr_01HXYZ5678\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` \"viewers\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"grp_01HXYZGRP1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Permission Level`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`private`})}),_jsx(_components.td,{children:`Only the owner can view and edit`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`workspace`})}),_jsx(_components.td,{children:`All workspace members can view`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`shared`})}),_jsxs(_components.td,{children:[`Specific users and groups listed in `,_jsx(_components.code,{children:`editors`}),`/`,_jsx(_components.code,{children:`viewers`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`public`})}),_jsx(_components.td,{children:`Anyone with the link can view`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`uploading-attachments`,children:`Uploading Attachments`}),`\n`,_jsx(_components.p,{children:`Attach files to a document by first uploading to the Office file store, then linking:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Step 1: Upload the file`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` /v1/office/files`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Content-Type:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` multipart/form-data`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`file`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`@/path/to/report.pdf`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Response`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"fil_01HXYZFIL1\",`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\":`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"report.pdf\",`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"size_bytes\":`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 204800`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Step 2: Attach to document`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` /v1/office/documents/doc_01HXYZABC/attachments`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`\"file_id\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"fil_01HXYZFIL1\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})]}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Documents support up to 50 attachments and a maximum single file size of 100 MB. For larger files, use the chunked upload endpoint at `,_jsx(_components.code,{children:`/v1/office/files/upload/chunked`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`publishing-a-document`,children:`Publishing a Document`}),`\n`,_jsxs(_components.p,{children:[`Move a document from `,_jsx(_components.code,{children:`draft`}),` to `,_jsx(_components.code,{children:`published`}),` status to make it available to permitted viewers:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` /v1/office/documents/doc_01HXYZABC/publish`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The document status transitions to `,_jsx(_components.code,{children:`published`}),` and a `,_jsx(_components.code,{children:`office.document.published`}),` event fires on the event bus.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create a Document","description":"Learn how to create a document in Essal Office via the API, set permissions, and upload attachments.","href":"/guides/office/create-document"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Creating a Document","slug":"creating-a-document","depth":2,"children":[]},{"title":"Setting Permissions","slug":"setting-permissions","depth":2,"children":[]},{"title":"Uploading Attachments","slug":"uploading-attachments","depth":2,"children":[]},{"title":"Publishing a Document","slug":"publishing-a-document","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"essal","siteName":"Essal Developer Docs","title":"Create a Document - Essal Developer Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-12T12:05:45.247Z","originalFileLocation":"guides/office/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=\"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=\"Learn how to create a document in Essal Office via the API, set permissions, and upload attachments.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Essal 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/essal/hV1lHJlq_XIJhUPP/_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/essal/hV1lHJlq_XIJhUPP/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/essal/hV1lHJlq_XIJhUPP/_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/essal/hV1lHJlq_XIJhUPP/_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/essal/hV1lHJlq_XIJhUPP/_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/essal/hV1lHJlq_XIJhUPP/_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/essal/hV1lHJlq_XIJhUPP/_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/essal/hV1lHJlq_XIJhUPP/_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/essal/hV1lHJlq_XIJhUPP/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a Document - Essal Developer Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn how to create a document in Essal Office via the API, set permissions, and upload attachments.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Essal Developer Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developers.essal.cloud/guides/office/create-document\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://essal.mintlify.app/_mintlify/api/og/v2?division=App+Guides+%E2%80%94+Office\u0026amp;title=Create+a+Document\u0026amp;description=Learn+how+to+create+a+document+in+Essal+Office+via+the+API%2C+set+permissions%2C+and+upload+attachments.\u0026amp;theme=d5c245af879c7f969a007e7d\u0026amp;signature=9a732bcbf49db05341667aaeebd550adc639643ca6e6db5b5e263cdf1c4fe946\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create a Document - Essal Developer Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn how to create a document in Essal Office via the API, set permissions, and upload attachments.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://essal.mintlify.app/_mintlify/api/og/v2?division=App+Guides+%E2%80%94+Office\u0026amp;title=Create+a+Document\u0026amp;description=Learn+how+to+create+a+document+in+Essal+Office+via+the+API%2C+set+permissions%2C+and+upload+attachments.\u0026amp;theme=d5c245af879c7f969a007e7d\u0026amp;signature=9a732bcbf49db05341667aaeebd550adc639643ca6e6db5b5e263cdf1c4fe946\">\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/essal/hV1lHJlq_XIJhUPP/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Essal Developer Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0066FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developers.essal.cloud/guides/office/create-document\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/office/create-document.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developers.essal.cloud/#organization\",\"name\":\"Essal Developer Docs\",\"url\":\"https://developers.essal.cloud\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/essal/5qVV5p4Y6tAbM76k/logo/logo.svg?fit=max\u0026auto=format\u0026n=5qVV5p4Y6tAbM76k\u0026q=85\u0026s=706e0f6b7817c8a2af008f21830be42b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developers.essal.cloud#website\",\"name\":\"Essal Developer Docs\",\"url\":\"https://developers.essal.cloud\",\"publisher\":{\"@id\":\"https://developers.essal.cloud/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developers.essal.cloud/guides/office/create-document#webpage\",\"url\":\"https://developers.essal.cloud/guides/office/create-document\",\"name\":\"Create a Document\",\"description\":\"Learn how to create a document in Essal Office via the API, set permissions, and upload attachments.\",\"dateModified\":\"2026-07-12T12:05:45.247Z\",\"isPartOf\":{\"@id\":\"https://developers.essal.cloud#website\"},\"breadcrumb\":{\"@id\":\"https://developers.essal.cloud/guides/office/create-document#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developers.essal.cloud/guides/office/create-document#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Essal Developer Docs\",\"item\":\"https://developers.essal.cloud\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a Document\",\"item\":\"https://developers.essal.cloud/guides/office/create-document\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://developers.essal.cloud/guides/office/create-document#article\",\"headline\":\"Create a Document\",\"name\":\"Create a Document\",\"description\":\"Learn how to create a document in Essal Office via the API, set permissions, and upload attachments.\",\"url\":\"https://developers.essal.cloud/guides/office/create-document\",\"mainEntityOfPage\":{\"@id\":\"https://developers.essal.cloud/guides/office/create-document#webpage\"},\"dateModified\":\"2026-07-12T12:05:45.247Z\",\"publisher\":{\"@id\":\"https://developers.essal.cloud/#organization\"},\"isPartOf\":{\"@id\":\"https://developers.essal.cloud#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Essal Developer Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Essal Developer Docs","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":"/introduction"},{"title":"Quickstart","href":"/getting-started/quickstart"},{"title":"Authentication","href":"/getting-started/authentication"},{"title":"Environments","href":"/getting-started/environments"},{"title":"Rate Limits","href":"/getting-started/rate-limits"}]},{"group":"Platform Concepts","pages":[{"title":"Workspaces","href":"/concepts/workspace"},{"title":"Apps","href":"/concepts/apps"},{"title":"Users \u0026 Roles","href":"/concepts/users-and-roles"},{"title":"Organizations","href":"/concepts/organizations"},{"title":"Data Model","href":"/concepts/data-model"},{"title":"Events","description":"Understand Essal's async event system — how app-level events are produced, routed, and consumed via webhooks.","href":"/concepts/events"}]},{"group":"App Guides — Office","pages":[{"title":"Create a Document","href":"/guides/office/create-document"},{"title":"Collaborate in Real Time","description":"Understand how Essal Office handles real-time collaborative editing, presence awareness, and conflict resolution.","href":"/guides/office/collaborate-in-real-time"},{"title":"Export Formats","href":"/guides/office/export-formats"}]},{"group":"App Guides — Access","pages":[{"title":"Set Up SSO","href":"/guides/access/setup-sso"},{"title":"Provision Users","href":"/guides/access/provision-users"},{"title":"Manage Directories","href":"/guides/access/manage-directories"}]},{"group":"App Guides — Sales","pages":[{"title":"Import Contacts","href":"/guides/sales/import-contacts"},{"title":"Manage Pipeline","href":"/guides/sales/manage-pipeline"},{"title":"Track Deals","href":"/guides/sales/track-deals"}]},{"group":"App Guides — Careers","pages":[{"title":"Post a Job","href":"/guides/careers/post-job"},{"title":"Review Applicants","href":"/guides/careers/review-applicants"},{"title":"Manage Hiring Pipeline","href":"/guides/careers/manage-pipeline"}]},{"group":"App Guides — Project","pages":[{"title":"Create a Project","href":"/guides/project/create-project"},{"title":"Manage Tasks","href":"/guides/project/manage-tasks"},{"title":"Track Time","href":"/guides/project/track-time"}]},{"group":"App Guides — Guard","pages":[{"title":"Configure Policies","href":"/guides/guard/configure-policies"},{"title":"View Audit Trail","href":"/guides/guard/view-audit-trail"},{"title":"Threat Alerts","href":"/guides/guard/threat-alerts"}]},{"group":"Integrations","pages":[{"title":"Integrations Overview","href":"/integrations/overview"},{"title":"Webhooks","href":"/integrations/webhooks"},{"title":"OAuth Apps","href":"/integrations/oauth-apps"},{"title":"SSO / SAML","href":"/integrations/sso-saml"},{"title":"Third-Party Integrations","href":"/integrations/third-party"}]},{"group":"Security \u0026 Compliance","pages":[{"title":"Data Privacy","href":"/security/data-privacy"},{"title":"Encryption","href":"/security/encryption"},{"title":"Audit Logs","href":"/security/audit-logs"},{"title":"IP Allowlisting","href":"/security/ip-allowlisting"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/overview"}]},{"tab":"SDKs \u0026 Tools","pages":[{"title":"SDKs \u0026 Tools","href":"/sdks/overview"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/2026-07-01"}]},{"tab":"Support","pages":[{"title":"Support","href":"/support/status"}]}]},"basePath":"","title":"Create a Document - Essal Developer Docs","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":[],"chunks":[]}