{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coinrithm-com/json-schema/coinrithm-com-agent-ledger-response-schema.json",
  "title": "AgentLedgerResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coinrithm-com-ledger-api-openapi.yml#/components/schemas/AgentLedgerResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AgentActionEvent"
      }
    },
    "pagination": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer"
        },
        "offset": {
          "type": "integer"
        },
        "hasMore": {
          "type": "boolean"
        },
        "total": {
          "type": "integer"
        }
      }
    },
    "filters": {
      "type": "object",
      "additionalProperties": true
    },
    "asOf": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "AgentActionEvent": {
      "type": "object",
      "description": "Private sanitized ledger row for the calling API key.",
      "properties": {
        "id": {
          "type": "integer"
        },
        "method": {
          "type": "string"
        },
        "endpoint": {
          "type": "string"
        },
        "venue": {
          "type": [
            "string",
            "null"
          ]
        },
        "eventType": {
          "type": "string"
        },
        "statusCode": {
          "type": [
            "integer",
            "null"
          ]
        },
        "ledgerStatus": {
          "type": "string"
        },
        "latencyMs": {
          "type": [
            "integer",
            "null"
          ]
        },
        "idempotencyKey": {
          "type": [
            "string",
            "null"
          ]
        },
        "relatedEntityType": {
          "type": [
            "string",
            "null"
          ]
        },
        "relatedEntityId": {
          "type": [
            "string",
            "null"
          ]
        },
        "requestSummary": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "responseSummary": {
          "type": [
            "object",
            "array",
            "string",
            "number",
            "boolean",
            "null"
          ],
          "items": {}
        },
        "blockReasons": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "runId": {
          "type": [
            "string",
            "null"
          ]
        },
        "decisionId": {
          "type": [
            "string",
            "null"
          ]
        },
        "strategyLabel": {
          "type": [
            "string",
            "null"
          ]
        },
        "confidence": {
          "type": [
            "number",
            "null"
          ]
        },
        "rationaleSummary": {
          "type": [
            "string",
            "null"
          ],
          "description": "Private caller-supplied summary; never exposed publicly."
        },
        "startedAt": {
          "type": "string",
          "format": "date-time"
        },
        "completedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}