Documentation

Reports & Analytics

Track cloud costs, savings from automated scheduling, and monitor resource utilization across all your connected accounts.

Dashboard Summary

GET
/reports/summary

Get an overall cost and savings summary for the current period.

Responsejson
{
  "data": {
    "totalCostUSD": 12450.50,
    "totalSavingsUSD": 3280.75,
    "resourceCount": 156,
    "period": "2025-01"
  }
}

Cost Trends

GET
/reports/trends

Get daily cost and savings trend data for charts and dashboards.

Responsejson
{
  "data": {
    "items": [
      {
        "date": "2025-01-15",
        "costUSD": 425.30,
        "savingsUSD": 112.50
      },
      {
        "date": "2025-01-16",
        "costUSD": 418.20,
        "savingsUSD": 119.80
      }
    ]
  }
}

Resource Costs

GET
/reports/costs/resources

Get per-resource cost breakdown.

Examplebash
curl "https://zopnight.com/api/reports/costs/resources?page=1&limit=20" \
  -H "Authorization: Bearer <token>"

Provider Summary

GET
/reports/providers/summary

Get cost and resource count breakdown by cloud provider.

Responsejson
{
  "data": {
    "aws": {
      "count": 85,
      "costUSD": 7200.00
    },
    "gcp": {
      "count": 42,
      "costUSD": 3150.50
    },
    "azure": {
      "count": 29,
      "costUSD": 2100.00
    }
  }
}

Resource Summary

GET
/reports/resources/summary

Get resource count hierarchy grouped by provider and cloud account.

Responsejson
{
  "data": {
    "providers": [
      {
        "name": "aws",
        "total": 85,
        "accounts": [
          {
            "id": "ca_001",
            "name": "Production AWS",
            "total": 60,
            "byType": {
              "aws-ec2": 25,
              "aws-rds": 8,
              "aws-eks": 3
            }
          }
        ]
      }
    ],
    "total": 156
  }
}

Monthly Snapshots

GET
/reports/snapshots

Get historical monthly report snapshots.

Responsejson
{
  "data": [
    {
      "id": "snap_001",
      "period": "2025-01",
      "totalCostUSD": 12450.50,
      "totalSavingsUSD": 3280.75,
      "resourceCount": 156,
      "createdAt": "2025-02-01T00:00:00Z"
    },
    {
      "id": "snap_002",
      "period": "2024-12",
      "totalCostUSD": 13100.00,
      "totalSavingsUSD": 2900.00,
      "resourceCount": 148,
      "createdAt": "2025-01-01T00:00:00Z"
    }
  ]
}

Team Budgets

Set monthly cost budgets for teams and track spending against them.

GET
/budgets/summary

Get organization-wide budget summary.

Responsejson
{
  "data": {
    "totalBudgetUSD": 25000.00,
    "totalSpendUSD": 18500.00,
    "percentUsed": 74.0,
    "budgetCount": 5,
    "overBudgetCount": 1
  }
}
GET
/budgets

List all team budgets.

POST
/budgets

Create a team budget.

Requestbash
curl -X POST https://zopnight.com/api/budgets \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "teamName": "Platform Team",
    "resourceGroupID": "grp_abc123",
    "monthlyBudgetUSD": 5000.00,
    "alertThresholdPercent": 80
  }'
Responsejson
{
  "data": {
    "id": "bgt_abc123",
    "teamName": "Platform Team",
    "resourceGroupID": "grp_abc123",
    "monthlyBudgetUSD": 5000.00,
    "alertThresholdPercent": 80,
    "currentSpendUSD": 3200.00,
    "remainingUSD": 1800.00,
    "percentUsed": 64.0,
    "status": "green",
    "createdAt": "2025-01-01T00:00:00Z",
    "updatedAt": "2025-01-20T08:00:00Z"
  }
}
PUT
/budgets/{budgetID}

Update a team budget.

DELETE
/budgets/{budgetID}

Delete a team budget.

Budget Status Indicators

StatusConditionDescription
greenSpend < alert thresholdSpending is within normal range
yellowSpend >= alert thresholdSpending has crossed the configured alert threshold
redSpend >= 100% of budgetBudget has been exceeded

Scheduler Events

View a log of scheduler-triggered events showing which schedules fired and what actions were taken.

GET
/events

List scheduler events.

Responsejson
{
  "data": [
    {
      "id": "evt_001",
      "scheduleID": "sch_abc123",
      "action": "stop",
      "triggeredAt": "2025-01-20T18:00:00Z",
      "resources": ["i-0abc123def456", "i-0def789abc012"],
      "status": "completed"
    }
  ]
}
POST
/events

Record a scheduler event (primarily used internally by the scheduler service).