Skip to content

Projects

Group repository configurations with shared cloud credentials.

Base path: /api/projects

Authentication: Bearer token required on all routes

List Projects

GET /api/projects/

List all projects for the authenticated user.

Response

json
{
  "success": true,
  "data": [
    {
      "_id": "proj1",
      "name": "AWS Production",
      "provider": "aws",
      "isDefault": true,
      "repoConfigCount": 3
    }
  ]
}

Example

bash
curl -H "Authorization: Bearer TOKEN" \
  https://api.controlinfra.com/api/projects/

Create Project

POST /api/projects/

Create a new project.

Request Body

FieldTypeRequiredDescription
namestringYesProject name
providerstringYesCloud provider (aws, azure, gcp)

Response

json
{
  "success": true,
  "data": {
    "_id": "proj2",
    "name": "Azure Staging",
    "provider": "azure",
    "isDefault": false
  }
}

Get Project

GET /api/projects/:id

Get a single project.

Path Parameters

ParameterTypeDescription
idstringProject ID

Update Project

PUT /api/projects/:id

Update project settings.

Path Parameters

ParameterTypeDescription
idstringProject ID

Request Body

FieldTypeRequiredDescription
namestringNoUpdated name

Update Project Credentials

PUT /api/projects/:id/credentials

Update cloud credentials for a project.

Path Parameters

ParameterTypeDescription
idstringProject ID

Request Body

Depends on the project's provider. See Credentials for field details.

Set Default Project

PUT /api/projects/:id/default

Set a project as the default.

Path Parameters

ParameterTypeDescription
idstringProject ID

Delete Project

DELETE /api/projects/:id

Delete a project. Repository configs in this project must be moved first.

Path Parameters

ParameterTypeDescription
idstringProject ID