PUT
Set the preview environment config

Authorizations

Authorization
string
header
required

Bearer token for authentication. Format: 'Bearer {token}'

Headers

X-Workspace-Id
string

Workspace ID (uses default workspace if not provided)

Path Parameters

uuid
string
required

Application UUID

Body

application/json

Set the preview environment config

enabled
boolean

Create preview environments for this application. Defaults to false

resource_mode
enum<string>

parent runs them where the application runs: on its resource, or on Usage Billing or in the workspace pool in its region. existing requires resource_id. pay_per_use, or workspace_pool on an enterprise contract, runs the preview environments of an application on a resource without one, in the application's region. Without a resource they run at the CPU class and size set by dedicated and size, the application's until those are set. An application without a resource takes only parent. Defaults to parent

Available options:
parent,
existing,
pay_per_use,
workspace_pool
resource_id
string

UUID of the resource preview environments run on. Required when resource_mode is existing

project_id
string

UUID of the project preview environments land in. Omit to follow the parent application

trigger_mode
enum<string>

pull_request creates one per pull request, every_branch creates one per pushed branch. Defaults to pull_request

Available options:
pull_request,
every_branch
trigger_filter
enum<string>

Which pull requests qualify: auto (all non-draft), label, branch_pattern or pr_name_pattern. Defaults to auto

Available options:
auto,
label,
branch_pattern,
pr_name_pattern
trigger_label
string

Pull request label that triggers creation. Required when trigger_filter is label

branch_pattern
string

Glob matched against the branch name, e.g. feature/*. Required when trigger_filter is branch_pattern

pr_name_pattern
string

Glob matched against the pull request title, e.g. feat:*. Required when trigger_filter is pr_name_pattern

auto_deploy_on_push
boolean

Redeploy on every push to the tracked branch. Defaults to true

cleanup_on_pr_merge
boolean

Destroy when the pull request is merged. Defaults to true

cleanup_on_pr_close
boolean

Destroy when the pull request is closed unmerged. Defaults to false

cleanup_on_branch_delete
boolean

Destroy when the branch is deleted. Defaults to false

cleanup_on_inactivity
boolean

Destroy after inactivity_days without a commit. Defaults to false

inactivity_days
integer<int32>

Days without a commit before cleanup. Defaults to 14

retention_days
integer<int32>

Days a preview environment is kept before it expires. Defaults to 7

retention_mode
enum<string>

after_pr_close counts from the pull request closing, from_creation counts from creation. Defaults to after_pr_close

Available options:
after_pr_close,
from_creation
comment_on_github
boolean

Post the preview environment URL as a pull request comment. Defaults to true, and is forced off in every_branch mode

clone_settings
object

What is copied from the parent application. clone_variables, clone_secret_files and clone_security default to true when absent; addons and cronjobs default to copying all

tier
enum<string>

For preview environments that run without a resource (pay_per_use, workspace_pool, or parent for an application without one): 'hobby' for shared CPU, 'pro' for dedicated. Implied by size when one is named. Until it is set they take the application's CPU class. Cloned add-ons keep the application's sizes and run in the same CPU class as the preview

Available options:
hobby,
pro
size
string

For preview environments that run without a resource: a size code from GET /api/v1/workspace/pay_per_use/sizes, e.g. hobby-1c-2g. An empty string goes back to the application's size. A size not offered for the CPU class is refused with 422

Response

Set the preview environment config

Api_V1_Entities_PreviewEnvironmentConfig model

enabled
boolean
required

Whether preview environments are created for this application

resource_mode
string
required

parent (where the application runs), existing (use resource_id), pay_per_use or workspace_pool (without a resource, in the application's region, at dedicated and size)

resource_id
string
required

UUID of the resource preview environments run on, when resource_mode is existing

project_id
string
required

UUID of the project preview environments land in. Null means they follow the parent application

trigger_mode
string
required

pull_request or every_branch

trigger_filter
string
required

auto, label, branch_pattern or pr_name_pattern

trigger_label
string
required

Pull request label that triggers creation, when trigger_filter is label

branch_pattern
string
required

Glob matched against the branch name, when trigger_filter is branch_pattern

pr_name_pattern
string
required

Glob matched against the pull request title, when trigger_filter is pr_name_pattern

auto_deploy_on_push
boolean
required

Redeploy the preview environment on every push to its branch

cleanup_on_pr_merge
boolean
required

Destroy the preview environment when the pull request is merged

cleanup_on_pr_close
boolean
required

Destroy the preview environment when the pull request is closed unmerged

cleanup_on_branch_delete
boolean
required

Destroy the preview environment when its branch is deleted

cleanup_on_inactivity
boolean
required

Destroy the preview environment after inactivity_days without a commit

inactivity_days
integer<int32>
required

Days without a commit before cleanup, when cleanup_on_inactivity is on

retention_days
integer<int32>
required

Days a preview environment is kept before it expires

retention_mode
string
required

after_pr_close (count from PR close) or from_creation

comment_on_github
boolean
required

Post the preview environment URL as a pull request comment. Always off in every_branch mode

clone_settings
object
required

What is copied from the parent application. Keys clone_variables, clone_secret_files and clone_security default to true when absent; addons and cronjobs default to copying all

tier
enum<string>
required

The CPU class preview environments that run without a resource take: 'hobby' (shared) or 'pro' (dedicated). Set with tier or size; until then it follows the application's

Available options:
hobby,
pro
size
string
required

The size, as GET /api/v1/workspace/pay_per_use/sizes names it, preview environments that run without a resource are created at. Null means the application's size

created_at
string<date-time>
required

Creation timestamp

updated_at
string<date-time>
required

Last update timestamp