Edit Preview Environment API
Use this API to edit an existing preview environment in your project.
API Description
Method | Path |
---|---|
POST | /v1/projects/{projectId}/preview-environment |
Headers | |
---|---|
Authorization | Bearer: [API key] |
Full Endpoint URL https://api.flightcontrol.dev/v1/projects/{projectId}/preview-environment
Body
Parameter | Required | Type | Description |
---|---|---|---|
name | optional | string | The environment name displayed in Flightcontrol dashboard. |
source | optional | object: check below for detail | The source used to trigger preview environments. |
The source
object
Parameter | Required | Type | Description |
---|---|---|---|
trigger | optional | ”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 |
filter | optional | object: check below for detail | The filter used to trigger preview environments. |
The filter
object
Parameter | Required | Type | Description |
---|---|---|---|
labels | optional | array of strings | The pull request labels to be used to trigger preview environments. |
toBranches | optional | array of strings | Base branches to be used to trigger preview environments. |
fromBranches | optional | array of strings | The branches to be used to trigger preview environments. |
watchPaths | optional | array of strings | The repository paths to be used to trigger preview environments. |
Response Example
[
{
"message": "Preview Environment updated successfully"
}
]
Response Conditions
Success
Errors