---
search:
  tags:
    - sites
    - PATCH
seo:
  description: >-
    A new access applies within seconds; visitors who opened the site under a
    mode that no… Reference for the PATCH /v1/sites/{site} endpoint in the
    pols.so API.
sidebar:
  label: Change a site's access, how many versions it keeps or its redirect
  badge: PATCH
title: Change a site's access, how many versions it keeps or its redirect
type: openapi-operation
---
A new `access` applies within seconds; visitors who opened the site
under a mode that no longer lets them in lose it. Changing `access`
away from `link` rotates the share link, as `POST .../link` does, so
switching back to `link` needs the new `share_url`. Lowering
`keep_versions` drops the versions beyond it at once.

A `redirect_url` makes every host of the site, its custom domains
included, answer `redirect_status` (default 301) with that URL as
its `Location`, as it is: the request's path and query are dropped.
It replaces the site's files and server app for everyone the site's
`access` lets in; everyone else is denied as before, so a private
site does not show where it redirects. Plain HTTP first goes to
HTTPS on the same host, and a custom domain that is not the primary
one to the primary domain, which then redirects. The URL must be
absolute `http` or `https`, without a user name or password, at
most 2048 characters, and not on one of the site's own hosts. An
empty `redirect_url` removes the redirect.

`PATCH /v1/sites/{site}`
