Skip to content

Common workflows

Practical recipes for the most common integrations. All examples assume a Bearer token in $TOKEN and the base URL https://app.cloudoptify.com/api/v1.

Terminal window
curl -H "Authorization: Bearer $TOKEN" \
"$BASE/cost/summary?from=2026-05-01&to=2026-05-31"

Returns totals, per-provider split, and the forecast for the window. Related reads: /cost/services, /cost/daily, /cost/forecast, /cost/comparison.

Terminal window
curl -H "Authorization: Bearer $TOKEN" "$BASE/insights"
curl -H "Authorization: Bearer $TOKEN" "$BASE/waste"
curl -H "Authorization: Bearer $TOKEN" "$BASE/recommendations"

Acknowledge a finding (requires write):

Terminal window
curl -X POST -H "Authorization: Bearer $TOKEN" "$BASE/insights/123/acknowledge"
Terminal window
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{ "name": "Platform Engineering" }' \
"$BASE/groups"

Then assign members via the group’s membership endpoints (Azure subscription IDs and AWS account IDs). Groups created by API behave exactly like portal-created ones — they appear in the global filter and group reports immediately.

Requires the run scope:

Terminal window
RUN_ID=$(curl -s -X POST -H "Authorization: Bearer $TOKEN" "$BASE/scans" | jq -r '.runId')
curl -H "Authorization: Bearer $TOKEN" "$BASE/scans/$RUN_ID"

The status endpoint reports the run’s state and result; GET /scans lists recent runs.

Budget alerts and scheduled reports support full CRUD under /alerts and /reports — create them from infrastructure-as-code, keep them in sync with your team list, or clean up programmatically.