{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/honkio-ca/json-schema/honkio-ca-consent-batch-schema.json",
  "title": "ConsentBatch",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/honkio-ca-compliance-casl-api-openapi.yml#/components/schemas/ConsentBatch",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "id",
    "source",
    "file_name",
    "attested",
    "counts",
    "revoked_at",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "cb_…"
    },
    "source": {
      "type": "string",
      "enum": [
        "api",
        "dashboard"
      ],
      "description": "Sent through the API, or uploaded on the dashboard."
    },
    "file_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The file name the uploader gave, if any."
    },
    "attested": {
      "type": "boolean",
      "description": "Whether the uploader confirmed these people gave this consent or have this relationship."
    },
    "counts": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "rows",
        "recorded",
        "express",
        "implied",
        "already_recorded",
        "opted_out",
        "revoked_by_review",
        "duplicate_in_file",
        "invalid"
      ],
      "properties": {
        "rows": {
          "type": "integer"
        },
        "recorded": {
          "type": "integer"
        },
        "express": {
          "type": "integer"
        },
        "implied": {
          "type": "integer"
        },
        "already_recorded": {
          "type": "integer"
        },
        "opted_out": {
          "type": "integer"
        },
        "revoked_by_review": {
          "type": "integer"
        },
        "duplicate_in_file": {
          "type": "integer"
        },
        "invalid": {
          "type": "integer"
        }
      }
    },
    "revoked_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "defaults": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "consent_type"
      ],
      "properties": {
        "consent_type": {
          "type": "string",
          "enum": [
            "express",
            "implied"
          ]
        },
        "source_description": {
          "type": "string"
        },
        "source_ip": {
          "type": "string"
        },
        "source_url": {
          "type": "string"
        },
        "relationship_type": {
          "type": "string"
        },
        "last_transaction_date": {
          "type": "string"
        },
        "expires_at": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "description": "The defaults the upload was sent with, as sent. Only on GET /v1/compliance/consent-batches/{id}."
    }
  }
}