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. |
services | array: check below for details | Optional | The service configuration overrides for this deployment. |
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. |
The services
array
The services
parameter allows you to override image tags or image SHA digests for specific services during deployment. This is only supported for services with buildType: "fromRepository"
.
Each service object must contain either imageTag
OR imageSha
(not both).
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Yes | The unique identifier for the service. (e.g., "cm6zi2fva001eh54nwlzubp9y" ) |
imageTag | string | Optional* | The image tag to use for this service (e.g., "v1.2.3" , "latest" ). |
imageSha | string | Optional* | The image SHA digest to use for this service (e.g., "sha256:1234567890abcdef..." ). |
*Either imageTag
or imageSha
must be provided for each service, but not both.
Request Examples
Basic Deployment
{
"repoUrl": "https://github.com/mycompany/myapp",
"branch": "main",
"commit": "abc123def456",
"filter": {
"projectId": "project-id-123"
}
}
Deployment with Image Tag Override
{
"repoUrl": "https://github.com/mycompany/myapp",
"branch": "main",
"commit": "abc123def456",
"filter": {
"projectId": "project-id-123"
},
"services": [
{
"id": "cm6zi2fva001eh54nwlzubp9y",
"imageTag": "v1.2.3"
},
{
"id": "cm6zi3gwa002eh54nwlzubp9z",
"imageTag": "latest"
}
]
}
Deployment with Image SHA Override
{
"repoUrl": "https://github.com/mycompany/myapp",
"branch": "main",
"commit": "abc123def456",
"filter": {
"projectId": "project-id-123"
},
"services": [
{
"id": "cm6zi2fva001eh54nwlzubp9y",
"imageSha": "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
},
{
"id": "cm6zi3gwa002eh54nwlzubp9z",
"imageTag": "v2.1.0"
}
]
}
Response Example
{
"deployments": [
{
"projectId": "project-id",
"deploymentId": "deployment-id",
"environmentId": "environment-id",
"commit": "abc123",
"branch": "main"
}
]
}
Response Conditions
Success
Errors