{"uid":"cap_punnknEMfraVwI1ZHLW7f","slug":"cdn-withzero-xyz-change-site-visibility-private-link-public-485bcdc6","name":"Change Site Visibility (Private Link / Public)","description":"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).","url":"https://cdn.withzero.xyz/api/v1/sites/{slug}?utm_source=zero.xyz","method":"PATCH","headers":{},"bodySchema":{"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},"responseSchema":{"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},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"proven_free","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":"free","summary":"Free","primary":null,"accepted":[]},"paymentMethods":[],"brandName":"cdn.withzero.xyz","brandSlug":"cdn-withzero-xyz-mpp","brandBaseUrl":"https://cdn.withzero.xyz","brandDocsUrl":null,"whatItDoes":"Changes a hosted site's visibility to private-behind-a-share-link, rotates the share link, or makes it public again.","exampleAgentPrompt":"Make my hosted site 'portfolio' private — put it behind an unguessable share link so only people with that link can see it.","exampleUseCases":[{"title":"Restrict client preview site","prompt":"I want to hide my site 'client-preview' from the public and put it behind a private share link so only my client can access it — switch it to link-only visibility."},{"title":"Rotate share link after leak","prompt":"Someone shared the private URL for my site 'docs%2Finternal' without permission — rotate the share link right now so the old one stops working and give me a new one."},{"title":"Re-publish site publicly","prompt":"My site 'launch-page' was private during development — go ahead and make it public again so it's back on its normal public URL."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":"## Workflow\n- No site yet? Start at POST /api/v1/uploads (kind:\"site\") — its slug is the {slug} here, from the same wallet.\n- {visibility:\"link\"} → private; returns shareUrl (/p/<shareId>/), public URL 404s\n- {password:\"…\"} → password site; shareUrl cdn.withzero.xyz/p/<id>/ redirects to its own origin; changing the password signs everyone out\n- {rotateLink:true} → new shareUrl; the old one 404s immediately\n- {visibility:\"public\"} → back to /<walletId>/<slug>/; share URL dies\n- remove instead: DELETE /api/v1/sites/{slug}\n\n## Contract\n- Any visibility change issues a new shareUrl.\n- Only the uploading wallet's own sites resolve; any other slug → 404.\n- Nested slugs: URL-encode \"/\" as %2F (my%2Fsite).","reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":1,"lastUsedAt":"2026-09-30T21:04:53.508Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T16:14:09.023Z","isFirstParty":true,"canonicalSlug":"cdn-withzero-xyz-change-site-visibility-private-link-public-485bcdc6"}