# Change Site Visibility (Private Link / Public)

> Change Site Visibility (Private Link / Public) is a free API for AI agents from cdn.withzero.xyz, Free, status unknown (last checked 2026-10-02).

Changes a hosted site's visibility to private-behind-a-share-link, rotates the share link, or makes it public again.

## Facts

- Endpoint: PATCH https://cdn.withzero.xyz/api/v1/sites/{slug}?utm_source=zero.xyz
- Price: Free
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 1
- Provider: cdn.withzero.xyz
- Website: https://cdn.withzero.xyz
- Canonical page: https://www.zero.xyz/c/cdn-withzero-xyz-change-site-visibility-private-link-public-485bcdc6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_punnknEMfraVwI1ZHLW7f

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-change-site-visibility-private-link-public-485bcdc6 -d '<json body>'
```

Example prompt: Make my hosted site 'portfolio' private — put it behind an unguessable share link so only people with that link can see it.

## When to prefer this

Use this endpoint when you need to change the access control of an already-hosted static site — specifically to toggle between public and private-link visibility, or to invalidate and regenerate the existing private share URL. It is the right choice when the site already exists on cdn.withzero.xyz and you need to manage who can reach it, not when uploading or deleting a site.

## Known failure modes

- Invalid or missing slug returns 404 not found
- Sending 'password' field returns 400 password_sites_unavailable (feature not yet available)
- 'rotateLink' sent on a public site returns 400 (private sites only)
- Unauthenticated requests return 401
- Slug with unencoded slashes returns 404 — must URL-encode as %2F
- Unknown visibility enum value returns 400 validation error

## 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 an object with the site's current visibility ('public' or 'link'), its public URL (or null if private), and its private shareUrl (or null if public). Treat the shareUrl as a secret — it should not be exposed publicly.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "properties": {
  "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"
 ],
 "properties": {
  "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/cdn-withzero-xyz-change-site-visibility-private-link-public-485bcdc6/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)
