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
/api/v1/tenants/{tid}/sites/{id}/preview-settingsSave a live site's preview settings; previews take them at their next update
Authentication: session cookie __Host-panel_session (contract default; see Authentication).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tid | path | string | required | |
id | path | string | required | |
X-CSRF-Token | header | string | optional | Required on unsafe requests authenticated by session cookie; API keys do not use it. |
Request body
required
Content type: application/json
enabledboolean requiredbranchesarray<string> optional- max items 20
pull_requestsboolean optionalgatestring optionalAllowed values:"""password""panel"gate_userstring optionalgate_passwordstring | null optionalNull keeps the stored one
databasestring optionalAllowed values:"""none""empty""copy"database_idstring optionalidle_daysinteger optional0 is the default, 7
- minimum 0
- maximum 90
envarray<object> optional- max items 100
namestring requiredvaluestring | null optionalsecretboolean required
copy_envarray<string> optional- max items 50
reportboolean 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
enabledboolean requiredbranchesarray<string> requiredBranch name patterns; * is any run of characters
pull_requestsboolean requiredgatestring requiredAllowed values:"""password""panel"gate_userstring requiredhas_passwordboolean requireddatabasestring requiredAllowed values:"none""empty""copy"database_idstring requiredidle_daysinteger required- minimum 1
- maximum 90
envarray<object> requirednamestring requiredvaluestring optionalsecretboolean requiredhas_valueboolean required
copy_envarray<string> requiredNames of the live site's variables a preview gets; no other crosses
reportboolean requiredCommit status and a pull request comment, with the connection's token
updated_atstring (date-time) | null requireddomainstring requiredavailableboolean requiredreasonstring requiredWhy previews cannot be made: PREVIEWS_NOT_SET_UP, PREVIEWS_NOT_IN_PLAN or PREVIEWS_NEED_GIT
limitinteger requiredusedinteger requireddisk_mbinteger requiredmax_copy_mbinteger requiredcertificatesboolean requiredproviderstring 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
codestring requiredmessagestring requireddetails_redactedboolean requiredcorrelation_idstring requiredretryableboolean required