Create or update up to 50 files in one versioned batch.
The batch is validated first. Files with user errors are skipped and reported in user_errors; valid files are written atomically and recorded as ONE version (author agent:<key name>). A batch in which every file failed writes nothing and returns version_id: null. Send checksum_before for every existing file you edit — a mismatch returns CONFLICT for that file instead of overwriting a newer change.
PUT
/
themes
/
{theme_id}
/
files
Create or update up to 50 files in one versioned batch.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"PlatformDTC","description":"Build agent-native commerce. The PlatformDTC Agent Gateway lets autonomous agents (OpenClaw and others) run every capability of your store — build, catalog, ads, marketing, analytics, orders — over one scoped, idempotent, job-aware API.","colors":{"primary":"#111111","light":"#111111","dark":"#e5e5e5"},"logo":{"light":"/assets/logo.svg","dark":"/assets/logo-dark.svg"},"favicon":"/assets/logo.svg","appearance":{"default":"light","strict":false},"background":{"color":{"light":"#ffffff","dark":"#0b0b0c"}},"navbar":{"links":[{"icon":"layout-dashboard","href":"https://platformdtc.com/agents/connect","label":"Dashboard"},{"icon":"newspaper","href":"https://platformdtc.com/blog","label":"Blog"},{"icon":"activity","href":"https://status.platformdtc.com","label":"Status"}],"primary":{"type":"button","label":"Get an API key","href":"https://platformdtc.com/agents/access/api-keys"}},"footer":{"socials":{"x":"https://x.com/platformdtc","linkedin":"https://www.linkedin.com/company/platformdtc"}},"fonts":{"heading":{"family":"Inter","weight":500},"body":{"family":"Inter"}},"icons":{"library":"lucide"},"styling":{"codeblocks":{"theme":{"light":"github-dark","dark":"github-dark"}}},"integrations":{"telemetry":{"enabled":false}},"navigation":{"languages":[{"language":"en","href":""}]}},"deployment":{"deploymentMetadataValue":{"hasAudioNarration":false,"customDomains":[],"gitSource":{"type":"github","owner":"local","repo":"local","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"local","isBase":true},"buildId":"local","clientVersion":"0.0.4044"},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false,"isLoggedInCli":false,"mintExport":{}},"customCss":[{"filePath":"style.css","content":":root{--dtc-mono:\"JetBrains Mono\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo,\n Consolas, monospace;--dtc-border:rgba(17, 17, 17, 0.08);--dtc-muted:#6a737d}.dark{--dtc-border:rgba(255, 255, 255, 0.1);--dtc-muted:#9aa4af}html{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}h1{letter-spacing:-.02em;font-weight:600}h2,h3{letter-spacing:-.015em}main article{max-width:46rem}#sidebar a,nav#sidebar a{font-size:.875rem;line-height:1.5}#sidebar .group-label,#sidebar [class*=uppercase]{font-size:.6875rem;letter-spacing:.08em;color:var(--dtc-muted)}#table-of-contents a,[id*=toc] a{color:var(--dtc-muted);font-size:.8125rem}code,pre,pre code{font-family:var(--dtc-mono);font-size:.85em}.prose pre,pre{border:1px solid var(--dtc-border);border-radius:10px}:not(pre)>code{background:rgba(17,17,17,.05);border:1px solid var(--dtc-border);border-radius:5px;padding:.1em .35em;font-weight:450}.dark :not(pre)>code{background:rgba(255,255,255,.06)}.card,a[class*=card]{border:1px solid var(--dtc-border);border-radius:12px;transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease}.card:hover,a[class*=card]:hover{transform:translateY(-2px);border-color:rgba(17,17,17,.16);box-shadow:0 6px 24px rgba(17,17,17,.06)}.dark .card:hover,.dark a[class*=card]:hover{border-color:rgba(255,255,255,.2);box-shadow:0 6px 24px rgba(0,0,0,.4)}#content-area:has(#dtc-hero) #header{display:none!important}#dtc-hero{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:44px;align-items:center;background:#f9f8f6;border:1px solid rgba(17,17,17,.06);border-radius:24px;padding:40px;margin:4px 0 8px}.dark #dtc-hero{background:#111214;border-color:rgba(255,255,255,.08)}@media (max-width:900px){#dtc-hero{grid-template-columns:1fr;gap:28px;padding:28px}}.dtc-hero-eyebrow{margin:0 0 14px;font-size:.8125rem;font-weight:600;letter-spacing:.04em;color:var(--dtc-muted)}.dtc-hero-title{margin:0 0 16px;font-size:44px;line-height:1.1;font-weight:500;letter-spacing:-.88px;color:#0a0a0a;hyphens:none;overflow-wrap:normal;word-break:keep-all;text-wrap:balance}.dark .dtc-hero-title{color:#f5f5f5}@media (max-width:600px){.dtc-hero-title{font-size:36px;letter-spacing:-.7px}}.dtc-hero-sub{margin:0 0 28px;font-size:1.0625rem;line-height:1.6;color:#4a5056;max-width:30rem}.dark .dtc-hero-sub{color:#b3b9c0}.dtc-hero-actions{display:flex;gap:12px;flex-wrap:wrap}.dtc-btn{display:inline-flex;align-items:center;height:44px;padding:0 20px;border-radius:9999px;font-size:14px;font-weight:500;text-decoration:none!important;transition:transform .12s ease,opacity .12s ease,background .12s ease}.dtc-btn:hover{transform:translateY(-1px)}.dtc-btn-primary{background:#0a0a0a;color:#f9f8f6!important}.dtc-btn-primary:hover{background:#232323}.dark .dtc-btn-primary{background:#f5f5f5;color:#0a0a0a!important}.dtc-btn-secondary{background:0 0;border:1px solid rgba(10,10,10,.15)}.dtc-btn-secondary:hover{background:rgba(10,10,10,.04)}.dark .dtc-btn-secondary{color:#f5f5f5!important;border-color:rgba(255,255,255,.18)}#dtc-hero .dtc-hero-code{min-width:0}#dtc-hero .dtc-hero-code pre,#dtc-hero .dtc-hero-code>div{margin:0!important}#dtc-hero .dtc-hero-code pre{border-radius:12px;min-height:168px}a[href$=\"/agents/access/api-keys\"]{background:#0a0a0a!important;color:#f9f8f6!important;border-radius:9999px!important}a[href$=\"/agents/access/api-keys\"]:hover{background:#232323!important}a[href$=\"/agents/access/api-keys\"] *{color:#f9f8f6!important}.dark a[href$=\"/agents/access/api-keys\"]{background:#f5f5f5!important;color:#0a0a0a!important}.dark a[href$=\"/agents/access/api-keys\"] *,.dtc-btn-secondary{color:#0a0a0a!important}a[href$=\"/agents/access/api-keys\"]>*{background:0 0!important;border-color:transparent!important}"}],"page":{"pagePath":"api-reference/themes/create-or-update-up-to-50-files-in-one-versioned-batch","slug":"/api-reference/themes/create-or-update-up-to-50-files-in-one-versioned-batch","pageMetadata":{"openapi":"/agent-gateway.v1.yaml put /themes/{theme_id}/files","description":"The batch is validated first. Files with user errors are skipped and reported in `user_errors`; valid files are written atomically and recorded as ONE version (author `agent:\u003ckey name>`). A batch in which every file failed writes nothing and returns `version_id: null`. Send `checksum_before` for every existing file you edit — a mismatch returns `CONFLICT` for that file instead of overwriting a newer change.\n","href":"/api-reference/themes/create-or-update-up-to-50-files-in-one-versioned-batch","title":"Create or update up to 50 files in one versioned batch."},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"The batch is validated first. Files with user errors are skipped and reported in \", _jsx(_components.code, {\n children: \"user_errors\"\n }), \"; valid files are written atomically and recorded as ONE version (author \", _jsx(_components.code, {\n children: \"agent:\u003ckey name>\"\n }), \"). A batch in which every file failed writes nothing and returns \", _jsx(_components.code, {\n children: \"version_id: null\"\n }), \". Send \", _jsx(_components.code, {\n children: \"checksum_before\"\n }), \" for every existing file you edit — a mismatch returns \", _jsx(_components.code, {\n children: \"CONFLICT\"\n }), \" for that file instead of overwriting a newer change.\"]\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-dark","dark":"github-dark"}},"config":{},"pageMetadata":{"openapi":"/agent-gateway.v1.yaml put /themes/{theme_id}/files","description":"The batch is validated first. Files with user errors are skipped and reported in `user_errors`; valid files are written atomically and recorded as ONE version (author `agent:\u003ckey name>`). A batch in which every file failed writes nothing and returns `version_id: null`. Send `checksum_before` for every existing file you edit — a mismatch returns `CONFLICT` for that file instead of overwriting a newer change.\n","href":"/api-reference/themes/create-or-update-up-to-50-files-in-one-versioned-batch","title":"Create or update up to 50 files in one versioned batch."}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"writeThemeFiles","tags":["themes"],"summary":"Create or update up to 50 files in one versioned batch.","description":"The batch is validated first. Files with user errors are skipped and reported in `user_errors`; valid files are written atomically and recorded as ONE version (author `agent:\u003ckey name>`). A batch in which every file failed writes nothing and returns `version_id: null`. Send `checksum_before` for every existing file you edit — a mismatch returns `CONFLICT` for that file instead of overwriting a newer change.\n","security":["b56afd2b-1432-48e8-af1d-d52b127c2817","593d50e6-7e13-4ced-a5bd-44bc04d23a52"],"parameters":["a182e8df-8b7d-4570-bfc5-c25f4ccb4b73","4ddc15dc-982e-41e8-8de6-c49dafac9ef4","8e7ed4a0-9cdd-42e2-8727-f3c04708c86c"],"requestBody":"9d40fef3-b882-4392-81b1-3c99d15813bf","responses":{"200":"e5ff046a-b486-4d12-99b7-47fe78d71276","403":"6e6b76d6-b7cd-4291-841c-9096205d6668","404":"91a89041-e6e3-484a-9362-df210344b1e8","409":"c10d909a-b34c-45a2-89f0-ac6f76f11b91"},"method":"put","type":"path","servers":["92b6d8b8-47f2-4201-8ddd-6ab564303a7b"],"path":"/themes/{theme_id}/files","baseUrlOptions":["https://api.platformdtc.com/api/v1/agent/v1"],"title":"Create or update up to 50 files in one versioned batch.","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"a182e8df-8b7d-4570-bfc5-c25f4ccb4b73":{"name":"theme_id","in":"path","required":true,"schema":{"type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}},"4ddc15dc-982e-41e8-8de6-c49dafac9ef4":{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":200,"isRequired":true,"description":"Unique per logical operation; identical key+body returns the cached response, different body → 409.","uniqueKey":"","typeLabel":"string"},"description":"Unique per logical operation; identical key+body returns the cached response, different body → 409."},"8e7ed4a0-9cdd-42e2-8727-f3c04708c86c":{"name":"X-Store-ID","in":"header","required":false,"schema":{"type":"string","isRequired":false,"description":"Target store; required when the key is bound to multiple stores.","uniqueKey":"","typeLabel":"string"},"description":"Target store; required when the key is bound to multiple stores."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"array","maxItems":50,"items":{"type":"object","required":["path","content"],"properties":{"path":{"type":"string","maxLength":256,"description":"Relative, `/`-separated, no `..`, no leading `/`. Allowed extensions: .json .tsx .ts .css .md .svg .png .jpg .jpeg .webp .gif .woff2 .ico .txt. At most 2 MiB.\n","isRequired":true,"uniqueKey":"files.items.[INDEX].path","typeLabel":"string"},"content":{"type":"string","isRequired":true,"uniqueKey":"files.items.[INDEX].content","typeLabel":"string"},"encoding":{"type":"string","enum":["utf8","base64"],"default":"utf8","uniqueKey":"files.items.[INDEX].encoding","typeLabel":"enum\u003cstring>"},"checksum_before":{"type":"string","description":"The sha256 the caller last read. A mismatch returns `CONFLICT` for this file.","uniqueKey":"files.items.[INDEX].checksum_before","typeLabel":"string"}},"uniqueKey":"files.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"files","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"files":[{"path":"\u003cstring>","content":"\u003cstring>","encoding":"utf8","checksum_before":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"e5ff046a-b486-4d12-99b7-47fe78d71276":{"description":"Batch processed. Per-file failures are in `data.user_errors`; check it even on 200.","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","isRequired":true,"uniqueKey":"success","typeLabel":"boolean"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"data":{"type":"object","required":["upserted","deleted","user_errors","version_id"],"properties":{"upserted":{"type":"array","items":{"type":"object","required":["path","checksum"],"properties":{"path":{"type":"string","isRequired":true,"uniqueKey":"data.upserted.items.[INDEX].path","typeLabel":"string"},"checksum":{"type":"string","isRequired":true,"uniqueKey":"data.upserted.items.[INDEX].checksum","typeLabel":"string"}},"uniqueKey":"data.upserted.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"data.upserted","typeLabel":"object[]"},"deleted":{"type":"array","items":{"type":"string","uniqueKey":"data.deleted.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"data.deleted","typeLabel":"string[]"},"user_errors":{"type":"array","items":{"type":"object","required":["path","code","message"],"properties":{"path":{"type":"string","isRequired":true,"uniqueKey":"data.user_errors.items.[INDEX].path","typeLabel":"string"},"code":{"type":"string","enum":["PLATFORM_OWNED","IGNORED_PATH","INVALID_PATH","TOO_LARGE","CONFLICT","INVALID_JSON","INVALID_TEMPLATE","NOT_FOUND"],"isRequired":true,"uniqueKey":"data.user_errors.items.[INDEX].code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","isRequired":true,"uniqueKey":"data.user_errors.items.[INDEX].message","typeLabel":"string"},"line":{"type":"integer","uniqueKey":"data.user_errors.items.[INDEX].line","typeLabel":"integer"},"column":{"type":"integer","uniqueKey":"data.user_errors.items.[INDEX].column","typeLabel":"integer"},"rule":{"type":"string","uniqueKey":"data.user_errors.items.[INDEX].rule","typeLabel":"string"}},"uniqueKey":"data.user_errors.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"data.user_errors","typeLabel":"object[]"},"version_id":{"oneOf":[{"type":"string","description":"Null when nothing was written.","isRequired":true,"uniqueKey":"data.version_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"Null when nothing was written.","isRequired":true,"uniqueKey":"data.version_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.version_id","typeLabel":"string | null"}},"uniqueKey":"data","typeLabel":"object"},"meta":{"type":"object","uniqueKey":"meta","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":true,"message":"\u003cstring>","data":{"upserted":[{"path":"\u003cstring>","checksum":"\u003cstring>"}],"deleted":["\u003cstring>"],"user_errors":[{"path":"\u003cstring>","code":"PLATFORM_OWNED","message":"\u003cstring>","line":123,"column":123,"rule":"\u003cstring>"}],"version_id":"\u003cstring>"},"meta":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"6e6b76d6-b7cd-4291-841c-9096205d6668":{"description":"`FORBIDDEN_SCOPE` — the key lacks the scope for this call. `STORE_ACCESS_DENIED` — `X-Store-ID` names a store that is not the key's merchant's (or not in the key's `store_ids`).","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"uniqueKey":"success","typeLabel":"any"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"error_code":{"type":"string","enum":["NOT_FOUND","VALIDATION","AUTH","FORBIDDEN_SCOPE","RATE_LIMITED","IDEMPOTENCY_CONFLICT","APPROVAL_REQUIRED","UPSTREAM_UNAVAILABLE","CHECK_FAILED","THEME_IS_LIVE","THEME_NOT_DEVELOPMENT","THEME_LIMIT","CHECK_BUSY","STORE_ACCESS_DENIED","STORE_ACCESS_UNAVAILABLE"],"uniqueKey":"error_code","typeLabel":"enum\u003cstring>"},"errors":{"type":"object","additionalProperties":true,"uniqueKey":"errors","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"message":"\u003cstring>","error_code":"NOT_FOUND","errors":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"91a89041-e6e3-484a-9362-df210344b1e8":{"description":"Resource not found.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"uniqueKey":"success","typeLabel":"any"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"error_code":{"type":"string","enum":["NOT_FOUND","VALIDATION","AUTH","FORBIDDEN_SCOPE","RATE_LIMITED","IDEMPOTENCY_CONFLICT","APPROVAL_REQUIRED","UPSTREAM_UNAVAILABLE","CHECK_FAILED","THEME_IS_LIVE","THEME_NOT_DEVELOPMENT","THEME_LIMIT","CHECK_BUSY","STORE_ACCESS_DENIED","STORE_ACCESS_UNAVAILABLE"],"uniqueKey":"error_code","typeLabel":"enum\u003cstring>"},"errors":{"type":"object","additionalProperties":true,"uniqueKey":"errors","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"message":"\u003cstring>","error_code":"NOT_FOUND","errors":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"c10d909a-b34c-45a2-89f0-ac6f76f11b91":{"description":"`THEME_IS_LIVE` — the theme is the main (live) theme; agent keys cannot change it (create a development theme, change it, then publish). `IDEMPOTENCY_CONFLICT` — the Idempotency-Key was reused with a different body.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"uniqueKey":"success","typeLabel":"any"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"error_code":{"type":"string","enum":["NOT_FOUND","VALIDATION","AUTH","FORBIDDEN_SCOPE","RATE_LIMITED","IDEMPOTENCY_CONFLICT","APPROVAL_REQUIRED","UPSTREAM_UNAVAILABLE","CHECK_FAILED","THEME_IS_LIVE","THEME_NOT_DEVELOPMENT","THEME_LIMIT","CHECK_BUSY","STORE_ACCESS_DENIED","STORE_ACCESS_UNAVAILABLE"],"uniqueKey":"error_code","typeLabel":"enum\u003cstring>"},"errors":{"type":"object","additionalProperties":true,"uniqueKey":"errors","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"message":"\u003cstring>","error_code":"NOT_FOUND","errors":{}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"b56afd2b-1432-48e8-af1d-d52b127c2817":{"AgentApiKey":{"type":"apiKey","in":"header","name":"X-Agent-Key","description":"Service-account key, format sq_agt_*. Carries least-privilege scopes.","scopes":["write_themes"],"schemeName":"AgentApiKey"}},"593d50e6-7e13-4ced-a5bd-44bc04d23a52":{"AgentBearer":{"type":"http","scheme":"bearer","description":"An `sq_agt_*` service-account key, or an OAuth 2.1 access token issued for the theme MCP server (which is itself a store-bound, scoped `sq_agt_*` key), in `Authorization: Bearer`.\n","scopes":["write_themes"],"schemeName":"AgentBearer"}}},"servers":{"92b6d8b8-47f2-4201-8ddd-6ab564303a7b":{"url":"https://api.platformdtc.com/api/v1/agent/v1"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"X-Agent-Key","description":"Service-account key, format sq_agt_*. Carries least-privilege scopes.","scopes":["write_themes"],"schemeName":"AgentApiKey"},"schema":{"title":"X-Agent-Key","type":"string","description":"Service-account key, format sq_agt_*. Carries least-privilege scopes.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"AgentApiKey","name":"X-Agent-Key"}],"title":"AgentApiKey"},{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"An `sq_agt_*` service-account key, or an OAuth 2.1 access token issued for the theme MCP server (which is itself a store-bound, scoped `sq_agt_*` key), in `Authorization: Bearer`.\n","scopes":["write_themes"],"schemeName":"AgentBearer"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An `sq_agt_*` service-account key, or an OAuth 2.1 access token issued for the theme MCP server (which is itself a store-bound, scoped `sq_agt_*` key), in `Authorization: Bearer`.\n","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"AgentBearer","name":"Authorization"}],"title":"AgentBearer"}]},"originalFileLocation":"agent-gateway.v1.yaml"},"subdomain":"localhost","siteName":"PlatformDTC","title":"Create or update up to 50 files in one versioned batch. - PlatformDTC","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/api-reference/themes/create-or-update-up-to-50-files-in-one-versioned-batch","matchLevel":0}}},"originalFileLocation":"api-reference/themes/create-or-update-up-to-50-files-in-one-versioned-batch.mdx","locale":"en"},"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=\"The batch is validated first. Files with user errors are skipped and reported in user_errors; valid files are written atomically and recorded as ONE version (author agent:). A batch in which every file failed writes nothing and returns version_id: null. Send checksum_before for every existing file you edit — a mismatch returns CONFLICT for that file instead of overwriting a newer change.\">\u003cmeta data-mint-head name=\"application-name\" content=\"PlatformDTC\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/favicons/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicons/favicon-32x32.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicons/favicon-16x16.png\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicons/favicon.ico\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create or update up to 50 files in one versioned batch. - PlatformDTC\">\u003cmeta data-mint-head property=\"og:description\" content=\"The batch is validated first. Files with user errors are skipped and reported in user_errors; valid files are written atomically and recorded as ONE version (author agent:). A batch in which every file failed writes nothing and returns version_id: null. Send checksum_before for every existing file you edit — a mismatch returns CONFLICT for that file instead of overwriting a newer change.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PlatformDTC\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://local./api-reference/themes/create-or-update-up-to-50-files-in-one-versioned-batch\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create or update up to 50 files in one versioned batch. - PlatformDTC\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The batch is validated first. Files with user errors are skipped and reported in user_errors; valid files are written atomically and recorded as ONE version (author agent:). A batch in which every file failed writes nothing and returns version_id: null. Send checksum_before for every existing file you edit — a mismatch returns CONFLICT for that file instead of overwriting a newer change.\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/favicons/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PlatformDTC\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#111111\">\u003clink data-mint-head rel=\"canonical\" href=\"https://local./api-reference/themes/create-or-update-up-to-50-files-in-one-versioned-batch\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/themes/create-or-update-up-to-50-files-in-one-versioned-batch.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PlatformDTC\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"PlatformDTC","nav":{"languages":[{"language":"en","tabs":[{"tab":"Get Started","pages":[{"title":"Get Started","href":""}]},{"tab":"Agents","pages":[{"title":"Agents","href":"/agents/playbook"}]},{"tab":"Themes","pages":[{"title":"Themes","href":"/themes/overview"}]},{"tab":"API Reference","groups":[{"group":"Reference","pages":[{"title":"API overview","href":"/api-reference/overview"},{"title":"Endpoint Status","href":"/api-reference/endpoint-status"},{"title":"Platform Status","href":"/api-reference/platform-status"},{"title":"Webhooks","href":"/api-reference/webhooks"},{"title":"Rate limits","href":"/api-reference/rate-limits"}]},{"group":"Endpoints","pages":[{"group":"meta","pages":[{"title":"Resolve the calling agent principal, tenant, and granted scopes.","openapi":"/agent-gateway.v1.yaml get /whoami","href":"/api-reference/meta/resolve-the-calling-agent-principal-tenant-and-granted-scopes"},{"title":"Machine-readable catalog of all tools + JSON schemas.","openapi":"/agent-gateway.v1.yaml get /capabilities","href":"/api-reference/meta/machine-readable-catalog-of-all-tools-+-json-schemas"}]},{"group":"jobs","pages":[{"title":"Unified job status \u0026 result for any async operation.","openapi":"/agent-gateway.v1.yaml get /jobs/{job_id}","href":"/api-reference/jobs/unified-job-status-\u0026-result-for-any-async-operation"},{"title":"Post jobs cancel","openapi":"/agent-gateway.v1.yaml post /jobs/{job_id}/cancel","href":"/api-reference/jobs/post-jobs-cancel"}]},{"group":"store","pages":[{"title":"Create a store/landing project from a natural-language brief (async).","openapi":"/agent-gateway.v1.yaml post /projects","href":"/api-reference/store/create-a-storelanding-project-from-a-natural-language-brief-async"},{"title":"Get projects status","openapi":"/agent-gateway.v1.yaml get /projects/{project_id}/status","href":"/api-reference/store/get-projects-status"},{"title":"Post landing pages","openapi":"/agent-gateway.v1.yaml post /landing-pages","href":"/api-reference/store/post-landing-pages"},{"title":"Publish to live (build→S3→CloudFront). Spend-adjacent; may be approval-gated.","openapi":"/agent-gateway.v1.yaml post /projects/{project_id}/publish","href":"/api-reference/store/publish-to-live-build→s3→cloudfront-spend-adjacent;-may-be-approval-gated"},{"title":"Post projects domains","openapi":"/agent-gateway.v1.yaml post /projects/{project_id}/domains","href":"/api-reference/store/post-projects-domains"}]},{"group":"products","pages":[{"title":"List products.","openapi":"/agent-gateway.v1.yaml get /products","href":"/api-reference/products/list-products"},{"title":"Post products","openapi":"/agent-gateway.v1.yaml post /products","href":"/api-reference/products/post-products"},{"title":"Count products matching the list filters.","openapi":"/agent-gateway.v1.yaml get /products/count","href":"/api-reference/products/count-products-matching-the-list-filters"},{"title":"Get one product with its variants.","openapi":"/agent-gateway.v1.yaml get /products/{product_id}","href":"/api-reference/products/get-one-product-with-its-variants"},{"title":"Update a product.","openapi":"/agent-gateway.v1.yaml put /products/{product_id}","href":"/api-reference/products/update-a-product"},{"title":"Soft-delete a product.","openapi":"/agent-gateway.v1.yaml delete /products/{product_id}","href":"/api-reference/products/soft-delete-a-product"},{"title":"Update one variant.","openapi":"/agent-gateway.v1.yaml patch /products/variants/{variant_id}","href":"/api-reference/products/update-one-variant"},{"title":"Bulk update variants.","openapi":"/agent-gateway.v1.yaml post /products/variants/bulk_update","href":"/api-reference/products/bulk-update-variants"},{"title":"Post productsbulk","openapi":"/agent-gateway.v1.yaml post /products/bulk","href":"/api-reference/products/post-productsbulk"},{"title":"Page through the store's products.","openapi":"/agent-gateway.v1.yaml get /api/v1/products","href":"/api-reference/products/page-through-the-stores-products"},{"title":"Create a product.","openapi":"/agent-gateway.v1.yaml post /api/v1/products","href":"/api-reference/products/create-a-product"},{"title":"Read Shopify product links and return what would be imported. Writes nothing.","openapi":"/agent-gateway.v1.yaml post /api/v1/products/import/shopify/preview","href":"/api-reference/products/read-shopify-product-links-and-return-what-would-be-imported-writes-nothing"},{"title":"Create a product per Shopify product link.","openapi":"/agent-gateway.v1.yaml post /api/v1/products/import/shopify","href":"/api-reference/products/create-a-product-per-shopify-product-link"},{"title":"Distinct vendors, product types and tags for the store.","openapi":"/agent-gateway.v1.yaml get /api/v1/products/facets","href":"/api-reference/products/distinct-vendors-product-types-and-tags-for-the-store"},{"title":"Soft-delete many products (ids travel in the body).","openapi":"/agent-gateway.v1.yaml delete /api/v1/products/bulk","href":"/api-reference/products/soft-delete-many-products-ids-travel-in-the-body"},{"title":"Set draft / active / archived on many products.","openapi":"/agent-gateway.v1.yaml patch /api/v1/products/bulk/status","href":"/api-reference/products/set-draft-active-archived-on-many-products"},{"title":"Add and/or remove tags across many products (set semantics).","openapi":"/agent-gateway.v1.yaml patch /api/v1/products/bulk/tags","href":"/api-reference/products/add-andor-remove-tags-across-many-products-set-semantics"},{"title":"Delete apiv1productsvariants","openapi":"/agent-gateway.v1.yaml delete /api/v1/products/variants/{variant_id}","href":"/api-reference/products/delete-apiv1productsvariants"},{"title":"Partial update of a variant.","openapi":"/agent-gateway.v1.yaml patch /api/v1/products/variants/{variant_id}","href":"/api-reference/products/partial-update-of-a-variant"},{"title":"Backfill the variant's current SKU into historical order-item snapshots.","openapi":"/agent-gateway.v1.yaml post /api/v1/products/variants/{variant_id}/sync-sku-to-orders","href":"/api-reference/products/backfill-the-variants-current-sku-into-historical-order-item-snapshots"},{"title":"One product, enriched with variants, images, description and category.","openapi":"/agent-gateway.v1.yaml get /api/v1/products/{product_id}","href":"/api-reference/products/one-product-enriched-with-variants-images-description-and-category"},{"title":"Soft-delete. The row is retained but disappears from every read.","openapi":"/agent-gateway.v1.yaml delete /api/v1/products/{product_id}","href":"/api-reference/products/soft-delete-the-row-is-retained-but-disappears-from-every-read"},{"title":"Partial update. Omitted fields are left untouched.","openapi":"/agent-gateway.v1.yaml patch /api/v1/products/{product_id}","href":"/api-reference/products/partial-update-omitted-fields-are-left-untouched"},{"title":"Copy a product with its variants, images, description and category.","openapi":"/agent-gateway.v1.yaml post /api/v1/products/{product_id}/duplicate","href":"/api-reference/products/copy-a-product-with-its-variants-images-description-and-category"},{"title":"Attach an image by URL (no binary upload).","openapi":"/agent-gateway.v1.yaml post /api/v1/products/{product_id}/images","href":"/api-reference/products/attach-an-image-by-url-no-binary-upload"},{"title":"Delete apiv1products images","openapi":"/agent-gateway.v1.yaml delete /api/v1/products/{product_id}/images/{image_id}","href":"/api-reference/products/delete-apiv1products-images"},{"title":"Add a variant.","openapi":"/agent-gateway.v1.yaml post /api/v1/products/{product_id}/variants","href":"/api-reference/products/add-a-variant"},{"title":"Current dropship bind between this product's variants and catalog variants.","openapi":"/agent-gateway.v1.yaml get /api/v1/products/{product_id}/catalog-link","href":"/api-reference/products/current-dropship-bind-between-this-products-variants-and-catalog-variants"},{"title":"Bind to the sourcing catalog — the dropship \"add to store\" write.","openapi":"/agent-gateway.v1.yaml post /api/v1/products/{product_id}/catalog-link","href":"/api-reference/products/bind-to-the-sourcing-catalog-—-the-dropship-\"add-to-store\"-write"},{"title":"Clear every catalog link and reset the product to unbound.","openapi":"/agent-gateway.v1.yaml delete /api/v1/products/{product_id}/catalog-link","href":"/api-reference/products/clear-every-catalog-link-and-reset-the-product-to-unbound"},{"title":"Catalog link with the resolved catalog product and variant detail.","openapi":"/agent-gateway.v1.yaml get /api/v1/products/{product_id}/catalog-link/enhanced","href":"/api-reference/products/catalog-link-with-the-resolved-catalog-product-and-variant-detail"}]},{"group":"catalog","pages":[{"title":"List collections.","openapi":"/agent-gateway.v1.yaml get /collections","href":"/api-reference/catalog/list-collections"},{"title":"Post collections","openapi":"/agent-gateway.v1.yaml post /collections","href":"/api-reference/catalog/post-collections"},{"title":"Get catalogsearch","openapi":"/agent-gateway.v1.yaml get /catalog/search","href":"/api-reference/catalog/get-catalogsearch"}]},{"group":"ads","pages":[{"title":"Begin Meta/Google/TikTok OAuth; returns an auth_url for the human to authorize.","openapi":"/agent-gateway.v1.yaml post /ads/{platform}/connect","href":"/api-reference/ads/begin-metagoogletiktok-oauth;-returns-an-auth_url-for-the-human-to-authorize"},{"title":"Get adsinsights","openapi":"/agent-gateway.v1.yaml get /ads/insights","href":"/api-reference/ads/get-adsinsights"}]},{"group":"marketing","pages":[{"title":"Post campaigns","openapi":"/agent-gateway.v1.yaml post /campaigns","href":"/api-reference/marketing/post-campaigns"},{"title":"Send/schedule a campaign. Spends money \u0026 contacts customers; may be approval-gated.","openapi":"/agent-gateway.v1.yaml post /campaigns/{campaign_id}/send","href":"/api-reference/marketing/sendschedule-a-campaign-spends-money-\u0026-contacts-customers;-may-be-approval-gated"},{"title":"Post automations","openapi":"/agent-gateway.v1.yaml post /automations","href":"/api-reference/marketing/post-automations"},{"title":"Post segments","openapi":"/agent-gateway.v1.yaml post /segments","href":"/api-reference/marketing/post-segments"}]},{"group":"analytics","pages":[{"title":"Get analyticsdashboard","openapi":"/agent-gateway.v1.yaml get /analytics/dashboard","href":"/api-reference/analytics/get-analyticsdashboard"}]},{"group":"orders","pages":[{"title":"Get orders","openapi":"/agent-gateway.v1.yaml get /orders","href":"/api-reference/orders/get-orders"},{"title":"One order with full detail — items, totals, customer, shipping, fulfillment. Money in major units.","openapi":"/agent-gateway.v1.yaml get /orders/{order_id}","href":"/api-reference/orders/one-order-with-full-detail-—-items-totals-customer-shipping-fulfillment-money-in-major-units"},{"title":"Post orders fulfill","openapi":"/agent-gateway.v1.yaml post /orders/{order_id}/fulfill","href":"/api-reference/orders/post-orders-fulfill"},{"title":"Send abandoned-cart recovery emails. Spends; may be approval-gated.","openapi":"/agent-gateway.v1.yaml post /abandoned-checkouts/recover","href":"/api-reference/orders/send-abandoned-cart-recovery-emails-spends;-may-be-approval-gated"}]},{"group":"admin","pages":[{"title":"Get keys","openapi":"/agent-gateway.v1.yaml get /keys","href":"/api-reference/admin/get-keys"},{"title":"Mint a scoped service-account key (returned once).","openapi":"/agent-gateway.v1.yaml post /keys","href":"/api-reference/admin/mint-a-scoped-service-account-key-returned-once"},{"title":"Delete keys","openapi":"/agent-gateway.v1.yaml delete /keys/{key_id}","href":"/api-reference/admin/delete-keys"},{"title":"Subscribe to outbound events (deploy.ready, order.created, job.completed, roas.threshold).","openapi":"/agent-gateway.v1.yaml post /webhooks","href":"/api-reference/admin/subscribe-to-outbound-events-deployready-ordercreated-jobcompleted-roasthreshold"}]},{"group":"themes","pages":[{"title":"List the store's themes.","openapi":"/agent-gateway.v1.yaml get /themes","href":"/api-reference/themes/list-the-stores-themes"},{"title":"Create a development theme as a copy of another theme.","openapi":"/agent-gateway.v1.yaml post /themes","href":"/api-reference/themes/create-a-development-theme-as-a-copy-of-another-theme"},{"title":"Get themes","openapi":"/agent-gateway.v1.yaml get /themes/{theme_id}","href":"/api-reference/themes/get-themes"},{"title":"Delete a development theme.","openapi":"/agent-gateway.v1.yaml delete /themes/{theme_id}","href":"/api-reference/themes/delete-a-development-theme"},{"title":"Every file with its owner, the limits, and the available section and block types.","openapi":"/agent-gateway.v1.yaml get /themes/{theme_id}/manifest","href":"/api-reference/themes/every-file-with-its-owner-the-limits-and-the-available-section-and-block-types"},{"title":"Read theme files (at most 400 per request).","openapi":"/agent-gateway.v1.yaml get /themes/{theme_id}/files","href":"/api-reference/themes/read-theme-files-at-most-400-per-request"},{"title":"Create or update up to 50 files in one versioned batch.","openapi":"/agent-gateway.v1.yaml put /themes/{theme_id}/files","href":"/api-reference/themes/create-or-update-up-to-50-files-in-one-versioned-batch"},{"title":"Delete files from a theme.","openapi":"/agent-gateway.v1.yaml post /themes/{theme_id}/files/delete","href":"/api-reference/themes/delete-files-from-a-theme"},{"title":"Run theme check — the same validator the CLI, dev MCP and publish use.","openapi":"/agent-gateway.v1.yaml post /themes/{theme_id}/check","href":"/api-reference/themes/run-theme-check-—-the-same-validator-the-cli-dev-mcp-and-publish-use"},{"title":"Create a temporary preview link.","openapi":"/agent-gateway.v1.yaml post /themes/{theme_id}/preview","href":"/api-reference/themes/create-a-temporary-preview-link"},{"title":"Publish a theme as the live theme (spend-class; approval-gated by store policy).","openapi":"/agent-gateway.v1.yaml post /themes/{theme_id}/publish","href":"/api-reference/themes/publish-a-theme-as-the-live-theme-spend-class;-approval-gated-by-store-policy"},{"title":"Durable publish status — the same answer the dashboard editor polls.","openapi":"/agent-gateway.v1.yaml get /themes/{theme_id}/publish-status","href":"/api-reference/themes/durable-publish-status-—-the-same-answer-the-dashboard-editor-polls"},{"title":"Saved versions of the theme.","openapi":"/agent-gateway.v1.yaml get /themes/{theme_id}/versions","href":"/api-reference/themes/saved-versions-of-the-theme"},{"title":"Restore the theme's files to a saved version.","openapi":"/agent-gateway.v1.yaml post /themes/{theme_id}/rollback","href":"/api-reference/themes/restore-the-themes-files-to-a-saved-version"}]}]}]},{"tab":"Fulfillment","pages":[{"title":"Fulfillment","href":"/fulfillment/overview"}]},{"tab":"Commerce","pages":[{"title":"Commerce","href":"/commerce/products"}]},{"tab":"Recipes","pages":[{"title":"Recipes","href":"/recipes/build-a-store"}]},{"tab":"Partner Apps","pages":[{"title":"Partner Apps","href":"/partners/getting-started"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/v1"}]}]}]},"basePath":"","title":"Create or update up to 50 files in one versioned batch. - PlatformDTC","buildId":"b48c568d22cf","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-D7wo336Y.js","utils-Dm9zyzuk.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DyQG-9DG.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Cb7Xp6KS.js","snippetPresets-D1jos7Rh.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-BoPLBqmY.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BAJtKqGy.js","shallow-Dq5-SwG1.js","getApiPlaygroundDisplay-wDIhhqfD.js","CodeSnippet-BxA48oHQ.js","CodeSnippets-DuYLY3sy.js","Page-CPu2vF-C.js","getPastedJson-D7mVG7tB.js","icon-HMNWawTa.js","MethodPill-DvQvTgHx.js","DuplicateIcon-DK5o2DOi.js","createIcon-BhUMOhLi.js","DynamicMarkdown-CSW5mrBH.js","SectionHeading-ht66QKGt.js","axios-vUo_bRtp.js","Markdown-CNAGgX2X.js","clsx-DfU2JnNK.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-uP80LYvr.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-R-TmXqAj.js"]}