# Rollback Site to Earlier Deploy

> Rollback Site to Earlier Deploy is a paid API for AI agents from cdn.withzero.xyz, paid per call via MPP, metered — billed by usage, status unknown (last checked 2026-10-11).

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.

## Facts

- Endpoint: POST https://cdn.withzero.xyz/api/v1/sites/{slug}/rollback?utm_source=zero.xyz
- Price: metered — billed by usage
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Provider: cdn.withzero.xyz
- Website: https://cdn.withzero.xyz
- Canonical page: https://www.zero.xyz/c/cdn-withzero-xyz-rollback-site-to-earlier-deploy-5724795b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lhUFXd6QiLhymxFoKhUcG

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability cdn-withzero-xyz-rollback-site-to-earlier-deploy-5724795b -d '<json body>'
```

Example prompt: Roll back my site 'my-portfolio' to deploy ID abc123xyz — restore those old files on the CDN without changing who can see it.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Restore an earlier deploy of a site you host. Its files and rules come back; visibility, password and spa stay as they are now.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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
}
```

## Response schema (JSON Schema)

```json
{
 "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
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/cdn-withzero-xyz-rollback-site-to-earlier-deploy-5724795b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from cdn.withzero.xyz](https://www.zero.xyz/host/cdn.withzero.xyz/llms.txt)
