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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Project name |
provider | string | Yes | Cloud 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
| Parameter | Type | Description |
|---|---|---|
id | string | Project ID |
Update Project
PUT /api/projects/:id
Update project settings.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Project ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Updated name |
Update Project Credentials
PUT /api/projects/:id/credentials
Update cloud credentials for a project.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Project 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
| Parameter | Type | Description |
|---|---|---|
id | string | Project ID |
Delete Project
DELETE /api/projects/:id
Delete a project. Repository configs in this project must be moved first.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Project ID |