Overview
The Data Export endpoints let you extract bulk data from your Casework instance for reporting, auditing, or integration with external tools. Three endpoints are available:
| Endpoint | Purpose | Format | Scope |
|---|---|---|---|
/api/cases/export | Export case records with filters | CSV or JSON | reports:read |
/api/wards/export | Export ward data with case counts | CSV or JSON | wards:read |
/api/reports/public | Aggregate statistics across cases | JSON | reports:read |
Caseworker visibility
API keys linked to a caseworker role only return cases assigned to that caseworker. Admin and manager keys return all cases for the tenant.
Cases export
/api/cases/exportExport cases as a CSV file or JSON array. Returns up to 5,000 records ordered by creation date (newest first).
Required scope: reports:read
Request
JSON response
{
"cases": [
{
"reference": "CW-2026-0042",
"status": "open",
"summary": "Pothole on High Street near junction with Mill Lane",
"themes": "roads, potholes",
"ward": "Truro East",
"category": "Roads & Pavements",
"source": "email",
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z"
}
],
"total": 1
}
CSV response
When format=csv, the response is a downloadable file (cases-export-YYYY-MM-DD.csv)
with these columns:
"Reference","Status","Summary","Themes","Ward","Category","Source","Created At","Updated At"
"CW-2026-0042","open","Pothole on High Street near junction with Mill Lane","roads, potholes","Truro East","Roads & Pavements","email","2026-01-15T10:30:00.000Z","2026-01-15T10:30:00.000Z"
CSV downloads
CSV responses include Content-Disposition: attachment headers so browsers will prompt a file download automatically.
Wards export
/api/wards/exportExport enabled wards with case counts as CSV or JSON, sorted alphabetically by name.
Required scope: wards:read
Request
JSON response
{
"wards": [
{
"id": "ward-abc123",
"name": "Truro East",
"tier": "parish",
"description": "Eastern parishes of Truro including Kenwyn and St Clement",
"totalCases": 17
}
],
"total": 1
}
CSV response
When format=csv, the response is a downloadable file (wards-export-YYYY-MM-DD.csv):
"Name","Tier","Description","Total Cases"
"Truro East","parish","Eastern parishes of Truro including Kenwyn and St Clement","17"
Public reports
/api/reports/publicReturns aggregate statistics for your tenant: total cases, resolution rate, and breakdowns by status, category, and ward (top 10 each).
This endpoint has no query parameters. It always returns JSON.
Required scope: reports:read
Request
JSON response
{
"totalCases": 328,
"totalResolved": 241,
"resolutionRate": 73,
"byStatus": [
{ "status": "open", "count": 42 },
{ "status": "in_progress", "count": 30 },
{ "status": "chasing", "count": 15 },
{ "status": "resolved", "count": 198 },
{ "status": "closed", "count": 43 }
],
"byCategory": [
{ "category": "Roads & Pavements", "count": 87 },
{ "category": "Planning & Development", "count": 64 },
{ "category": "Waste & Recycling", "count": 51 }
],
"byWard": [
{ "ward": "Truro East", "count": 45 },
{ "ward": "Falmouth South", "count": 38 },
{ "ward": "Penzance Central", "count": 29 }
]
}
Resolution rate
The resolutionRate is a rounded percentage calculated as (totalResolved / totalCases) * 100. Cases with status resolved or closed count as resolved. Returns 0 when there are no cases.
Response fields reference
Cases export fields
| Field | Type | Description |
|---|---|---|
reference | string | Unique case reference (e.g. CW-2026-0042) |
status | string | open, in_progress, chasing, resolved, or closed |
summary | string | null | Public summary of the case |
themes | string | null | Comma-separated themes |
ward | string | null | Ward name |
category | string | null | Category name |
source | string | How the case was submitted (e.g. email, web, phone) |
createdAt | string | ISO 8601 timestamp |
updatedAt | string | ISO 8601 timestamp |
Wards export fields
| Field | Type | Description |
|---|---|---|
id | string | Ward ID |
name | string | Ward name |
tier | string | Council tier (e.g. parish, district, county) |
description | string | null | Boundary description |
totalCases | number | Number of cases assigned to this ward |
Public reports fields
| Field | Type | Description |
|---|---|---|
totalCases | number | Total case count across all statuses |
totalResolved | number | Cases with resolved or closed status |
resolutionRate | number | Resolution percentage (0--100, rounded) |
byStatus | array | Case count per status |
byCategory | array | Top 10 categories by case count |
byWard | array | Top 10 wards by case count |