ReferenceFlightcontrol APIProjectsEdit Preview Environment

Edit Preview Environment API

Use this API to edit an existing preview environment in your project.

API Description

MethodPath
POST/v1/projects/{projectId}/preview-environment
Headers
AuthorizationBearer: [API key]

Full Endpoint URL https://api.flightcontrol.dev/v1/projects/{projectId}/preview-environment

Body

ParameterRequiredTypeDescription
nameoptionalstringThe environment name displayed in Flightcontrol dashboard.
sourceoptionalobject: check below for detailThe source used to trigger preview environments.

The source object

ParameterRequiredTypeDescription
triggeroptional”push” or “manual”Whether the environment is deployed automatically with every Git push (Git push to deploy) or deployed manually through the dashboard or deploy hooks
filteroptionalobject: check below for detailThe filter used to trigger preview environments.

The filter object

ParameterRequiredTypeDescription
labelsoptionalarray of stringsThe pull request labels to be used to trigger preview environments.
toBranchesoptionalarray of stringsBase branches to be used to trigger preview environments.
fromBranchesoptionalarray of stringsThe branches to be used to trigger preview environments.
watchPathsoptionalarray of stringsThe repository paths to be used to trigger preview environments.

Response Example

[
  {
    "message": "Preview Environment updated successfully"
  }
]

Response Conditions

Success

Errors