---
title: "Get retention status"
method: GET
path: "/api/v1/sebi/audit/retention"
tags: ["SEBI Compliance"]
---

# Get retention status

`GET /api/v1/sebi/audit/retention`

## Request

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

Get the 5-year retention compliance status for all audit data types.

SEBI AI/ML Guidelines require:
- All AI/ML decisions retained for 5 years
- Audit trail for human oversight
- Decision chain tracing

This endpoint reports compliance status for each data type.

## Response `200`

Retention status

- SEBIRetentionResponse: 5-year retention compliance status
  - `tenant_id` string: The scope key the retention rows were read for. This property was documented as `org_id: integer` and the server has never emitted it (#3435 R8): the struct field is `TenantID string \`json:"tenant_id"\`` (sebi_audit_export_types.go SEBIRetentionStatusResponse), so the documented property was absent from every response and the one the server does send was undocumented.
  - `framework` 'SEBI_AI_ML' | 'DPDP_ACT_2023' | 'SEBI_DPDP_COMBINED': SEBI compliance framework identifier
  - `compliance_status` 'COMPLIANT' | 'NON_COMPLIANT' | 'UNKNOWN': Compliance status indicator. `WARNING` was in this enum and is removed (#3435 R7): no code path assigns it. The three values below are the only ones the server writes (sebi_audit_export_service.go GetRetentionStatus). `UNKNOWN` was MISSING and is the common answer, not an edge case: it is returned whenever the retention period or the record counts backing a row could not be measured, and `audit_retention_config` ships EMPTY on a stock migration-applied database, so a stock deployment reports UNKNOWN for every data type. A readiness CHECK speaks a different vocabulary on a different schema: see SEBIComplianceCheck.status, which carries `pass`/`fail`/`warning`/`unknown` and is NOT this enum.
  - `status` SEBIDataTypeRetentionStatus[]
    - `data_type` 'policy_violations' | 'llm_calls' | 'decision_chain' | 'hitl_oversight' | 'pii_redactions' | 'all': Type of audit data
    - `retention_days` integer: The retention period in force. READ IT WITH `retention_configured`: when that is false this is the platform's compiled-in default, which is what WOULD be applied and is not evidence that anything was configured.
    - `retention_configured` boolean: Whether `retention_days` was read from this organisation's audit_retention_config row. False on every stock deployment, where that table ships empty; and structurally always false for `llm_calls` and `pii_redactions`, which audit_retention_defaults does not seed under those keys.
    - `oldest_record` string, date-time
    - `newest_record` string, date-time
    - `total_records` integer
    - `archived_records` integer
    - `storage_bytes` integer
    - `compliance_status` 'COMPLIANT' | 'NON_COMPLIANT' | 'UNKNOWN': Compliance status indicator. `WARNING` was in this enum and is removed (#3435 R7): no code path assigns it. The three values below are the only ones the server writes (sebi_audit_export_service.go GetRetentionStatus). `UNKNOWN` was MISSING and is the common answer, not an edge case: it is returned whenever the retention period or the record counts backing a row could not be measured, and `audit_retention_config` ships EMPTY on a stock migration-applied database, so a stock deployment reports UNKNOWN for every data type. A readiness CHECK speaks a different vocabulary on a different schema: see SEBIComplianceCheck.status, which carries `pass`/`fail`/`warning`/`unknown` and is NOT this enum.
    - `last_cleanup` string, date-time
    - `report_state` 'not_available' | 'enabled_empty' | 'populated': Whether the figures on this row were actually READ. `not_available` means the retention configuration, the record counts, or both could not be measured, and the row is then not a compliance assertion.
    - `error` string: The verbatim cause when report_state is not_available.
    - `error_kind` 'store_absent' | 'query_failed' | 'not_configured': Classifies that cause. `not_configured` is the common one: the retention read RAN and found no row. `section_not_implemented` is NOT in this enum, though the shared classifier can produce it (#3435 R8). It is constructed at exactly one site, the export dispatcher's default arm, which this endpoint never reaches. See SEBISectionStatus.error_kind for the mirror.
  - `next_cleanup` string, date-time: Next scheduled cleanup

---

[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)
