{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pricklymails-com/json-schema/pricklymails-com-batch-response-schema.json",
  "title": "BatchResponse",
  "description": "A batch with its status, progress, aggregated results, and recommendation counts.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pricklymails-com-batches-api-openapi.yml#/components/schemas/BatchResponse",
  "type": "object",
  "required": [
    "uuid",
    "status",
    "progress",
    "results",
    "recommendations",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "created_at": {
      "type": "string"
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "progress": {
      "$ref": "#/$defs/BatchProgressDto"
    },
    "recommendations": {
      "$ref": "#/$defs/RecommendationCountsDto"
    },
    "results": {
      "$ref": "#/$defs/BatchResultsDto"
    },
    "status": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "uuid": {
      "type": "string"
    }
  },
  "$defs": {
    "BatchProgressDto": {
      "type": "object",
      "description": "Progress counters of a batch.",
      "required": [
        "total",
        "processed",
        "succeeded",
        "failed",
        "skipped",
        "percent_complete"
      ],
      "properties": {
        "failed": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        },
        "percent_complete": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "processed": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        },
        "skipped": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        },
        "succeeded": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        },
        "total": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        }
      }
    },
    "BatchResultsDto": {
      "type": "object",
      "description": "Aggregated verdict counts of a batch.",
      "required": [
        "valid",
        "invalid",
        "risky",
        "unknown",
        "duplicates",
        "syntax_errors"
      ],
      "properties": {
        "duplicates": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        },
        "invalid": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        },
        "risky": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        },
        "syntax_errors": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        },
        "unknown": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        },
        "valid": {
          "type": "integer",
          "format": "int64",
          "minimum": 0
        }
      }
    },
    "RecommendationCountsDto": {
      "type": "object",
      "description": "Recommendation-bucket counts (`remove`, `review`, `send`) for a batch's completed jobs.\nA job with no completed verification, or a failed job, is counted in none of the three.",
      "required": [
        "remove",
        "review",
        "send"
      ],
      "properties": {
        "remove": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "review": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "send": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      }
    }
  }
}