{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peopleprincipia-com/json-schema/peopleprincipia-com-refusal-list-envelope-schema.json",
  "title": "RefusalListEnvelope",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peopleprincipia-com-openapi.yaml#/components/schemas/RefusalListEnvelope",
  "type": "object",
  "required": [
    "summary",
    "items",
    "next_cursor"
  ],
  "properties": {
    "summary": {
      "type": "object",
      "required": [
        "total",
        "by_class",
        "by_reason",
        "first_refusal_at",
        "last_refusal_at",
        "note"
      ],
      "properties": {
        "total": {
          "type": "integer",
          "minimum": 0
        },
        "by_class": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "grounding": {
              "type": "integer",
              "minimum": 0
            },
            "unresolved_construct": {
              "type": "integer",
              "minimum": 0
            },
            "instrument_facet": {
              "type": "integer",
              "minimum": 0
            },
            "scope": {
              "type": "integer",
              "minimum": 0
            },
            "do_not_mint": {
              "type": "integer",
              "minimum": 0
            },
            "tombstone": {
              "type": "integer",
              "minimum": 0
            },
            "curator_hold": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "by_reason": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "refusal_class",
              "reason_code",
              "count"
            ],
            "properties": {
              "refusal_class": {
                "type": "string"
              },
              "reason_code": {
                "type": "string"
              },
              "count": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        },
        "first_refusal_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "last_refusal_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "note": {
          "type": "string"
        }
      }
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pass back as ?cursor= for the next page; null on the last page."
    }
  }
}