Reports API
Generate compliance reports and access analytics data.
Generate Report
POST /api/v1/reports
Generate a new compliance report.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | compliance_summary, framework, evidence, risk, audit_trail |
framework_id | UUID | No | Required for framework type |
start_date | datetime | No | Start of date range (for audit trail) |
end_date | datetime | No | End of date range (for audit trail) |
format | string | No | pdf (default) or csv |
Example Request
curl -X POST https://api.clawgrc.com/api/v1/reports \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "framework",
"framework_id": "fw-uuid",
"format": "pdf"
}'
Example Response (201 Created)
{
"id": "report-uuid",
"type": "framework",
"status": "generating",
"created_at": "2025-01-15T14:30:00Z"
}
List Reports
GET /api/v1/reports
List generated reports.
Example Response
{
"reports": [
{
"id": "report-uuid",
"type": "compliance_summary",
"status": "completed",
"format": "pdf",
"download_url": "/api/v1/reports/report-uuid/download",
"created_at": "2025-01-15T14:30:00Z"
}
],
"total": 5
}
Get Report
GET /api/v1/reports/:id
Get report details and download link.
Analytics: Compliance Score
GET /api/v1/analytics/compliance-score
Get the organization's compliance score with per-framework breakdown.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
framework_id | UUID | Scope to a specific framework |
Example Response
{
"overall_score": 78.5,
"total_controls": 156,
"compliant_controls": 123,
"framework_scores": [
{
"framework_id": "fw-uuid-1",
"framework_name": "SOC 2 Type II",
"score": 82.0,
"total_controls": 64,
"compliant_controls": 52
},
{
"framework_id": "fw-uuid-2",
"framework_name": "ISO 27001:2022",
"score": 75.3,
"total_controls": 93,
"compliant_controls": 70
}
]
}
Analytics: Evidence Status
GET /api/v1/analytics/evidence-status
Get evidence freshness and validation statistics.
Example Response
{
"total": 245,
"by_status": {
"current": 198,
"expiring_soon": 23,
"expired": 12,
"pending": 12
}
}
Analytics: Risk Summary
GET /api/v1/analytics/risk-summary
Get risk register summary by severity and treatment.
Example Response
{
"total_risks": 34,
"by_level": {
"critical": 2,
"high": 8,
"medium": 15,
"low": 9
},
"by_treatment": {
"mitigate": 20,
"accept": 8,
"transfer": 4,
"avoid": 2
},
"average_score": 8.2
}