POST /api/v1/publish/:slug/finalize — Make a site live
Finalize a Site
After uploading all files, call finalize to make the site live. The API verifies every file has been uploaded to storage before activating the version.Finalize also performs a security scan on browser-delivered files. If SimpleHost detects what looks like an exposed private key or secret in client-side code, finalize will block the publish instead of putting that site live publicly.
POST /api/v1/publish/:slug/finalize
Path Parameters
string
required
The site slug (e.g., bright-canvas-a7k2).
Headers
Header
Required
Description
Content-Type
Yes
application/json
Authorization
Conditional
Required for authenticated sites. Not needed for anonymous sites.
Request Body
string
required
The version ID from the create/update response at upload.versionId.
If finalize detects exposed secret material in the uploaded site files, it returns SECRET_DETECTED and the site does not go live.This is intentional. Static browser files are public, so private keys should not be published inside them.
Example Blocked Response
{ "error": "We detected what looks like exposed secret material in files that would be publicly accessible after publish.", "code": "SECRET_DETECTED", "status": 400, "detectedSecrets": [ { "path": "app.js", "type": "stripe_test_key", "line": 14, "suggestedVariableName": "STRIPE_SECRET_KEY", "suggestedProxyHosts": ["api.stripe.com"] } ], "remediation": { "suggestedVariableNames": ["STRIPE_SECRET_KEY"], "suggestedProxyHosts": ["api.stripe.com"], "steps": [ "Ask the user for permission to secure the key before publishing.", "Store the key as a site variable.", "Approve the required outbound host.", "Update only the published output to use the site proxy.", "Retry the publish." ] }}
Recommended Agent Behavior
If you are publishing through an agent, the expected flow is:
Explain the issue in plain English
Ask the user for permission to secure it
If the user agrees:
store the secret in site variables
approve the required proxy host
update only the published copy
retry finalize
If the user refuses, do not publish the site
The goal is to keep the user’s original local files untouched unless they explicitly ask for local code changes.
Errors
Status
Code
Reason
404
NOT_FOUND
Site not found
401
UNAUTHORIZED
Not authorized to finalize this site
400
INVALID_REQUEST
versionId doesn’t match the pending version
400
INVALID_REQUEST
Not all files have been uploaded
400
SECRET_DETECTED
Exposed private key or secret was found in public site files
Finalize will fail if any file in the manifest hasn’t been uploaded yet. Make sure all uploads complete before calling finalize.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"SimpleHost","colors":{"primary":"#000000","light":"#555555","dark":"#ffffff"},"favicon":"https://mintcdn.com/supalink/n_zlYik35m1_VnrJ/favicon.svg?fit=max\u0026auto=format\u0026n=n_zlYik35m1_VnrJ\u0026q=85\u0026s=83166340d1d5fc54a9813f67b21bcdd4","logo":{"light":"https://mintcdn.com/supalink/vYScRszPkvKjJZMV/images/logo-light.svg?fit=max\u0026auto=format\u0026n=vYScRszPkvKjJZMV\u0026q=85\u0026s=3d93beab199dbf77c3650cb53946d05c","dark":"https://mintcdn.com/supalink/vYScRszPkvKjJZMV/images/logo-dark.svg?fit=max\u0026auto=format\u0026n=vYScRszPkvKjJZMV\u0026q=85\u0026s=3933cf2e5ffd240994da2881862fcd10"},"api":{"mdx":{"server":"https://simplehost.dev"}},"background":{"decoration":null,"color":{"light":"#ffffff","dark":"#0a0a0a"}},"navbar":{"links":[{"label":"Dashboard","href":"https://simplehost.dev/dashboard"}],"primary":{"type":"button","label":"Install Skill","href":"https://docs.simplehost.dev/quickstart"}},"footer":{"socials":{"github":"https://github.com/sk-code-01"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"supalink","hasAudioNarration":false,"actualSubdomain":"supalink","customDomains":["docs.simplehost.dev"],"gitSource":{"type":"github","owner":"sk-code-01","repo":"simplehost-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae94a852422c68a7def9e88:success","clientVersion":"0.0.4304","searchFilterCounts":[{"language":"default","tag":"API Reference","count":40},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Agent Skill","count":6},{"language":"default","tag":"Documentation","count":4},{"language":"default","tag":"Getting Started","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"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":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/finalize","slug":"/api-reference/finalize","pageMetadata":{"title":"Finalize","description":"POST /api/v1/publish/:slug/finalize — Make a site live","href":"/api-reference/finalize"},"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: \"POST /api/v1/publish/:slug/finalize — Make a site live\"\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`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,ParamField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`finalize-a-site`,children:`Finalize a Site`}),`\n`,_jsx(_components.p,{children:`After uploading all files, call finalize to make the site live. The API verifies every file has been uploaded to storage before activating the version.`}),`\n`,_jsx(_components.p,{children:`Finalize also performs a security scan on browser-delivered files. If SimpleHost detects what looks like an exposed private key or secret in client-side code, finalize will block the publish instead of putting that site live publicly.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /api/v1/publish/:slug/finalize`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`path-parameters`,children:`Path Parameters`}),`\n`,_jsx(ParamField,{path:`slug`,type:`string`,required:true,id:`param-slug`,children:_jsxs(_components.p,{children:[`The site slug (e.g., `,_jsx(_components.code,{children:`bright-canvas-a7k2`}),`).`]})}),`\n`,_jsx(Heading,{level:`3`,id:`headers`,children:`Headers`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Content-Type`})}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`application/json`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Authorization`})}),_jsx(_components.td,{children:`Conditional`}),_jsx(_components.td,{children:`Required for authenticated sites. Not needed for anonymous sites.`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(ParamField,{body:`versionId`,type:`string`,required:true,id:`param-version-id`,children:_jsxs(_components.p,{children:[`The version ID from the create/update response at `,_jsx(_components.code,{children:`upload.versionId`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`example`,children:`Example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,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://simplehost.dev/api/v1/publish/bright-canvas-a7k2/finalize`}),_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:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sh_live_your_key_here\"`}),_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:` '{\"versionId\": \"01jm4abc123def456\"}'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`response-200`,children:`Response (200)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,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:`6`,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:` \"slug\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"bright-canvas-a7k2\"`}),_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:` \"siteUrl\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://bright-canvas-a7k2.simplehost.dev/\"`}),_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:` \"versionId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"01jm4abc123def456\"`}),_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:`\"active\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The site is now live at the `,_jsx(_components.code,{children:`siteUrl`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`secure-publish-blocking`,children:`Secure Publish Blocking`}),`\n`,_jsxs(_components.p,{children:[`If finalize detects exposed secret material in the uploaded site files, it returns `,_jsx(_components.code,{children:`SECRET_DETECTED`}),` and the site does not go live.`]}),`\n`,_jsx(_components.p,{children:`This is intentional. Static browser files are public, so private keys should not be published inside them.`}),`\n`,_jsx(Heading,{level:`3`,id:`example-blocked-response`,children:`Example Blocked Response`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`25`,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:`25`,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:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"We detected what looks like exposed secret material in files that would be publicly accessible after publish.\"`}),_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:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SECRET_DETECTED\"`}),_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:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`400`}),_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:` \"detectedSecrets\"`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"path\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"app.js\"`}),_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:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stripe_test_key\"`}),_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:` \"line\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`14`}),_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:` \"suggestedVariableName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"STRIPE_SECRET_KEY\"`}),_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:` \"suggestedProxyHosts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"api.stripe.com\"`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"remediation\"`}),_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:` \"suggestedVariableNames\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"STRIPE_SECRET_KEY\"`}),_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:` \"suggestedProxyHosts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"api.stripe.com\"`}),_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:` \"steps\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Ask the user for permission to secure the key before publishing.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Store the key as a site variable.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Approve the required outbound host.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Update only the published output to use the site proxy.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Retry the publish.\"`})}),`\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`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`recommended-agent-behavior`,children:`Recommended Agent Behavior`}),`\n`,_jsx(_components.p,{children:`If you are publishing through an agent, the expected flow is:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Explain the issue in plain English`}),`\n`,_jsx(_components.li,{children:`Ask the user for permission to secure it`}),`\n`,_jsxs(_components.li,{children:[`If the user agrees:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`store the secret in site variables`}),`\n`,_jsx(_components.li,{children:`approve the required proxy host`}),`\n`,_jsx(_components.li,{children:`update only the published copy`}),`\n`,_jsx(_components.li,{children:`retry finalize`}),`\n`]}),`\n`]}),`\n`,_jsx(_components.li,{children:`If the user refuses, do not publish the site`}),`\n`]}),`\n`,_jsx(_components.p,{children:`The goal is to keep the user’s original local files untouched unless they explicitly ask for local code changes.`}),`\n`,_jsx(Heading,{level:`3`,id:`errors`,children:`Errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Reason`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`NOT_FOUND`})}),_jsx(_components.td,{children:`Site not found`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`UNAUTHORIZED`})}),_jsx(_components.td,{children:`Not authorized to finalize this site`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`INVALID_REQUEST`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`versionId`}),` doesn’t match the pending version`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`INVALID_REQUEST`})}),_jsx(_components.td,{children:`Not all files have been uploaded`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`SECRET_DETECTED`})}),_jsx(_components.td,{children:`Exposed private key or secret was found in public site files`})]})]})]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Finalize will fail if any file in the manifest hasn’t been uploaded yet. Make sure all uploads complete before calling finalize.`})})]})}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":"Finalize","description":"POST /api/v1/publish/:slug/finalize — Make a site live","href":"/api-reference/finalize"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Finalize a Site","slug":"finalize-a-site","depth":2,"children":[{"title":"Path Parameters","slug":"path-parameters","depth":3,"children":[]},{"title":"Headers","slug":"headers","depth":3,"children":[]},{"title":"Request Body","slug":"request-body","depth":3,"children":[]},{"title":"Example","slug":"example","depth":3,"children":[]},{"title":"Response (200)","slug":"response-200","depth":3,"children":[]}]},{"title":"Secure Publish Blocking","slug":"secure-publish-blocking","depth":2,"children":[{"title":"Example Blocked Response","slug":"example-blocked-response","depth":3,"children":[]}]},{"title":"Recommended Agent Behavior","slug":"recommended-agent-behavior","depth":2,"children":[{"title":"Errors","slug":"errors","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"supalink","siteName":"SimpleHost","title":"Finalize - SimpleHost","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-03-31T11:07:55.153Z","originalFileLocation":"api-reference/finalize.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=\"POST /api/v1/publish/:slug/finalize — Make a site live\">\u003cmeta data-mint-head name=\"application-name\" content=\"SimpleHost\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/supalink/mIEomuMWg-2xLzpm/_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/supalink/mIEomuMWg-2xLzpm/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/supalink/mIEomuMWg-2xLzpm/_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/supalink/mIEomuMWg-2xLzpm/_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/supalink/mIEomuMWg-2xLzpm/_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/supalink/mIEomuMWg-2xLzpm/_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/supalink/mIEomuMWg-2xLzpm/_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/supalink/mIEomuMWg-2xLzpm/_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/supalink/mIEomuMWg-2xLzpm/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Finalize - SimpleHost\">\u003cmeta data-mint-head property=\"og:description\" content=\"POST /api/v1/publish/:slug/finalize — Make a site live\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SimpleHost\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.simplehost.dev/api-reference/finalize\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://supalink.mintlify.site/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Finalize\u0026amp;description=POST+%2Fapi%2Fv1%2Fpublish%2F%3Aslug%2Ffinalize+%E2%80%94+Make+a+site+live\u0026amp;theme=5658f7a08c29f63336649f6a\u0026amp;signature=d917a7feb29428d1d8d9865d706d2bb7c681f085d6abcd3e2fe55c61dc254421\">\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=\"Finalize - SimpleHost\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"POST /api/v1/publish/:slug/finalize — Make a site live\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://supalink.mintlify.site/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Finalize\u0026amp;description=POST+%2Fapi%2Fv1%2Fpublish%2F%3Aslug%2Ffinalize+%E2%80%94+Make+a+site+live\u0026amp;theme=5658f7a08c29f63336649f6a\u0026amp;signature=d917a7feb29428d1d8d9865d706d2bb7c681f085d6abcd3e2fe55c61dc254421\">\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/supalink/mIEomuMWg-2xLzpm/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SimpleHost\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#000000\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.simplehost.dev/api-reference/finalize\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/finalize.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.simplehost.dev/#organization\",\"name\":\"SimpleHost\",\"url\":\"https://docs.simplehost.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/supalink/vYScRszPkvKjJZMV/images/logo-light.svg?fit=max\u0026auto=format\u0026n=vYScRszPkvKjJZMV\u0026q=85\u0026s=3d93beab199dbf77c3650cb53946d05c\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.simplehost.dev#website\",\"name\":\"SimpleHost\",\"url\":\"https://docs.simplehost.dev\",\"publisher\":{\"@id\":\"https://docs.simplehost.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.simplehost.dev/api-reference/finalize#webpage\",\"url\":\"https://docs.simplehost.dev/api-reference/finalize\",\"name\":\"Finalize\",\"description\":\"POST /api/v1/publish/:slug/finalize — Make a site live\",\"dateModified\":\"2026-03-31T11:07:55.153Z\",\"isPartOf\":{\"@id\":\"https://docs.simplehost.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.simplehost.dev/api-reference/finalize#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.simplehost.dev/api-reference/finalize#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.simplehost.dev/api-reference/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Finalize\",\"item\":\"https://docs.simplehost.dev/api-reference/finalize\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.simplehost.dev/api-reference/finalize#article\",\"headline\":\"Finalize\",\"name\":\"Finalize\",\"description\":\"POST /api/v1/publish/:slug/finalize — Make a site live\",\"url\":\"https://docs.simplehost.dev/api-reference/finalize\",\"mainEntityOfPage\":{\"@id\":\"https://docs.simplehost.dev/api-reference/finalize#webpage\"},\"dateModified\":\"2026-03-31T11:07:55.153Z\",\"publisher\":{\"@id\":\"https://docs.simplehost.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.simplehost.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SimpleHost\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"SimpleHost\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/finalize.md","siteName":"SimpleHost","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"Agent Skill","pages":[{"title":"Agent Skill","href":"/skill/overview"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"API Overview","href":"/api-reference/overview"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"Account","href":"/api-reference/account"},{"title":"Create a Site","href":"/api-reference/publish"},{"title":"Upload Files","description":"PUT /api/v1/_upload/:key — Upload a file to its presigned URL","href":"/api-reference/upload"},{"title":"Finalize","href":"/api-reference/finalize"},{"title":"Update a Site","description":"PUT /api/v1/publish/:slug — Publish a new version of an existing site","href":"/api-reference/update"},{"title":"List Sites","href":"/api-reference/list-sites"},{"title":"Get Site Details","href":"/api-reference/get-site"},{"title":"Delete a Site","href":"/api-reference/delete-site"},{"title":"Duplicate a Site","href":"/api-reference/duplicate-site"},{"title":"Update Metadata","href":"/api-reference/update-metadata"},{"title":"Site Variables","href":"/api-reference/site-variables"},{"title":"Proxy Host Allowlist","href":"/api-reference/proxy-hosts"},{"title":"Site Proxy","href":"/api-reference/site-proxy"},{"title":"Claim a Site","href":"/api-reference/claim-site"},{"title":"Handle","href":"/api-reference/handle"},{"title":"Billing","href":"/api-reference/billing"},{"title":"Errors","href":"/api-reference/errors"},{"title":"Rate Limits","href":"/api-reference/rate-limits"}]}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/guides/publish-with-script"}]}]},"basePath":"","title":"Finalize - SimpleHost","deploymentId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","buildId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","dynamics":[],"chunks":[]}