API referenceSections

Save a live site's preview settings; previews take them at their next update

Generated from the OpenAPI contract. Sessions send the CSRF header on writes; API keys use a Bearer token. Authentication

PUT /api/v1/tenants/{tid}/sites/{id}/preview-settings

Save a live site's preview settings; previews take them at their next update

Authentication: session cookie __Host-panel_session (contract default; see Authentication).

Parameters

NameInTypeRequiredDescription
tidpathstringrequired
idpathstringrequired
X-CSRF-Tokenheaderstringoptional

Required on unsafe requests authenticated by session cookie; API keys do not use it.

Request body

required

Content type: application/json

  • enabled boolean required
  • branches array<string> optional
    • max items 20
  • pull_requests boolean optional
  • gate string optional
    Allowed values: "" "password" "panel"
  • gate_user string optional
  • gate_password string | null optional

    Null keeps the stored one

  • database string optional
    Allowed values: "" "none" "empty" "copy"
  • database_id string optional
  • idle_days integer optional

    0 is the default, 7

    • minimum 0
    • maximum 90
  • env array<object> optional
    • max items 100
    • name string required
    • value string | null optional
    • secret boolean required
  • copy_env array<string> optional
    • max items 50
  • report boolean optional
Example
{
  "enabled": true,
  "branches": [
    "string"
  ],
  "pull_requests": true,
  "gate": "",
  "gate_user": "string",
  "gate_password": "string",
  "database": "",
  "database_id": "string",
  "idle_days": 0,
  "env": [
    {
      "name": "string",
      "value": "string",
      "secret": true
    }
  ],
  "copy_env": [
    "string"
  ],
  "report": true
}

Responses

200 Saved

Content type: application/json

  • enabled boolean required
  • branches array<string> required

    Branch name patterns; * is any run of characters

  • pull_requests boolean required
  • gate string required
    Allowed values: "" "password" "panel"
  • gate_user string required
  • has_password boolean required
  • database string required
    Allowed values: "none" "empty" "copy"
  • database_id string required
  • idle_days integer required
    • minimum 1
    • maximum 90
  • env array<object> required
    • name string required
    • value string optional
    • secret boolean required
    • has_value boolean required
  • copy_env array<string> required

    Names of the live site's variables a preview gets; no other crosses

  • report boolean required

    Commit status and a pull request comment, with the connection's token

  • updated_at string (date-time) | null required
  • domain string required
  • available boolean required
  • reason string required

    Why previews cannot be made: PREVIEWS_NOT_SET_UP, PREVIEWS_NOT_IN_PLAN or PREVIEWS_NEED_GIT

  • limit integer required
  • used integer required
  • disk_mb integer required
  • max_copy_mb integer required
  • certificates boolean required
  • provider string required
Example
{
  "enabled": true,
  "branches": [
    "string"
  ],
  "pull_requests": true,
  "gate": "",
  "gate_user": "string",
  "has_password": true,
  "database": "none",
  "database_id": "string",
  "idle_days": 1,
  "env": [
    {
      "name": "string",
      "value": "string",
      "secret": true,
      "has_value": true
    }
  ],
  "copy_env": [
    "string"
  ],
  "report": true,
  "updated_at": "2026-01-01T00:00:00Z",
  "domain": "string",
  "available": true,
  "reason": "string",
  "limit": 0,
  "used": 0,
  "disk_mb": 0,
  "max_copy_mb": 0,
  "certificates": true,
  "provider": "string"
}

default Error

Content type: application/json

  • code string required
  • message string required
  • details_redacted boolean required
  • correlation_id string required
  • retryable boolean required