Using AODocs APIs, you can modify the document resource using the PATCH operation. You can modify attachments as well as system and custom fields. To modify the list of document attachments (i.e. references to Drive files), use PATCH to replace/overwrite the attachments[] array field of the target resource.
In general, modifying is perfectly benign. However, things carry extra risk with any parts of the resource arranged in arrays. Using the attachments array field in DMS documents, is one example; however, the caution extends to any request containing array fields.There are two cases to consider:
array field not included in request: corresponding target array does not get modified on the server
array field included in request (including empty!): completely overwrites target array field with whatever is in the square brackets in the order provided:
object specified in array position n: object placed in target array at position n
object not specified: object is removed from target array
Warning/Alert:The list of objects you specify in your array field in the order you specify completely replaces whatever currently exists in the corresponding resource array on the server.If you include an empty array field in your payload (without specifying any objects), you are saying to the server “I want this complete array field to be(come) empty.” For example, if you use the attachments array field with DMS documents, the result is a target DMS document with no attachments.(The one-attachment restriction in TF/SF prevents this possibility; however this still applies for other types of array field.)Additionally, if you want any of the current objects to remain in the array field (as you alter it), you have to specify them each time inside the array field in your request, including their current position). For example, if you use the attachments array field with DMS documents, then you have to deliberately send the complete list of what you want the array to contain from then on, in the order you want.(Missteps such as accidental detaching or re-ordering of attachments are not possible with TF/SF documents because you only ever modify the one attachment.)
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"AO Docs Documentation","colors":{"primary":"#006CB2","light":"#4CA5E7","dark":"#006CB2"},"logo":{"light":"https://mintcdn.com/aodocs/ln9-UK7vfqtB6Ctx/logo/light.svg?fit=max\u0026auto=format\u0026n=ln9-UK7vfqtB6Ctx\u0026q=85\u0026s=c418895665a6cfafbf4d17e675f7c276","dark":"https://mintcdn.com/aodocs/ln9-UK7vfqtB6Ctx/logo/dark.svg?fit=max\u0026auto=format\u0026n=ln9-UK7vfqtB6Ctx\u0026q=85\u0026s=819218ba54186566d25d26d5ea329e61","href":"https://www.aodocs.com"},"favicon":"https://mintcdn.com/aodocs/ln9-UK7vfqtB6Ctx/favicon.svg?fit=max\u0026auto=format\u0026n=ln9-UK7vfqtB6Ctx\u0026q=85\u0026s=d0bf037dce435927befb8332e856c7e0","appearance":{"default":"dark"},"navbar":{"links":[{"href":"https://www.aodocs.com/contact/","label":"Contact us"}]},"footer":{"socials":{"youtube":"https://www.youtube.com/channel/UC4BSPzADc9QXoh29SAsn3Cg","linkedin":"https://www.linkedin.com/company/altirnao"}},"fonts":{"heading":{"family":"Roboto"},"body":{"family":"Roboto"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"About","icon":"users","href":"https://www.aodocs.com/company/"},{"anchor":"Blog","icon":"newspaper","href":"https://www.aodocs.com/blog/"},{"anchor":"Status","icon":"signal","href":"https://status.aodocs.com/?__hstc=7523757.3689b6b59ff0c12fcac6aa9719dd6032.1586143551842.1586316583659.1586321455157.16\u0026__hssc=7523757.35.1586321455157\u0026__hsfp=209583371"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"aodocs","hasAudioNarration":false,"actualSubdomain":"aodocs","customDomains":["api.aodocs.com"],"gitSource":{"type":"github","owner":"aodocs-dev","repo":"api-documentation","deployBranch":"master","contentDirectory":"mintlify-docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae47214e2abcaa039f9d99f","collectionId":"69dc0f62-6149-498d-9fa5-0867efc438af","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae47214e2abcaa039f9d99f"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae8551bf0ba2d6fcd93ea8c","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"Core API Reference","count":357},{"language":"default","tag":"AI API Reference","count":83},{"language":"default","tag":"AIDA API Reference","count":80},{"language":"default","tag":"library","count":69},{"language":"default","tag":"Library","count":64},{"language":"default","tag":"Document ID","count":43},{"language":"default","tag":"Domain","count":42},{"language":"default","tag":"documentId","count":42},{"language":"default","tag":"domain","count":39},{"language":"default","tag":"Guides","count":37}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"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":true},"customCss":[],"page":{"pagePath":"manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments","slug":"/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments","pageMetadata":{"title":"Modify document attachments","sidebarTitle":"Overview","description":"Using AODocs APIs, you can modify the document resource using the `PATCH` operation. You can modify attachments as well as [system and custom fields](/manage-aodocs-documents/create-modify-delete-documents/modify-field-values-of-document-properties/). To modify the list of document attachments (i.e. references to Drive files), use `PATCH` to replace/overwrite the `attachments[]` array field of the target resource.","href":"/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Using AODocs APIs, you can modify the document resource using the \", _jsx(_components.code, {\n children: \"PATCH\"\n }), \" operation. You can modify attachments as well as \", _jsx(_components.a, {\n href: \"/manage-aodocs-documents/create-modify-delete-documents/modify-field-values-of-document-properties/\",\n children: \"system and custom fields\"\n }), \". To modify the list of document attachments (i.e. references to Drive files), use \", _jsx(_components.code, {\n children: \"PATCH\"\n }), \" to replace/overwrite the \", _jsx(_components.code, {\n children: \"attachments[]\"\n }), \" array field of the target resource.\"]\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`,em:`em`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Warning}=_components;if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`In general, modifying is perfectly benign. However, things carry extra risk with any parts of the resource arranged in arrays. Using the `,_jsx(_components.code,{children:`attachments`}),` array field in DMS documents, is one example; however, the caution extends to any request containing array fields.`]}),`\n`,_jsx(_components.p,{children:`There are two cases to consider:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`array field not included in request: corresponding target array does not get modified on the server`}),`\n`,_jsxs(_components.li,{children:[`array field included in request (including empty!): completely overwrites target array field with whatever is in the square brackets in the order provided:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`object specified in array position `,_jsx(_components.em,{children:`n`}),`: object placed in target array at position `,_jsx(_components.em,{children:`n`})]}),`\n`,_jsx(_components.li,{children:`object not specified: object is removed from target array`}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsxs(Warning,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Warning/Alert`}),`:`]}),_jsx(_components.p,{children:`The list of objects you specify in your array field in the order you specify completely replaces whatever currently exists in the corresponding resource array on the server.`}),_jsxs(_components.p,{children:[`If you include an empty array field in your payload (without specifying any objects), you are saying to the server “I want this complete array field to be(come) empty.” For example, if you use the `,_jsx(_components.code,{children:`attachments`}),` array field with DMS documents, the result is a target DMS document with no attachments.`]}),_jsx(_components.p,{children:`(The one-attachment restriction in TF/SF prevents this possibility; however this still applies for other types of array field.)`}),_jsxs(_components.p,{children:[`Additionally, if you want any of the current objects to remain in the array field (as you alter it), you have to specify them each time inside the array field in your request, including their current position). For example, if you use the `,_jsx(_components.code,{children:`attachments`}),` array field with DMS documents, then you have to deliberately send the complete list of what you want the array to contain from then on, `,_jsx(_components.strong,{children:`in the order you want`}),`.`]}),_jsx(_components.p,{children:`(Missteps such as accidental detaching or re-ordering of attachments are not possible with TF/SF documents because you only ever modify the one attachment.)`})]})]})}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":"Modify document attachments","sidebarTitle":"Overview","description":"Using AODocs APIs, you can modify the document resource using the `PATCH` operation. You can modify attachments as well as [system and custom fields](/manage-aodocs-documents/create-modify-delete-documents/modify-field-values-of-document-properties/). To modify the list of document attachments (i.e. references to Drive files), use `PATCH` to replace/overwrite the `attachments[]` array field of the target resource.","href":"/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"subdomain":"aodocs","siteName":"AO Docs Documentation","title":"Modify document attachments - AO Docs Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-02-03T11:08:24.914Z","originalFileLocation":"manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments.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=\"dark\"}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=\"Using AODocs APIs, you can modify the document resource using the PATCH operation. You can modify attachments as well as system and custom fields. To modify the list of document attachments (i.e. references to Drive files), use PATCH to replace/overwrite the attachments[] array field of the target resource.\">\u003cmeta data-mint-head name=\"application-name\" content=\"AO Docs Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/aodocs/0jcxC6UtFTOe8Ch1/_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/aodocs/0jcxC6UtFTOe8Ch1/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/aodocs/0jcxC6UtFTOe8Ch1/_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/aodocs/0jcxC6UtFTOe8Ch1/_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/aodocs/0jcxC6UtFTOe8Ch1/_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/aodocs/0jcxC6UtFTOe8Ch1/_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/aodocs/0jcxC6UtFTOe8Ch1/_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/aodocs/0jcxC6UtFTOe8Ch1/_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/aodocs/0jcxC6UtFTOe8Ch1/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Modify document attachments - AO Docs Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Using AODocs APIs, you can modify the document resource using the PATCH operation. You can modify attachments as well as system and custom fields. To modify the list of document attachments (i.e. references to Drive files), use PATCH to replace/overwrite the attachments[] array field of the target resource.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"AO Docs Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://aodocs.mintlify.app/_mintlify/api/og/v2?division=Modify+document+attachments\u0026amp;title=Modify+document+attachments\u0026amp;description=Using+AODocs+APIs%2C+you+can+modify+the+document+resource+using+the+%60PATCH%60+operation.+You+can+modify+attachments+as+well+as+%5Bsystem+and+custom+fields%5D%28%2Fmanage-ao\u0026amp;theme=458f498de6859a4d05c4c954\u0026amp;signature=08e894c50233533d3c691f50b34f868867912d04fce9a171d259099eab4283da\">\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=\"Modify document attachments - AO Docs Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Using AODocs APIs, you can modify the document resource using the PATCH operation. You can modify attachments as well as system and custom fields. To modify the list of document attachments (i.e. references to Drive files), use PATCH to replace/overwrite the attachments[] array field of the target resource.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://aodocs.mintlify.app/_mintlify/api/og/v2?division=Modify+document+attachments\u0026amp;title=Modify+document+attachments\u0026amp;description=Using+AODocs+APIs%2C+you+can+modify+the+document+resource+using+the+%60PATCH%60+operation.+You+can+modify+attachments+as+well+as+%5Bsystem+and+custom+fields%5D%28%2Fmanage-ao\u0026amp;theme=458f498de6859a4d05c4c954\u0026amp;signature=08e894c50233533d3c691f50b34f868867912d04fce9a171d259099eab4283da\">\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/aodocs/0jcxC6UtFTOe8Ch1/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"AO Docs Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#006CB2\">\u003clink data-mint-head rel=\"canonical\" href=\"https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://api.aodocs.com/#organization\",\"name\":\"AO Docs Documentation\",\"url\":\"https://api.aodocs.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/aodocs/ln9-UK7vfqtB6Ctx/logo/light.svg?fit=max\u0026auto=format\u0026n=ln9-UK7vfqtB6Ctx\u0026q=85\u0026s=c418895665a6cfafbf4d17e675f7c276\"}},{\"@type\":\"WebSite\",\"@id\":\"https://api.aodocs.com#website\",\"name\":\"AO Docs Documentation\",\"url\":\"https://api.aodocs.com\",\"publisher\":{\"@id\":\"https://api.aodocs.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments#webpage\",\"url\":\"https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments\",\"name\":\"Modify document attachments\",\"description\":\"Using AODocs APIs, you can modify the document resource using the PATCH operation. You can modify attachments as well as system and custom fields. To modify the list of document attachments (i.e. references to Drive files), use PATCH to replace/overwrite the attachments[] array field of the target resource.\",\"dateModified\":\"2026-02-03T11:08:24.914Z\",\"isPartOf\":{\"@id\":\"https://api.aodocs.com#website\"},\"breadcrumb\":{\"@id\":\"https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Manage AODocs documents\",\"item\":\"https://api.aodocs.com/manage-aodocs-documents\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create, modify, delete documents\",\"item\":\"https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Modify document attachments\",\"item\":\"https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments#article\",\"headline\":\"Modify document attachments\",\"name\":\"Modify document attachments\",\"description\":\"Using AODocs APIs, you can modify the document resource using the PATCH operation. You can modify attachments as well as system and custom fields. To modify the list of document attachments (i.e. references to Drive files), use PATCH to replace/overwrite the attachments[] array field of the target resource.\",\"url\":\"https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments\",\"mainEntityOfPage\":{\"@id\":\"https://api.aodocs.com/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments#webpage\"},\"dateModified\":\"2026-02-03T11:08:24.914Z\",\"publisher\":{\"@id\":\"https://api.aodocs.com/#organization\"},\"isPartOf\":{\"@id\":\"https://api.aodocs.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"AO Docs Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"AO Docs Documentation","nav":{"global":{"anchors":[{"anchor":"About","icon":"users","href":"https://www.aodocs.com/company/"},{"anchor":"Blog","icon":"newspaper","href":"https://www.aodocs.com/blog/"},{"anchor":"Status","icon":"signal","href":"https://status.aodocs.com/?__hstc=7523757.3689b6b59ff0c12fcac6aa9719dd6032.1586143551842.1586316583659.1586321455157.16\u0026__hssc=7523757.35.1586321455157\u0026__hsfp=209583371"}]},"tabs":[{"tab":"Home","icon":"home","pages":[{"title":"Home","href":""}]},{"tab":"Guides","icon":"book-open","groups":[{"group":" ","pages":[{"title":"Getting started","icon":"book-open","href":"/getting-started"}]},{"group":"Key concepts","icon":"book","pages":[{"title":"Key concepts","sidebarTitle":"Overview","href":"/key-concepts"},{"title":"Basics of AODocs","href":"/key-concepts/basics-of-aodocs"},{"title":"Basics of AODocs APIs","href":"/key-concepts/basics-of-aodocs-apis"}]},{"group":"Authentication","icon":"key","pages":[{"title":"Authentication","sidebarTitle":"Overview","href":"/authentication"},{"title":"Access APIs with security codes","href":"/authentication/access-apis-with-security-codes"},{"title":"Access APIs with Bearer tokens","href":"/authentication/access-apis-with-bearer-tokens"},{"title":"Authentication use case examples/options/flows","href":"/authentication/sample-use-cases"},{"title":"In-depth: OAuth implementation RFCs and BCPs","href":"/authentication/auth-appendix"}]},{"group":"Manage AODocs documents","icon":"file","pages":[{"title":"Manage AODocs documents","sidebarTitle":"Overview","href":"/manage-aodocs-documents"},{"group":"Get library and class info","pages":[{"title":"Get library and class info","sidebarTitle":"Overview","href":"/manage-aodocs-documents/get-library-and-class-info"},{"group":"Get library info","pages":[{"title":"Get library info","sidebarTitle":"Overview","href":"/manage-aodocs-documents/get-library-and-class-info/get-library-info"},{"title":"List libraries and find target library ID for your documents (legacy v1)","api":"PUT https://aodocs.altirnao.com/api/library/v1","href":"/manage-aodocs-documents/get-library-and-class-info/list-libraries-and-find-target-library-id-for-your-documents"},{"title":"List and search libraries (v2beta1)","api":"GET https://aodocs.altirnao.com/api/search/v2beta1/search","href":"/manage-aodocs-documents/get-library-and-class-info/list-and-search-libraries"},{"title":"List libraries plain (alternative to List libraries)","api":"PUT https://aodocs.altirnao.com/api/library/v1/plain","href":"/manage-aodocs-documents/get-library-and-class-info/list-libraries-plain"},{"title":"Get a specific library by ID","api":"GET https://aodocs.altirnao.com/api/library/{libId}","href":"/manage-aodocs-documents/get-library-and-class-info/get-a-specific-library-by-id"}]},{"group":"Get document class info","pages":[{"title":"Get document class info","sidebarTitle":"Overview","href":"/manage-aodocs-documents/get-library-and-class-info/get-document-class-info"},{"title":"List classes (to find target classes for your documents)","api":"GET https://aodocs.altirnao.com/api/documentType/v1/libraries/{libraryId}","href":"/manage-aodocs-documents/get-library-and-class-info/list-classes"},{"title":"Get a specific class by ID","api":"GET https://aodocs.altirnao.com/api/documentType/v1/libraries/{libId}/documentTypes/{documentTypeId}","href":"/manage-aodocs-documents/get-library-and-class-info/get-a-specific-class-by-id"}]}]},{"group":"Create, modify, delete documents","pages":[{"title":"Create, modify, delete documents","sidebarTitle":"Overview","href":"/manage-aodocs-documents/create-modify-delete-documents"},{"group":"Creating new AODocs documents","pages":[{"title":"Creating new AODocs documents","sidebarTitle":"Overview","href":"/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments"},{"title":"Before creating AODocs documents: Create test Drive folder and files","href":"/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments/create-test-drive-files-and-folders"},{"group":"Create new document and attach Drive file","pages":[{"title":"Create new document and attach Drive file","sidebarTitle":"Overview","href":"/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments/create-new-document-and-attach-drive-file"},{"title":"Create new document and attach Drive file","api":"PUT https://aodocs.altirnao.com/api/document/v1","href":"/manage-aodocs-documents/create-modify-delete-documents/create-new-documents-with-attachments/create-new-document"}]}]},{"title":"Modify field values of document properties","description":"AODocs documents are composed of metadata, including (but not limited to) system and custom properties defined as part of a specific document type (also known as class).","href":"/manage-aodocs-documents/create-modify-delete-documents/modify-field-values-of-document-properties"},{"group":"Modify document attachments","pages":[{"title":"Modify document attachments","sidebarTitle":"Overview","href":"/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachments"},{"title":"Modify document attachments","api":"PATCH https://aodocs.altirnao.com/api/document/v1/{documentId}","description":null,"href":"/manage-aodocs-documents/create-modify-delete-documents/modify-document-attachment"}]},{"group":"List and search documents","pages":[{"title":"List and search documents","sidebarTitle":"Overview","href":"/manage-aodocs-documents/create-modify-delete-documents/list-search-and-count-documents"},{"title":"Get specific document by ID","api":"GET https://aodocs.altirnao.com/api/document/v1/{documentId}","href":"/manage-aodocs-documents/create-modify-delete-documents/get-specific-document-by-id"},{"title":"List documents of a library","api":"POST https://aodocs.altirnao.com/api/search/v1/libraries/{libraryId}/list","href":"/manage-aodocs-documents/create-modify-delete-documents/list-documents-of-a-library"},{"title":"Count documents of a library","api":"POST https://aodocs.altirnao.com/api/search/v1/libraries/{libraryId}/count","href":"/manage-aodocs-documents/create-modify-delete-documents/count-documents-of-a-library"},{"title":"Search documents of a class","api":"POST https://aodocs.altirnao.com/api/search/v1/libraries/{libraryId}/search","href":"/manage-aodocs-documents/create-modify-delete-documents/search-documents-of-a-class"}]},{"title":"Delete a specific document by ID","api":"DELETE https://aodocs.altirnao.com/api/document/v1/{documentId}","href":"/manage-aodocs-documents/create-modify-delete-documents/delete-document"}]}]},{"group":"Best Practices","icon":"check","pages":[{"title":"Best practices","sidebarTitle":"Overview","href":"/best-practices"},{"title":"HTTP status codes and error handling","href":"/best-practices/http-status-codes-and-error-handling"},{"title":"Performance considerations","href":"/best-practices/performance-considerations"}]},{"group":" ","pages":[{"title":"About API resources","icon":"question","href":"/about-api-resources"}]}]},{"tab":"Core API Reference","icon":"code-simple","pages":[{"title":"Core API Reference","href":"/api-reference/introduction"}]},{"tab":"AI API Reference","icon":"code-simple","pages":[{"title":"AI API Reference","href":"/aida-api/introduction"}]}]},"basePath":"","title":"Modify document attachments - AO Docs Documentation","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":[],"chunks":[]}