Power Groups
Logical grouping mechanism for organizing Sun Sources by location, purpose, or any user-defined criteria.
Base Route: /api/powergroups
Authorization: Required (all endpoints)
List Power Groups
Returns all Power Groups owned by the authenticated user.
GET /api/powergroups
Response 200 OK
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Home Installation",
"description": "All panels on the main residence",
"logoUrl": "https://minio.ampra.solar/uploads/user123/logo.png",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-06-20T14:22:00Z",
"sunSourceCount": 3
}
]
Get Power Group
Returns a single Power Group by ID.
GET /api/powergroups/{id}
Response 200 OK
Returns a single PowerGroupDto.
Create Power Group
POST /api/powergroups
Request Body
{
"name": "Home Installation",
"description": "All panels on the main residence",
"logoUrl": "https://minio.ampra.solar/uploads/user123/logo.png"
}
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Group name |
description | string | No | Description |
logoUrl | string | No | Logo URL (uploaded via /api/upload/image) |
Response 201 Created
Returns the created PowerGroupDto with Location header.
Update Power Group
PUT /api/powergroups/{id}
Request Body
{
"name": "Updated Name",
"description": "Updated description",
"logoUrl": "https://minio.ampra.solar/uploads/user123/new-logo.png"
}
Response 200 OK
Returns the updated PowerGroupDto.
Delete Power Group
Deletes a Power Group. Sun Sources assigned to this group are unassigned (not deleted) — their powerGroupId is set to null.
DELETE /api/powergroups/{id}
Response 204 No Content
Response Schema: PowerGroupDto
interface PowerGroupDto {
id: string; // UUID
name: string;
description: string | null;
logoUrl: string | null;
createdAt: string; // ISO 8601
updatedAt: string; // ISO 8601
sunSourceCount: number; // Count of assigned Sun Sources
}