# Change Site Visibility (WithZero CDN)

> Change Site Visibility (WithZero CDN) is a paid API for AI agents from agents.withzero.xyz, paid per call via MPP, price unknown, status unknown (last checked 2026-11-21).

Updates the visibility of a hosted site to public, private link-only, or password-protected, and optionally rotates the private share link.

## Facts

- Endpoint: PATCH https://agents.withzero.xyz/api/v1/cdn/sites/{slug}?utm_source=zero.xyz
- Price: price unknown
- Payment: MPP
- Status: unknown
- Last checked: 2026-11-21
- Activations on Zero: 0
- Provider: agents.withzero.xyz
- Website: https://agents.withzero.xyz
- Canonical page: https://www.zero.xyz/c/agents-withzero-xyz-change-site-visibility-withzero-cdn-5cee8e1f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3dVtq9WjkfE0p4jT3JflM

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 agents-withzero-xyz-change-site-visibility-withzero-cdn-5cee8e1f -d '<json body>'
```

Example prompt: Make my hosted site 'portfolio' private so only people with the secret link can view it — I don't want it publicly accessible anymore.

## When to prefer this

Use this endpoint when you need to change who can access an already-hosted site on the WithZero CDN — switching between public, link-private, and password-protected modes, or invalidating an existing share link. Prefer this over re-deploying the site from scratch when only access control needs to change.

## Known failure modes

- Invalid slug or site not found returns 404
- Password shorter than 8 or longer than 256 characters returns 400 validation error
- rotateLink set to true on a public site returns 400 (only valid for private sites)
- Unauthorized or expired payment token returns 401 or 402
- Slug contains unencoded slashes causing routing errors — must URL-encode as %2F

## How this service works

Change who can view a site you host: make it private behind an unguessable share link, rotate that link, or make it public again. URL-encode slashes in a nested slug (my%2Fsite).

## Output

Returns the updated visibility mode ('public', 'link', or 'password'), the new public URL (if the site is now public, otherwise null), and the new private share URL (if the site is link- or password-protected, otherwise null).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "properties": {
  "spa": {
   "type": "boolean",
   "description": "Single-page app routing. true: a missing extensionless path (e.g. /dashboard/settings) serves the site index.html with 200 so a client-side router handles it; missing assets (.js, .png…) still 404. false: misses serve the site 404.html, if it has one, with status 404. Omit to keep the current setting (new sites default to false)."
  },
  "password": {
   "type": "string",
   "maxLength": 256,
   "minLength": 8,
   "description": "Sets or changes the site password (implies visibility:\"password\"). 8–256 chars. Omit to keep the current one."
  },
  "rotateLink": {
   "type": "boolean",
   "const": true,
   "description": "Issue a new share URL; the old one stops working immediately. Private sites only."
  },
  "visibility": {
   "enum": [
    "public",
    "link",
    "password"
   ],
   "type": "string",
   "description": "New visibility. \"link\" moves the site to a private /p/<shareId>/ URL; \"password\" puts it behind a password on its own origin, shared as cdn.withzero.xyz/p/<id>/ (a redirect); \"public\" moves it back to /<walletId>/<slug>/. Any change of visibility issues a new shareUrl."
  }
 },
 "additionalProperties": false
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "visibility",
  "shareUrl",
  "url",
  "spa"
 ],
 "properties": {
  "spa": {
   "type": "boolean",
   "description": "Whether single-page-app routing is on."
  },
  "url": {
   "anyOf": [
    {
     "type": "string"
    },
    {
     "type": "null"
    }
   ],
   "description": "Public URL when visibility is public; null otherwise."
  },
  "shareUrl": {
   "anyOf": [
    {
     "type": "string"
    },
    {
     "type": "null"
    }
   ],
   "description": "Private URL for link/password sites; null when public. Treat as a secret."
  },
  "visibility": {
   "enum": [
    "public",
    "link",
    "password"
   ],
   "type": "string"
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agents-withzero-xyz-change-site-visibility-withzero-cdn-5cee8e1f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.withzero.xyz](https://www.zero.xyz/host/agents.withzero.xyz/llms.txt)
