Reference
Deployments
Deploy Hooks

Deploy Hooks API

Flightcontrol allows you to trigger deployments for any environment in your project using the Deploy Hooks API.

Using an HTTPS GET request, you can start a deployment. The response returns the deployment's unique ID.

You can poll the deployment's status with the Get Deployment API.

Note: Deploy hooks will no longer build and deploy all services overriding watchPaths. If you want to force deploying all your services overriding the watchPaths settings then pass a force=true query string parameter.

Normal Environments

  1. Go to the environment settings page by clicking Edit Environment Edit Environment button in dashboard
  2. Locate the Deploy Hooks form, enter a name to remember it by, then click Create Deploy Hook Create Deploy Hook form in dashboard

To trigger a deployment with this hook, make an HTTPS GET request to the generated url

MethodPathPayload
GET/api/deploy-hook/[envId]/[secret]?force=[force]None

Parameter Definitions

ParameterTypeDescription
envIdintThe unique ID for your environment. You can find it in the Flightcontrol Dashboard.
secretstringThe secret key used to authenticate and identify the HTTP request. It will be generated for you when you create the hook.
forcebooleanThe flag to force deploy all services regardless of the watchPaths settings.

Preview Environments

  1. Go to the preview environment settings page by clicking Edit Preview Environments

    Edit Preview Environment button in dashboard
  2. Locate the Deploy Hooks form, enter a name to remember it by, then click Create Deploy Hook

    Create Deploy Hook form in dashboard

To trigger a deployment with this hook, make an HTTPS GET request to the generated url with these parameters

MethodPathPayload
GET/api/deploy-hook/[previewEnvId]/[secret]/[prNumber]/[commitSHA]?force=[force]None

All preview environments have the same deploy hook link. However, that link requires two additional parameters which are the prNumber and commitSHA.

Parameter Definitions

ParameterTypeDescription
previewEnvIdintThis is the unique ID for your preview environment. You can find it in the Flightcontrol Dashboard.
secretstringThe secret key used to authenticate and identify the HTTP request. It will be generated for you when you create the hook.
prNumberintThe pull request number on Github, it is used to identify the correct environment that needs to be deployed.
commitSHAstringThe git commit SHA to deploy.
forcebooleanThe flag to force deploy all services regardless of the watchPaths settings.

Response Example

{
  "success": "true",
  "deploymentId": "clcpcxekt000lc9ojqtgtc26y"
}

Response Conditions

Success

Errors