Skip to content

Reports API

Generate, list, and download governance reports. Export audit trails in PDF or CSV format for compliance reviews, incident investigations, and executive summaries.

Endpoints

GET /reports

List all previously generated reports for the current tenant.

Headers

HeaderValue
AuthorizationBearer <api_key>

Query Parameters

ParameterTypeDefaultDescription
typestring--Filter by report type
limitnumber20Number of results per page
offsetnumber0Pagination offset

Response

json
{
  "reports": [
    {
      "id": "rpt_a1b2c3d4",
      "type": "governance_summary",
      "format": "pdf",
      "status": "completed",
      "date_range": {
        "start": "2026-03-01T00:00:00Z",
        "end": "2026-03-31T23:59:59Z"
      },
      "created_at": "2026-04-01T09:15:00Z",
      "download_url": "/reports/rpt_a1b2c3d4"
    }
  ],
  "total": 12,
  "limit": 20,
  "offset": 0
}

POST /reports/generate

Generate a new report. Report generation runs asynchronously; poll the report status via GET /reports/:id until status is completed.

Request Body

json
{
  "type": "governance_summary",
  "date_range": {
    "start": "2026-03-01T00:00:00Z",
    "end": "2026-03-31T23:59:59Z"
  },
  "format": "pdf"
}
FieldTypeRequiredDescription
typestringYesReport type (see table below)
date_rangeobjectYesObject with start and end ISO 8601 timestamps
formatstringNoOutput format: pdf (default) or csv

Response

json
{
  "id": "rpt_e5f6g7h8",
  "type": "governance_summary",
  "status": "generating",
  "estimated_seconds": 30,
  "created_at": "2026-04-01T09:20:00Z"
}

TIP

Most reports complete within 30 seconds. Complex reports spanning large date ranges may take up to 2 minutes.


GET /reports/:id

Download a completed report or check status of a generating report.

Path Parameters

ParameterTypeDescription
idstringReport identifier (e.g., rpt_a1b2c3d4)

Response (Generating)

json
{
  "id": "rpt_e5f6g7h8",
  "type": "governance_summary",
  "status": "generating",
  "progress": 65
}

Response (Completed)

Returns the report file with appropriate Content-Type header (application/pdf or text/csv).

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="governance_summary_2026-03.pdf"

GET /audit/export

Export the full audit trail in PDF or CSV format.

Query Parameters

ParameterTypeRequiredDescription
formatstringYesExport format: pdf or csv
startstringNoStart date (ISO 8601). Defaults to 30 days ago.
endstringNoEnd date (ISO 8601). Defaults to now.
agent_idstringNoFilter by specific agent
verdictstringNoFilter by verdict: CLEARED, HELD, or BLOCKED

Example -- PDF Export

bash
curl -H "Authorization: Bearer $WARDN_API_KEY" \
  "https://api.thewardn.ai/audit/export?format=pdf&start=2026-03-01T00:00:00Z"

Example -- CSV Export

bash
curl -H "Authorization: Bearer $WARDN_API_KEY" \
  "https://api.thewardn.ai/audit/export?format=csv&verdict=BLOCKED" \
  -o blocked_actions.csv

WARNING

Audit exports include all governed actions within the date range. Large tenants with high action volumes should use narrow date ranges to avoid timeouts.


Report Types

TypeDescriptionContents
governance_summaryMonthly governance overviewTotal actions, verdict breakdown, top policies triggered, compliance score trend
violation_reportDetailed violation analysisAll BLOCKED and HELD actions with timestamps, agent, policy, and action payload
compliance_auditCompliance pack adherencePer-pack policy evaluation results, gaps, recommendations
agent_activityPer-agent activity reportActions per agent, verdict distribution, most-triggered policies, risk trend

Error Responses

StatusCodeDescription
400INVALID_TYPEUnknown report type
400INVALID_DATE_RANGEStart date is after end date, or range exceeds 1 year
404REPORT_NOT_FOUNDReport ID does not exist
409REPORT_GENERATINGReport is still being generated (retry later)

AI Governance for Every Organization