site-controller

Set a site's link-access mode

Private, password protected, email capture, or public. Switching to password requires a password unless the site already has one; capture is refused unless the deployment has CAPTURE_EMAILS switched on. Setting or changing the password — and any change of mode — invalidates every gate token already issued, so everyone currently viewing has to clear the gate again. Leaving capture never deletes captured addresses; it only stops collecting.

put/api/sites/{slug}/visibility

Request

  • Base URL: https://api.pagegoat.com
  • URL: https://api.pagegoat.com/api/sites/{slug}/visibility
  • Auth: HTTP bearer

Path parameters

slugstring required

Request body

visibility'private' | 'password' | 'capture' | 'public' required

Required.

publicRole'viewer' | 'commenter' nullable

Role for anyone who gets in via the link. Meaningful for password, capture and public; ignored (and cleared) for private.

passwordstring nullable

New link password. Required when switching to password mode and the site has none; omit to keep the current one. Setting it signs out everyone currently viewing. Max 128 characters.

captureOtpboolean nullable

Whether a capture visitor must confirm a six-digit code. False is "email only, no code". Only read when visibility is capture; absent keeps the current setting.

captureReverifyDaysinteger nullable

How many days a confirmed visitor stays confirmed. 0 means every visit re-verifies. Only read when visibility is capture.

captureDomainsstring nullable

Comma- or space-separated domains a visitor's address must be at; empty for any domain. Subdomains of a listed domain are accepted. Only read when visibility is capture.

Example request

{
  "visibility": "password",
  "publicRole": "viewer",
  "password": "mR7k-qP2w-vT9x",
  "captureOtp": true,
  "captureReverifyDays": 30,
  "captureDomains": "acme.com, northloop.co"
}

Response

OK

Changes

No recorded changes to this operation across all 1 revision of this API.