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.

The filter object

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