ReferenceFlightcontrol APIDeploymentsCreate Deployment

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

MethodPath
POST/v1/deployments
Headers
AuthorizationBearer: [API key]
Content-Typeapplication/json

Full Endpoint URL https://api.flightcontrol.dev/v1/deployments

Body
ParameterTypeRequiredDescription
repoUrlstringYesThe URL of your Git repository.
branchstringYesThe Git branch to deploy.
commitstringOptionalOptional. The specific Git commit to deploy.
filterobject: check below for detailsOptionalFilters to specify which environments to deploy
forceNoCachebooleanOptionalWhen set to true, forces a fresh deployment without using cached builds.
servicesarray: check below for detailsOptionalThe service configuration overrides for this deployment.

The filter object

ParameterTypeRequiredDescription
projectIdstringOptionalIf provided, only deploy environments in this project.
environmentIdstringOptionalIf 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).

ParameterTypeRequiredDescription
idstringYesThe unique identifier for the service. (e.g., "cm6zi2fva001eh54nwlzubp9y")
imageTagstringOptional*The image tag to use for this service (e.g., "v1.2.3", "latest").
imageShastringOptional*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