Create Deployment API
Use this API to create a new deployment for your project’s environments. This API can deploy to multiple environments at once based on the provided filters.
- The API will deploy to all valid environments that match the provided filters. If no filters are provided, it will deploy to all environments associated with the repository.
- The API supports deploying to both standard environments and preview environments.
- If a deployment fails for a specific environment, the error will be included in the response for that environment, but other deployments will still be initiated.
API Description
Method | Path |
---|---|
POST | /v1/deployments |
Headers | |
---|---|
Authorization | Bearer: [API key] |
Content-Type | application/json |
Full Endpoint URL https://api.flightcontrol.dev/v1/deployments
Body | |||
---|---|---|---|
Parameter | Type | Required | Description |
repoUrl | string | Yes | The URL of your Git repository. |
branch | string | Yes | The Git branch to deploy. |
commit | string | Optional | Optional. The specific Git commit to deploy. |
filter | object: check below for details | Optional | Filters to specify which environments to deploy |
forceNoCache | boolean | Optional | When set to true , forces a fresh deployment without using cached builds. |
The filter
object
Parameter | Type | Required | Description |
---|---|---|---|
projectId | string | Optional | If provided, only deploy environments in this project. |
environmentId | string | Optional | If provided, only deploy this specific environment. |
Response Example
{
"deployments": [
{
"projectId": "project-id",
"deploymentId": "deployment-id",
"environmentId": "environment-id",
"commit": "abc123",
"branch": "main"
}
]
}
Response Conditions
Success
Errors