{"uid":"cap_lhUFXd6QiLhymxFoKhUcG","slug":"cdn-withzero-xyz-rollback-site-to-earlier-deploy-5724795b","name":"Rollback Site to Earlier Deploy","description":"Restore an earlier deploy of a site you host. Its files and rules come back; visibility, password and spa stay as they are now.","url":"https://cdn.withzero.xyz/api/v1/sites/{slug}/rollback?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["deployId"],"properties":{"deployId":{"type":"string","description":"A deploy from GET /api/v1/sites/{slug}/deploys with status \"superseded\"."}},"additionalProperties":false},"responseSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["walletId","cacheTtlSeconds","files","deployId"],"properties":{"spa":{"type":"boolean","description":"kind:site only — whether single-page-app routing is on after this upload."},"files":{"type":"array","items":{"type":"object","required":["url","path","sizeBytes"],"properties":{"url":{"type":"string","description":"Public URL this file is served from."},"path":{"type":"string","description":"Path within your wallet namespace (the part after <walletId>/)."},"sizeBytes":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"description":"Decoded file size in bytes."}},"additionalProperties":false},"description":"One entry per uploaded file. kind:file — a single entry. kind:site — one entry per file in the zip; the hosted site's entry point is /<walletId>/<slug>/, which serves <slug>/index.html."},"deployId":{"type":"string","description":"The new deploy that restored the old one."},"shareUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"kind:site with link or password visibility — the private URL to share. For a link site it is the whole credential; for a password site viewers also need the password."},"walletId":{"type":"string","description":"Random per-wallet base62 id used as the folder in the URL path (the <walletId> in /<walletId>/<slug>/)."},"warnings":{"type":"array","items":{"type":"string"},"description":"kind:site only — rules in _redirects / _headers that were skipped (unsupported syntax, a disallowed header). The deploy itself succeeded."},"visibility":{"enum":["public","link","password"],"type":"string","description":"kind:site only — the site's visibility after this upload."},"cacheTtlSeconds":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"description":"Resolved edge cache lifetime (Cache-Control max-age) applied to every uploaded object."}},"additionalProperties":false},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"unprobed","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"metered","summary":"metered — billed by usage","primary":{"kind":"metered","protocol":"mpp","network":"tempo","amountUsd":null,"per":"call","confidence":"unknown"},"accepted":[{"kind":"metered","protocol":"mpp","network":"tempo","amountUsd":null,"per":"call","confidence":"unknown"}]},"paymentMethods":[{"uid":"pm_8Shnj4IJVeyiVtyiPkyR5","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":"cdn.sites.rollback:1"}],"brandName":"cdn.withzero.xyz","brandSlug":"cdn-withzero-xyz-mpp","brandBaseUrl":"https://cdn.withzero.xyz","brandDocsUrl":null,"whatItDoes":"Restores a previously superseded deploy of a hosted static site, bringing back its files and redirect/header rules while preserving current visibility, password, and SPA settings.","exampleAgentPrompt":"Roll back my site 'my-portfolio' to deploy ID abc123xyz — restore those old files on the CDN without changing who can see it.","exampleUseCases":[{"title":"Undo a broken production deploy","prompt":"My site 'storefront-v2' is broken after the last push — roll it back to deploy ID d9f4b2c1 to restore the working version of the files."},{"title":"Recover from accidental content deletion","prompt":"I accidentally deployed a site with missing images on 'blog-main' — can you revert it to deploy ID e7a3d901 so the old content comes back?"},{"title":"Restore site after failed experiment","prompt":"The redesign I pushed to 'landing-page' didn't work out — please restore the previous deploy with ID b2c5f870 and keep the current visibility settings as-is."}],"resultDescription":"Returns the new deploy ID created by the rollback, the full list of restored files with their public URLs, paths, and sizes, the wallet ID, cache TTL in seconds, current visibility, optional share URL, and any warnings about redirect/header rules that were skipped.","failureModes":["Deploy ID not found or does not belong to the given slug — 404 error","Deploy ID is not in 'superseded' status (e.g. it is already the live deploy) — validation error","Slug does not exist in the authenticated wallet — 404 error","Malformed or missing deployId in request body — 400 error","Authentication failure — 401/403 error"],"whenToPreferThis":"Use this endpoint when you need to instantly revert a hosted static site to a specific earlier deploy — for example after a bad push breaks the live site. It is faster than re-uploading files because it reactivates an already-stored deploy. It preserves current access control (visibility, password, SPA routing) so you don't need to reconfigure those settings after rollback.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T09:38:45.740Z","isFirstParty":true,"canonicalSlug":"cdn-withzero-xyz-rollback-site-to-earlier-deploy-5724795b"}