---
title: "Set a site's link-access mode"
method: PUT
path: "/api/sites/{slug}/visibility"
tags: ["site-controller"]
---

# Set a site's link-access mode

`PUT /api/sites/{slug}/visibility`

## Request

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

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.

## Path parameters

- `slug` string, required

## Request body

- SetVisibilityRequest: Set a site's link-access mode: private, password protected, email capture, or public.
  - `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.
  - `password` string, 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.
  - `captureOtp` boolean, 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.
  - `captureReverifyDays` integer, nullable: How many days a confirmed visitor stays confirmed. 0 means every visit re-verifies. Only read when visibility is `capture`.
  - `captureDomains` string, 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`.

## Response `200`

OK

---

[API](https://skmtc.dev/pagegoat/apis/pagegoat-api.md) · [All operations](https://skmtc.dev/pagegoat/apis/pagegoat-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pagegoat/apis/pagegoat-api/revisions/3e87219680af?raw)
