{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codequiry-com/json-schema/codequiry-com-check-schema.json",
  "title": "Check",
  "description": "A check (internally an assignment). Endpoints return the full assignment row, so more fields are present than are listed here; only the stable, documented ones are shown.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codequiry-com-openapi.yml#/components/schemas/Check",
  "type": "object",
  "properties": {
    "stats": {
      "type": [
        "object",
        "null"
      ],
      "description": "Present only when the list was requested with with_stats=1. Averages and maxima are over finished submissions and are null when there are none.",
      "properties": {
        "submissions": {
          "type": "integer"
        },
        "completed": {
          "type": "integer"
        },
        "failed": {
          "type": "integer"
        },
        "avg_group": {
          "type": [
            "number",
            "null"
          ]
        },
        "max_group": {
          "type": [
            "number",
            "null"
          ]
        },
        "avg_web": {
          "type": [
            "number",
            "null"
          ]
        },
        "max_web": {
          "type": [
            "number",
            "null"
          ]
        },
        "flagged": {
          "type": "integer",
          "description": "Finished submissions at or above 75% Group or Web."
        },
        "avg_ai": {
          "type": [
            "number",
            "null"
          ]
        },
        "max_ai": {
          "type": [
            "number",
            "null"
          ]
        },
        "ai_submissions": {
          "type": "integer"
        },
        "ai_flagged": {
          "type": "integer",
          "description": "Submissions whose mean AI probability is 75% or more."
        },
        "matches": {
          "type": "integer",
          "description": "Match total as the dashboard counts it: peer fragments, web sources (one per source) and AI blocks."
        }
      }
    },
    "id": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "status_id": {
      "type": "integer"
    },
    "language_id": {
      "type": "integer"
    },
    "test_type": {
      "type": "integer"
    },
    "ai_run": {
      "type": "integer",
      "description": "1 if AI-generated-code detection runs for this check."
    },
    "base_code_detection": {
      "type": "integer",
      "description": "1 if base/boilerplate-code detection is enabled."
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "assignmentstatuses": {
      "type": "object",
      "description": "Expanded status, included only by GET/POST /checks. Not returned by /check/create, /check/get or /check/update - use status_id there, or the top-level status string that /check/get returns.",
      "properties": {
        "id": {
          "type": "integer"
        },
        "status": {
          "type": "string"
        }
      }
    }
  }
}