Bc monitoring read reports api

From breatheco-de/apiv2 · View interactive version

Bc monitoring read reports api is an AI agent skill from the GitHub repository breatheco-de/apiv2. Use when retrieving monitoring report data for dashboards or frontend report screens via `/v1/monitoring/report*`; do NOT use for creating new report generators or running `generate_report`.

How to use this skill

Skill file

Skill: Read Monitoring Reports API

When to Use

Use this skill when the task is to fetch monitoring report metadata, list rows, row detail, or summary metrics from the monitoring report endpoints.

Use it when frontend code needs filter/sort/pagination behavior for monitoring reports.

If the request is specifically about acquisition report interpretation (funnel tiers, top assets/workshops, attribution patterns), prefer bc-monitoring-read-report-acquisition.

Do NOT use this skill to build a new report type or modify report generation logic.

Do NOT use this skill for non-monitoring report domains such as admissions, commission, or marketing report endpoints.

Concepts

Workflow

  1. Resolve scope and auth before calling any endpoint.
  1. Discover available report types.
  1. Fetch report rows for a selected type.
  1. Fetch summary metrics when needed by widgets/cards.
  1. Fetch one row detail for drill-down panels.
  1. Trigger async generation only when explicitly requested.
  1. Poll generation job state and queue health.
  1. Handle validation failures predictably.

Endpoints

1) Discover report types

Request context example

{
  "headers": {
    "Authorization": "Token 4f8f5b2d8e4a",
    "Academy": "1",
    "Accept-Language": "en"
  },
  "query": {}
}

Response example

[
  {
    "slug": "churn",
    "label": "Churn Risk Report",
    "description": "Daily user churn risk scores and alert signals",
    "filters": ["academy", "date", "risk_level", "user", "min_score", "max_score"],
    "sort_fields": ["report_date", "-report_date", "churn_risk_score", "-churn_risk_score", "risk_level", "-risk_level", "created_at", "-created_at", "user_id", "-user_id"],
    "supports_detail": true,
    "supports_summary": true
  },
  {
    "slug": "acquisition",
    "label": "Acquisition Report",
    "description": "Daily acquisition snapshots (forms, invites, event RSVP, event attendance) with funnel tiers",
    "filters": ["academy", "date", "date_start", "date_end", "source_type", "user", "utm_source", "utm_campaign", "deal_status", "asset_slug", "event_slug", "funnel_tier"],
    "sort_fields": ["report_date", "-report_date", "created_at", "-created_at", "source_type", "-source_type", "funnel_tier", "-funnel_tier", "user_id", "-user_id"],
    "supports_detail": true,
    "supports_summary": true
  }
]

2) List report rows

Request context example

{
  "path_params": {
    "report_type": "churn"
  },
  "headers": {
    "Authorization": "Token 4f8f5b2d8e4a",
    "Academy": "1"
  },
  "query": {
    "risk_level": "CRITICAL",
    "min_score": "70",
    "sort": "-churn_risk_score",
    "limit": "20",
    "offset": "0"
  }
}

Response example

[
  {
    "id": 118,
    "user_id": 2033,
    "user_email": "student@example.com",
    "academy_id": 1,
    "report_date": "2026-04-13",
    "churn_risk_score": 82.5,
    "risk_level": "CRITICAL",
    "days_since_last_activity": 11,
    "login_count_7d": 1,
    "assignments_completed_7d": 0,
    "has_payment_issues": true,
    "subscription_status": "PAYMENT_ISSUE"
  }
]

3) Get report summary

Request context example

{
  "path_params": {
    "report_type": "churn"
  },
  "headers": {
    "Authorization": "Token 4f8f5b2d8e4a",
    "Academy": "1"
  },
  "query": {
    "date": "2026-04-13"
  }
}

Response example

{
  "total": 142,
  "average_score": 38.4,
  "payment_risk_count": 9,
  "unresolved_alert_count": 16,
  "risk_levels": {
    "LOW": 74,
    "MEDIUM": 41,
    "HIGH": 19,
    "CRITICAL": 8
  }
}

Acquisition summary example

{
  "report_row_count": 72,
  "unique_identities": 59,
  "cross_academy_identities": 11,
  "by_source_type": {
    "FORM_ENTRY": 18,
    "FORM_ENTRY_WON": 4,
    "USER_INVITE": 54,
    "EVENT_RSVP": 12,
    "EVENT_ATTENDED": 8
  },
  "by_funnel_tier": {
    "1": 6,
    "2": 14,
    "3": 10,
    "4": 42
  },
  "by_funnel_tier_label": {
    "won_or_sale": 6,
    "strong_lead": 14,
    "soft_lead": 10,
    "nurture_invite": 42
  },
  "by_funnel_tier_identities": {
    "1": 12,
    "2": 16,
    "3": 7,
    "4": 24
  },
  "by_funnel_tier_label_identities": {
    "won_or_sale": 12,
    "strong_lead": 16,
    "soft_lead": 7,
    "nurture_invite": 24
  },
  "top_asset_slugs": [{"asset_slug": "interactive-python", "count": 19}],
  "top_event_slugs": [{"event_slug": "full-stack-with-ai-workshop-part-2-copy", "count": 12}],
  "top_utm_sources": [{"utm_source": "an", "count": 17}],
  "top_utm_campaigns": [{"utm_campaign": "120239918684820575", "count": 11}],
  "top_conversion_urls": [{"conversion_url": "/es/bootcamp/change-your-career-in-15-days-self-paced", "count": 8}],
  "by_deal_status": {"WON": 4},
  "team_seat_invite_count": 3
}

4) Get one report row detail

Request context example

{
  "path_params": {
    "report_type": "churn",
    "report_id": 118
  },
  "headers": {
    "Authorization": "Token 4f8f5b2d8e4a",
    "Academy": "1"
  },
  "query": {}
}

5) Trigger report generation job

Request context example

{
  "path_params": {
    "report_type": "acquisition"
  },
  "headers": {
    "Authorization": "Token 4f8f5b2d8e4a",
    "Academy": "1"
  },
  "body": {
    "date_start": "2026-04-01",
    "date_end": "2026-04-30"
  }
}

Response example

{
  "id": 42,
  "report_type": "acquisition",
  "status": "PENDING",
  "status_message": "Queued",
  "academy_id": 1,
  "date_start": "2026-04-01",
  "date_end": "2026-04-30",
  "progress_current": 0,
  "progress_total": 0,
  "generated_rows": 0
}

6) Poll one generation job

7) List generation jobs queue

Response example (list item)

{
  "id": 42,
  "report_type": "acquisition",
  "status": "PENDING",
  "status_message": "Queued",
  "academy_id": 1,
  "parent_id": null,
  "batch_id": "550e8400-e29b-41d4-a716-446655440000",
  "children_count": 0,
  "included_academies": null,
  "date_start": "2026-04-01",
  "date_end": "2026-04-30",
  "progress_current": 0,
  "progress_total": 0,
  "generated_rows": 0,
  "created_at": "2026-04-14T08:15:21Z",
  "updated_at": "2026-04-14T08:15:21Z"
}

Edge Cases

Checklist

  1. [ ] Called GET /v1/monitoring/report and selected a valid report_type.
  2. [ ] Sent Authorization and Academy headers on every request.
  3. [ ] Used only allowed filters and sort fields from discovery metadata.
  4. [ ] Queried list and summary with the same filter scope when showing one dashboard view.
  5. [ ] Used detail endpoint only after obtaining report_id from list results.
  6. [ ] Handled 400/403/404 errors with explicit retry behavior.
  7. [ ] For generation, used exactly one strategy (date, range, or days_back).
  8. [ ] Used force=true only when intentionally creating a duplicate regeneration job.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.