Reports API

Generate and retrieve detailed reports from your test scans.

🎯 Not a Developer? Start Here

You don't need to write code yourself. Copy the prompts below and paste them into Claude, ChatGPT, Cursor, or any AI coding assistant. Your AI will read the docs and build what you need.

Step 1: Copy a prompt below
Step 2: Paste into your AI assistant
Step 3: AI builds it for you

Quick Start Prompts

Common reporting tasks you can accomplish with a single prompt.

📊 Build a Security Dashboard

Create a full dashboard showing your security scan results with severity indicators.

Read the Bugrit Reports API docs at https://bugrit.com/docs/api-reference/reports

Build a security dashboard component for my app:

1. Show the latest scan results from GET /api/v1/scans?limit=1
2. Display a summary card with:
   - Overall status (green if summary.critical === 0, red otherwise)
   - Severity counts as colored badges
   - Last scan timestamp
3. List all findings with severity color coding
4. Include a "View Full Report" button that opens details

Use my existing component library. Store API key in env vars.
My stack: [YOUR_STACK]
👩‍💻 Technical Details (for developers)

API Endpoint

GET/api/v1/scans/:scanId/report

Example Code

// Fetch the latest scan
const scansRes = await fetch('/api/v1/scans?limit=1', {
  headers: { 'Authorization': `Bearer ${process.env.BUGRIT_API_KEY}` }
});
const { data: scans } = await scansRes.json();

// Get the full report
if (scans[0]?.status === 'completed') {
  const reportRes = await fetch(`/api/v1/scans/${scans[0].id}/report`, {
    headers: { 'Authorization': `Bearer ${process.env.BUGRIT_API_KEY}` }
  });
  const { data: report } = await reportRes.json();

  // report.summary.critical, report.summary.high, etc.
  // report.findings[].title, severity, file, line
}

📈 Scan History with Trends

Show how your security posture changes over time with a timeline view.

Read the Bugrit API docs:
- Scans: https://bugrit.com/docs/api-reference/scans
- Reports: https://bugrit.com/docs/api-reference/reports

Create a scan history timeline component:

1. Fetch GET /api/v1/scans?limit=20 for recent scans
2. Display as timeline or table showing:
   - Scan date (from createdAt)
   - Status badge (completed/failed/running)
   - Issue counts with severity colors
   - Trend arrow (up if more issues, down if fewer)
3. On click, show full report details
4. Add a chart showing total issues over time

Handle loading and empty states.
My stack: [YOUR_STACK]
👩‍💻 Technical Details (for developers)

Response Structure

// GET /api/v1/scans response
{
  "data": [
    {
      "id": "scn-abc123",
      "status": "completed",
      "summary": {
        "critical": 2,
        "high": 5,
        "medium": 12,
        "low": 28,
        "total": 47
      },
      "createdAt": "2024-01-15T10:00:00Z",
      "completedAt": "2024-01-15T10:05:00Z"
    }
  ]
}

🔔 Admin Dashboard Widget

Add a compact security status widget to your existing admin panel.

Read the Bugrit Reports API at https://bugrit.com/docs/api-reference/reports

Add a security status widget to my admin dashboard:

1. Fetch latest scan: GET /api/v1/scans?limit=1
2. Create a small card showing:
   - Status text: "Secure" (green) or "Issues Found" (red)
   - Badge with critical + high count
   - Last scan date
3. Hover/click shows full severity breakdown
4. Auto-refresh every 5 minutes
5. Link to full security report page

Keep it compact - this is a sidebar widget.
My stack: [YOUR_STACK]

🤖 AI Intelligence Reports

Paid Feature: AI Intelligence Reports require Starter tier or above. Get executive summaries, smart prioritization, and actionable recommendations.

📝 Executive Summary for Stakeholders

Generate a non-technical report that managers and executives can understand.

Read the Bugrit AI Reports API at https://bugrit.com/docs/api-reference/reports

Build an executive summary page for stakeholders:

1. Call GET /api/v1/reports/ai?scan_id=SCAN_ID&format=executive
2. Display the executiveSummary object:
   - Headline (main message)
   - Risk level indicator (healthy/elevated/high/critical)
   - Key metrics (total issues, critical count, compliance status)
   - Top 3 concerns as a list
   - Immediate actions required
   - Estimated fix time
3. Use professional styling (no technical jargon)
4. Add export to PDF button
5. Include trend comparison if previous scan available

This is for non-technical stakeholders.
My stack: [YOUR_STACK]
👩‍💻 Technical Details (for developers)

API Endpoint

GET/api/v1/reports/ai?scan_id=:scanId&format=executive

Response Structure

{
  "scanId": "scn-xyz789",
  "generatedAt": "2024-01-15T10:35:00Z",
  "executiveSummary": {
    "headline": "3 Critical Security Issues Require Immediate Attention",
    "riskLevel": "high",
    "riskScore": 72,
    "keyMetrics": {
      "totalIssues": 47,
      "criticalCount": 3,
      "securityRisk": "High - SQL injection detected",
      "complianceStatus": "Failing - OWASP violations",
      "technicalDebt": "Medium - 12 hours to fix"
    },
    "topConcerns": [
      "SQL injection in authentication",
      "Stored XSS in comments",
      "Exposed API keys"
    ],
    "positiveNotes": [
      "No critical dependency vulnerabilities",
      "Good test coverage (85%)"
    ],
    "immediateActions": [
      "Sanitize inputs in /api/auth",
      "Implement CSP headers",
      "Move secrets to env vars"
    ],
    "estimatedFixTime": "2-3 hours for critical issues"
  },
  "format": "executive"
}

🛠️ Developer Action Items

Get a prioritized to-do list with specific files and line numbers to fix.

Read the Bugrit AI Reports API at https://bugrit.com/docs/api-reference/reports

Create a developer task list from AI analysis:

1. Call GET /api/v1/reports/ai?scan_id=SCAN_ID&format=full
2. Display developerReport.actionItems as a task list:
   - Priority order (1 = most critical)
   - Title and description
   - File path + line number (link to code)
   - Estimated effort
   - Impact level
3. Show file health scores (developerReport.fileHealth)
4. Include code patterns section showing repeated issues
5. Add checkboxes to track completion

Make items clickable to expand details.
My stack: [YOUR_STACK]
👩‍💻 Technical Details (for developers)

Developer Report Structure

"developerReport": {
  "summary": "Security scan found 47 issues across 12 files...",
  "fileHealth": [
    {
      "file": "src/api/users.ts",
      "score": 45,
      "issueCount": 8,
      "topIssues": ["SQL injection", "Missing validation"],
      "trend": "declining"
    }
  ],
  "actionItems": [
    {
      "id": "act-001",
      "priority": 1,
      "title": "Fix SQL injection in user lookup",
      "description": "User input is directly concatenated...",
      "file": "src/api/users.ts",
      "line": 45,
      "effort": "30 minutes",
      "impact": "Critical - prevents DB access",
      "autoFixAvailable": true
    }
  ],
  "codePatterns": [
    {
      "pattern": "Unsanitized SQL queries",
      "occurrences": 3,
      "severity": "critical",
      "affectedFiles": ["src/api/users.ts", "src/api/posts.ts"]
    }
  ]
}

Generate New AI Analysis

Trigger AI analysis for any completed scan.

Read the Bugrit AI Reports API at https://bugrit.com/docs/api-reference/reports

Add an "Analyze with AI" button to my scan results page:

1. Button appears for completed scans
2. On click, POST to /api/v1/reports/ai with:
   { "scanId": "THE_SCAN_ID", "format": "full" }
3. Show loading state during generation
4. On success, redirect to AI report view
5. Handle errors (e.g., tier limits, incomplete scans)

The button should be prominent but not intrusive.
My stack: [YOUR_STACK]
👩‍💻 Technical Details (for developers)

API Endpoint

POST/api/v1/reports/ai

Request Body

{
  "scanId": "scn-xyz789",
  "format": "full"  // "full" | "summary" | "executive"
}

Format Options

FormatIncludes
fullEverything: intelligence, executive summary, developer report
summaryExecutive summary + condensed intelligence
executiveExecutive summary only (fastest)

Standard Reports

Basic report endpoints available on all tiers.

📚 List All Reports

Build a reports archive or history page.

Read the Bugrit Reports API at https://bugrit.com/docs/api-reference/reports

Create a reports list page:

1. Fetch GET /api/v1/reports with optional filters:
   - ?applicationId=xxx to filter by app
   - ?limit=20 for pagination
2. Display as a table with columns:
   - Report date
   - Application name
   - Total issues
   - Critical/High count
3. Click row to view full report
4. Add filters dropdown for application
5. Include pagination

My stack: [YOUR_STACK]
👩‍💻 Technical Details (for developers)

API Endpoint

GET/api/v1/reports

Query Parameters

ParameterTypeDescription
applicationIdstringFilter by application
limitintegerMax results (default: 20)

📄 Get Report Details

Display a full report with all findings.

Read the Bugrit Reports API at https://bugrit.com/docs/api-reference/reports

Create a detailed report view page:

1. Fetch GET /api/v1/reports/:reportId
2. Show summary section:
   - Pass rate percentage as progress bar
   - Severity breakdown as colored badges
   - Scan duration
3. Show findings as expandable cards:
   - Severity icon and color
   - Title and description
   - File path + line number
   - Tool that detected it
4. Add filters: by severity, by category
5. Include "Export to PDF" button

My stack: [YOUR_STACK]
👩‍💻 Technical Details (for developers)

API Endpoint

GET/api/v1/reports/:reportId

Response Structure

{
  "success": true,
  "data": {
    "id": "rpt-abc123",
    "scanId": "scn-xyz789",
    "projectId": "prj-abc123",
    "summary": {
      "critical": 2,
      "high": 5,
      "medium": 12,
      "low": 28,
      "total": 47,
      "passRate": 92,
      "duration": 120000
    },
    "findings": [
      {
        "id": "fnd-001",
        "title": "SQL Injection vulnerability",
        "severity": "critical",
        "category": "security",
        "file": "src/api/users.ts",
        "line": 45,
        "tool": "eslint-security"
      }
    ],
    "generatedAt": "2024-01-15T10:35:00Z"
  }
}

Report Data Reference

Understanding the data helps you build better UIs.

What Each Field Is For

Quick reference for building your UI.

Read the Bugrit Reports API at https://bugrit.com/docs/api-reference/reports

Help me understand the report response structure so I can build a good UI:

1. What fields are in summary vs findings?
2. How should I color code severities?
3. What's the difference between report ID and scan ID?
4. How do I link to the specific line of code?
5. What does passRate represent?

Explain with examples of how to display each field.
👩‍💻 Technical Reference
FieldUI Usage
summary.critical/high/medium/lowBadge counts, status indicators
summary.passRateProgress bars, health scores (0-100)
findings[].severityColor: critical=red, high=orange, medium=yellow, low=blue
findings[].file + lineLink directly to code location in your repo
findings[].toolShow which scanner found it (eslint, semgrep, etc.)
generatedAt"Last scanned 2 hours ago" relative time

💡 Why Reports Matter

Reports turn raw scan data into actionable insights. Here's what you can build:

  • Security dashboards: Show your team the current security posture at a glance
  • Embedded widgets: Display scan status directly in your admin panel
  • Trend tracking: Show improvement (or regression) over time
  • Executive reports: Generate non-technical summaries for stakeholders