{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bewary/json-schema/bewary-bulk-manifest-schema.json",
  "title": "BulkManifest",
  "description": "GET /v1/bulk: what the bulk files hold now. Free with any key.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bewary-bulk-api-openapi.yml#/components/schemas/BulkManifest",
  "properties": {
    "schema_version": {
      "type": "string",
      "title": "Schema Version"
    },
    "policy": {
      "type": "string",
      "title": "Policy",
      "description": "The licence policy version the entries passed (app/licences.py)."
    },
    "version": {
      "anyOf": [
        {
          "$ref": "#/$defs/BulkVersion"
        },
        {
          "type": "null"
        }
      ],
      "description": "The latest version, or null before the first build."
    },
    "versions": {
      "items": {
        "$ref": "#/$defs/BulkVersion"
      },
      "type": "array",
      "title": "Versions",
      "description": "Recent versions, newest first; deltas reach back 30 days."
    },
    "types": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object",
      "title": "Types",
      "description": "Current entries by entity type."
    },
    "formats": {
      "items": {
        "$ref": "#/$defs/BulkFormat"
      },
      "type": "array",
      "title": "Formats"
    },
    "price": {
      "$ref": "#/$defs/BulkPrice"
    },
    "key_enabled": {
      "type": "boolean",
      "title": "Key Enabled",
      "description": "This key may download the files (PATCH /v1/keys/{id})."
    },
    "notices": {
      "type": "string",
      "title": "Notices",
      "description": "Licence notices that travel with the files."
    }
  },
  "type": "object",
  "required": [
    "schema_version",
    "policy",
    "versions",
    "types",
    "formats",
    "price",
    "key_enabled",
    "notices"
  ],
  "$defs": {
    "BulkFormat": {
      "properties": {
        "format": {
          "type": "string",
          "enum": [
            "csv",
            "rpz",
            "stix"
          ],
          "title": "Format"
        },
        "media_type": {
          "type": "string",
          "title": "Media Type"
        },
        "types": {
          "items": {
            "type": "string",
            "enum": [
              "domain",
              "url",
              "phone",
              "wallet"
            ]
          },
          "type": "array",
          "title": "Types",
          "description": "Entity types the format carries."
        },
        "full": {
          "type": "string",
          "title": "Full",
          "description": "Path of the full file."
        },
        "delta": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Delta",
          "description": "Path of a delta after a version, or null (RPZ is served whole)."
        }
      },
      "type": "object",
      "required": [
        "format",
        "media_type",
        "types",
        "full"
      ],
      "title": "BulkFormat"
    },
    "BulkPrice": {
      "properties": {
        "credits_per_day": {
          "type": "integer",
          "title": "Credits Per Day",
          "description": "One day pass per account per UTC day covers every format, full and delta, and the TAXII collection."
        },
        "pass_today": {
          "type": "boolean",
          "title": "Pass Today",
          "description": "This account already holds today's pass."
        }
      },
      "type": "object",
      "required": [
        "credits_per_day",
        "pass_today"
      ],
      "title": "BulkPrice"
    },
    "BulkVersion": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id",
          "description": "Increases with every change; the RPZ serial. Pass it as `since` for a delta."
        },
        "created_at": {
          "type": "string",
          "title": "Created At",
          "description": "RFC 3339 UTC."
        },
        "entries": {
          "type": "integer",
          "title": "Entries",
          "description": "Entries in this version."
        },
        "added": {
          "type": "integer",
          "title": "Added"
        },
        "changed": {
          "type": "integer",
          "title": "Changed"
        },
        "removed": {
          "type": "integer",
          "title": "Removed"
        }
      },
      "type": "object",
      "required": [
        "id",
        "created_at",
        "entries",
        "added",
        "changed",
        "removed"
      ],
      "title": "BulkVersion"
    }
  }
}