---
title: "Export OJK audit data"
method: POST
path: "/api/v1/ojk/audit/export"
tags: ["OJK Compliance"]
---

# Export OJK audit data

`POST /api/v1/ojk/audit/export`

## Request

- Base URL: `https://orchestrator.getaxonflow.com`
- URL: `https://orchestrator.getaxonflow.com/api/v1/ojk/audit/export`
- Auth: none declared
- TypeScript: <https://skmtc.dev/getaxonflow/apis/axonflow-orchestrator-api/docs/api/v1/ojk/audit/export/post.ts> (a function with typed inputs; its response is checked against the schema)

Export audit data for OJK/BI regulatory submission.

**Compliance frameworks** — the label SELECTS the report sections when
`data_types` is omitted (#3242). It is not a cosmetic tag:

| Framework | Sections, in report order |
|---|---|
| `OJK_AI_GOVERNANCE` | policy_violations, llm_calls, decision_chain, hitl_oversight |
| `UU_PDP` | pii_redactions, cross_border_transfers, breach_notifications, policy_violations |
| `BI_PJP` | decision_chain, hitl_oversight, pii_redactions, cross_border_transfers, breach_notifications |
| `OJK_BI_COMBINED` (default) | all seven sections |

**Data types**: policy_violations, llm_calls, decision_chain,
hitl_oversight, pii_redactions, cross_border_transfers,
breach_notifications, all. All seven are implemented. An explicitly
requested section outside the selected framework's scope is still
served, flagged `in_framework_scope: false`. An UNKNOWN data type
produces an explicit per-section error — never a silent empty section.

**Formats**: `format` is accepted as json (default), csv or xml, but this
endpoint PRODUCES ONLY JSON: the response is written with
`Content-Type: application/json` and the data is inline. When csv or xml
is requested the response reports `format: json` (what the body IS),
echoes the ask in `requested_format`, and explains the difference in
`format_note`. It does NOT label a JSON body as csv (#3242) - a
regulator artifact that misstates its own encoding is worse than one
that refuses. Rendered output is the compliance-report facade's job.

**`report_state`** is carried per section and rolled up on the summary:
`populated` (served, has records), `enabled_empty` (served, honestly
zero for this organization and window), `not_available` (could not be
served at all — always paired with an `error` and an `error_kind` of
`section_not_implemented` / `store_absent` / `query_failed`). Read
`report_state`, not the presence of a JSON key: every data array is
`omitempty`, so absence alone is ambiguous.

Sections are capped at 100,000 records; a section that reaches the cap
says so in its `note`.

The date range may span at most 5 years, matching the OJK 5-year
(1825-day) retention requirement. `start_date` and `end_date` are dates
(`YYYY-MM-DD`) and the window is inclusive of the whole final day, **in
UTC at both ends** — a request for `2026-08-03` covers
2026-08-03T00:00Z..T23:59Z, which is 07:00..07:00 WIB. The export runs
synchronously and returns `status: completed` with the data inline.

`metadata.export_version` is `2.0.0` for this contract. A `1.0.0`
consumer that inferred "module not enabled" from an empty body must move
to `report_state`.

**Enterprise Feature**: Available only for Indonesian financial
services deployments.

## Headers

- `X-Tenant-ID` string
- `X-Org-ID` string

## Request body

- OJKAuditExportRequest
  - `start_date` string, date, required: Window start (YYYY-MM-DD)
  - `end_date` string, date, required: Window end (YYYY-MM-DD, not before start_date; range at most 5 years)
  - `format` 'json' | 'csv' | 'xml': All three values are ACCEPTED. This endpoint PRODUCES only JSON: a csv or xml request succeeds and returns the same JSON body, with the response reporting `format: json`, echoing the ask in `requested_format` and explaining it in `format_note`. It does NOT label a JSON body as csv (#3242).
  - `framework` 'OJK_AI_GOVERNANCE' | 'UU_PDP' | 'BI_PJP' | 'OJK_BI_COMBINED'
  - `data_types` string[]: Defaults to [all]
  - `filters` object
    - `agent_ids` string[]
    - `user_ids` string[]
    - `severity` string[]
    - `policy_types` string[]
  - `include_pii` boolean

## Response `200`

Export completed

- OJKAuditExportResponse
  - `export_id` string
  - `status` string: Always `completed` (the export runs synchronously)
  - `framework` 'OJK_AI_GOVERNANCE' | 'UU_PDP' | 'BI_PJP' | 'OJK_BI_COMBINED'
  - `format` 'json': The format this response BODY is in, NOT the one that was requested. Always `json`: this endpoint writes `Content-Type: application/json` with the data inline, and no renderer for csv or xml exists on it. Rendered output is the compliance-report facade's job.
  - `requested_format` 'csv' | 'xml': Present ONLY when the caller asked for a format this endpoint does not produce. Its presence is the signal that the body is not what was requested. Absent on a json request.
  - `format_note` string: Prose explanation of the discrepancy, present exactly when `requested_format` is. Exists so a human reading the artifact does not have to infer it from two fields disagreeing.
  - `summary` object
    - `total_records` integer
    - `records_by_type` object
    - `date_range` object
      - `start` string, date-time
      - `end` string, date-time
    - `compliance_score` number, double
  - `data` object: Inline export payload; each key is present only when its data type was requested and rows exist
    - `policy_violations` object[]
      - `id` string
      - `timestamp` string, date-time
      - `policy_id` string
      - `policy_name` string
      - `severity` string
      - `action` string
      - `description` string
      - `tenant_id` string
    - `llm_calls` object[]
      - `id` string
      - `timestamp` string, date-time
      - `model_id` string
      - `provider` string
      - `input_tokens` integer
      - `output_tokens` integer
      - `cost` number, double
      - `latency_ms` integer
      - `policy_decision` string
    - `decision_chains` object[]
      - `id` string
      - `timestamp` string, date-time
      - `decision_id` string
      - `risk_level` string
      - `model_id` string
      - `requires_review` boolean
    - `hitl_records` object[]: Declared on the wire type but NEVER populated — the export service has no hitl_oversight query implementation (field is omitempty, so it is absent from real responses).
      - `id` string
      - `timestamp` string, date-time
      - `trigger_reason` string
      - `reviewer_id` string
      - `decision` string
      - `review_time_ms` integer
    - `pii_redactions` object[]: Declared on the wire type but NEVER populated — the export service has no pii_redactions query implementation (field is omitempty, so it is absent from real responses).
      - `id` string
      - `timestamp` string, date-time
      - `pii_type` string
      - `redaction_method` string
      - `confidence` number, double
    - `cross_border_transfers` object[]
      - `id` string
      - `timestamp` string, date-time
      - `data_residency` string
      - `transfer_basis` 'adequacy' | 'safeguards' | 'pasal_56b_dpa' | 'consent'
      - `destination_country` string
      - `data_categories` string[]
      - `approval_status` string
    - `breach_notifications` object[]
      - `id` string
      - `incident_timestamp` string, date-time
      - `discovery_time` string, date-time
      - `notification_deadline` string, date-time
      - `data_subjects_affected` integer
      - `data_types_involved` string[]
      - `notified_authority` string
      - `status` string: Effective status after deadline evaluation
      - `stored_status` string
      - `submitted_at` string, date-time
      - `acknowledged_at` string, date-time
      - `within_deadline` boolean
      - `created_at` string, date-time
  - `download_url` string: Omitted for inline exports
  - `created_at` string, date-time
  - `expires_at` string, date-time
  - `metadata` object
    - `export_version` string
    - `generated_by` string
    - `tenant_id` string
    - `checksum` string: SHA-256 hex of the export data

## Other responses

- `400`: Missing tenant headers (code `missing_tenant`), malformed body (`invalid_request`), or validation failure (`validation_error`: missing/invalid YYYY-MM-DD dates, end before start, range over 5 years, unsupported format or framework)
- `500`: Export failed (code `internal_error`)

---

[API](https://skmtc.dev/getaxonflow/apis/axonflow-orchestrator-api.md) - [All operations](https://skmtc.dev/getaxonflow/apis/axonflow-orchestrator-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getaxonflow/apis/axonflow-orchestrator-api/revisions/f408ef3ec9dd?raw)
