Create Project API
Use this API to automate the creation of a new project in your Flightcontrol account.
Prerequisites
To use the Create Project API, you must authenticate with an API key generated by a user who:
- Has at least the Developer role in the organization
- Has access to the git repository you are going to use
- And Flightcontrol must have access to that git repository through the GitHub or GitLab integration
API Description
Method | Path |
---|---|
POST | /v1/projects |
Headers | |
---|---|
Authorization | Bearer: [API key] |
Content-Type | application/json |
Full Endpoint URL https://api.flightcontrol.dev/v1/projects
Body | ||||
---|---|---|---|---|
Parameter | Type | Values | Required | Description |
name | string | Yes | The project name displayed in the Flightcontrol dashboard. | |
repoUrl | string | Yes | The URL of your Git repository. | |
awsAccountId | string | Yes | The Flightcontrol unique id for the connected AWS account where your project will be deployed. | |
codeSource | object: see below for detail | Yes | The Git provider configuration for your project. | |
configType | string | "gui" , "iac" | Yes | The type of configuration to use for your project. |
config | object: see below for detail | Required when configType is “gui” | Contains project configuration. | |
configFilePath | string | Required when configType is “iac” | Path to your configuration file. | |
configFileBranch | string | Required when configType is “iac” | Branch containing your configuration file. |
The config
object
This object follows the Flightcontrol configuration schema used in the flightcontrol.json
file, and is used to configure your project and allows you to configure and control the project in Flightcontrol’s dashboard.
The codeSource
object
Parameter | Type | Values | Required | Description |
---|---|---|---|---|
provider | string | "github" , "gitlab" , "gitlab_self_hosted" | Yes | The Git provider to use for your project. |
host | string | Required when provider is “gitlab_self_hosted” | The Self-Hosted GitLab instance host. |
Response Example
{
"id": "crkx7acm00003f6gobvidq2i",
"organizationId": "cx7xb7acm00003f6gobvidq2i"
}
Response Conditions
Success
Errors
Guide to Creating and Deploying a New Project
Step 1: Create an AWS Account
Skip to step 3 if you already have an AWS account ID connected to Flightcontrol.
- Use the Create AWS Account API to create a new AWS account
curl --request POST \
--url https://api.flightcontrol.dev/v1/aws-accounts \
--header 'authorization: Bearer ${TOKEN}' \
--header 'content-type: application/json' \
--data '{
"name": "My AWS Account"
}'
- The response will contain the connection stack link that you can use to connect your AWS account to Flightcontrol:
{
"id": "cmadqj0k400000cjs6wwu2n5y",
"name": "My AWS Account",
"status": "AWAITING_CONNECTION",
"cloudFormation": {
"consoleUrl": "https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/review?templateUrl=https://fc-public-cf-templates.s3.us-west-2.amazonaws.com/flightcontrol-cloudformation-v2.json",
"template": {
"url": "https://fc-public-cf-templates.s3.us-west-2.amazonaws.com/flightcontrol-cloudformation-v2.json",
"stackName": "flightcontrol-access-cmadqj0k400000cjs6wwu2n5y",
"region": "us-east-1",
"parameters": {
"FlightcontrolId": "cmadqj0k400000cjs6wwu2n5y"
}
}
}
}
- Create the cloudformation stack in your AWS account to authenticate Flightcontrol
- Open the link in the
cloudFormation.consoleUrl
field of the response. - Click on the “Create stack” button.

Step 2: Wait for AWS Account to Be Connected
Use the Get AWS Account API to check the status of the AWS account.
curl --request GET \
--url https://api.flightcontrol.dev/v1/aws-accounts/${AWS_ACCOUNT_ID} \
--header 'Authorization: Bearer ${TOKEN}'
The response will contain the AWS account status:
{
"status": "CONNECTED"
}
When the status is CONNECTED
, you can proceed to the next step.
Step 3: Create a Project
-
Create a project that will be configurable via the Flightcontrol dashboard.
curl --request POST \ --url https://api.flightcontrol.dev/v1/projects \ --header 'Authorization: Bearer ${TOKEN}' \ --header 'Content-Type: application/json' \ --data '{ "name": "My Project", "awsAccountId": "cm7xb7ocr000210k0cso2uo4d", "repoUrl": "https://github.com/org/repo", "codeSource": { "provider": "github" }, "configType": "gui", "config": {"$schema":"https://app.flightcontrol.dev/schema.json","environments":[{"id":"production","name":"Lambda","region":"eu-south-1","source":{"branch":"main","pr":false,"trigger":"push"},"services":[{"ci":{"type":"ec2","storageIops":3000,"storageType":"gp3","instanceStorage":30,"storageThroughput":125},"id":"lambda-dev","name":"Lambda","type":"lambda-function","lambda":{"fnUrl":{"enabled":false},"memory":128,"packageType":"image","timeoutSecs":3},"basePath":".","buildType":"docker","envVariables":{},"dockerContext":".","dockerfilePath":"Dockerfile","includeEnvVariablesInBuild":true,"injectEnvVariablesInDockerfile":true}]}]} }'
- The response will contain the project details:
{ "id": "cm7xb7acm00003f6gobvidq2i", "organizationId": "cx7xb7acm00003f6gobvidq2i", }
Step 4: Deploy the Project
- Use the Create Deployment API to deploy the project.
curl --request POST \
--url https://api.flightcontrol.dev/v1/deployments \
--header 'Authorization: Bearer ${TOKEN}' \
--header 'Content-Type: application/json' \
--data '{
"repoUrl": "https://github.com/org/repo",
"branch": "main",
"filter": {
"projectId": "cm7xb7acm00003f6gobvidq2i"
}
}'
- The response will contain the deployment details:
{
"id": "cm7xb7acm00003f6gobvidq2i",
"projectId": "cm7xb7acm00003f6gobvidq2i",
"branch": "main",
"commit": "02f153b"
}