# Control Center API Endpoints

Complete reference for Control Center management endpoints.

## Workspace Management

### Create Workspace

```http
POST /v1/workspaces
Content-Type: application/json

{
  "name": "production",
  "description": "Production infrastructure",
  "owner": "platform-team",
  "tags": ["env:prod", "tier:critical"]
}
```

Response: `201 Created`

### List Workspaces

```http
GET /v1/workspaces?limit=10&offset=0
```

Response: `200 OK`

```json
{
  "workspaces": [
    {
      "id": "ws-001",
      "name": "production",
      "owner": "platform-team",
      "created_at": "2026-01-01T00:00:00Z"
    }
  ],
  "total": 3
}
```

### Get Workspace Details

```http
GET /v1/workspaces/:id
```

### Update Workspace

```http
PATCH /v1/workspaces/:id
{
  "description": "Updated description",
  "owner": "new-team"
}
```

### Delete Workspace

```http
DELETE /v1/workspaces/:id
```

## Infrastructure Resources

### List Resources

```http
GET /v1/workspaces/:id/resources?type=server&limit=20
```

Response: `200 OK`

```json
{
  "resources": [
    {
      "id": "res-001",
      "type": "server",
      "name": "web-01",
      "provider": "aws",
      "status": "running",
      "created_at": "2026-01-10T12:00:00Z"
    }
  ],
  "total": 50
}
```

### Get Resource Details

```http
GET /v1/workspaces/:id/resources/:resource-id
```

### Create Resource

```http
POST /v1/workspaces/:id/resources
{
  "type": "server",
  "name": "web-02",
  "provider": "aws",
  "config": {
    "instance_type": "t3.large",
    "image": "ubuntu-22.04"
  }
}
```

### Delete Resource

```http
DELETE /v1/workspaces/:id/resources/:resource-id
```

## Settings & Configuration

### Get Workspace Settings

```http
GET /v1/workspaces/:id/settings
```

### Update Settings

```http
PATCH /v1/workspaces/:id/settings
{
  "auto_backup": true,
  "backup_retention_days": 30,
  "require_approval": true
}
```

## Vault Management

### List Secrets

```http
GET /v1/workspaces/:id/vault/secrets
```

### Store Secret

```http
POST /v1/workspaces/:id/vault/secrets
{
  "name": "db-password",
  "value": "secret-value",
  "metadata": {
    "type": "database",
    "rotation_enabled": true
  }
}
```

### Retrieve Secret

```http
GET /v1/workspaces/:id/vault/secrets/:name
```

### Delete Secret

```http
DELETE /v1/workspaces/:id/vault/secrets/:name
```

## Related Documentation

- [REST API Overview](./rest-api.md)
- [Orchestrator API](./orchestrator-endpoints.md)
- [Workspace Management](../features/workspace-management.md)
