Generate, manage, and export court-ready reports. Reports include contradiction analyses, timeline reconstructions, chain-of-custody documentation, and expert annotations.
/api/v1/reports/generateGenerate a court-ready report from analysis results. Supports multiple report types including contradiction analysis, timeline reconstruction, and comprehensive case summary reports.
{
"caseId": "case-2024-00142",
"type": "contradiction_analysis",
"title": "State v. Johnson - Bodycam Contradiction Report",
"analysisIds": ["an-c0n7r4d1", "an-x9y8z7w6"],
"options": {
"includeTimeline": true,
"includeTranscript": true,
"includeChainOfCustody": true,
"includeScreenshots": true,
"format": "legal",
"jurisdiction": "California"
}
}{
"reportId": "rpt-r3p0rt01",
"status": "generating",
"type": "contradiction_analysis",
"title": "State v. Johnson - Bodycam Contradiction Report",
"caseId": "case-2024-00142",
"estimatedDuration": 30,
"startedAt": "2024-03-21T09:00:00Z"
}| Code | Description |
|---|---|
400 | Invalid report configuration or missing required fields. |
404 | Case or analysis IDs not found. |
409 | Referenced analyses are not yet completed. |
500 | Internal error during report generation. |
/api/v1/reportsList all generated reports. Supports filtering by case, report type, and date range.
| Name | Type | Required | Description |
|---|---|---|---|
caseId | string | Optional | Filter reports by case ID. |
type | string | Optional | Filter by report type: "contradiction_analysis", "timeline", "summary", "chain_of_custody". |
limit | number | Optional | Maximum number of results (default: 20, max: 100). |
offset | number | Optional | Number of results to skip for pagination. |
{
"reports": [
{
"reportId": "rpt-r3p0rt01",
"title": "State v. Johnson - Bodycam Contradiction Report",
"type": "contradiction_analysis",
"status": "completed",
"caseId": "case-2024-00142",
"createdAt": "2024-03-21T09:00:00Z",
"pageCount": 24
}
],
"total": 15,
"limit": 20,
"offset": 0
}| Code | Description |
|---|---|
400 | Invalid query parameters. |
500 | Internal server error. |
/api/v1/reports/:idGet detailed information about a specific report, including its contents, metadata, and associated evidence and analyses.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The unique report ID (e.g., "rpt-r3p0rt01"). |
{
"reportId": "rpt-r3p0rt01",
"title": "State v. Johnson - Bodycam Contradiction Report",
"type": "contradiction_analysis",
"status": "completed",
"caseId": "case-2024-00142",
"createdAt": "2024-03-21T09:00:00Z",
"completedAt": "2024-03-21T09:00:30Z",
"pageCount": 24,
"sections": [
"Executive Summary",
"Evidence Overview",
"Contradiction Analysis",
"Timeline Reconstruction",
"Chain of Custody",
"Appendices"
],
"contradictionsFound": 7,
"evidenceIds": ["ev-a1b2c3d4", "ev-d5e6f7g8"],
"analysisIds": ["an-c0n7r4d1", "an-x9y8z7w6"]
}| Code | Description |
|---|---|
404 | Report not found with the specified ID. |
500 | Internal server error. |
/api/v1/reports/:id/exportExport a completed report as PDF or DOCX. PDF reports are formatted for court filing with proper margins, headers, and page numbers. DOCX reports are editable for attorney review.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The unique report ID to export. |
format | string | Required | Export format: "pdf" or "docx". |
outputPath | string | Optional | Local file path to save the export. If omitted, returns the file as a download. |
{
"reportId": "rpt-r3p0rt01",
"format": "pdf",
"outputPath": "/exports/state-v-johnson-contradictions.pdf",
"fileSize": 2457600,
"pageCount": 24,
"exportedAt": "2024-03-21T10:00:00Z",
"sha256": "a1b2c3d4e5f6..."
}| Code | Description |
|---|---|
400 | Invalid export format. Must be "pdf" or "docx". |
404 | Report not found with the specified ID. |
409 | Report generation is not yet completed. |
500 | Internal error during export. |