{
  "openapi": "3.1.0",
  "info": {
    "title": "Codequiry API",
    "version": "1.0.0",
    "summary": "Source-code plagiarism, peer similarity, web/database matching, and AI-generated-code detection.",
    "description": "Programmatic access to Codequiry. The typical flow is: create a check, upload one or more ZIP submissions, start the check, then poll status and read the overview / detailed results.\n\nAll endpoints are under the base URL `https://codequiry.com/api/v1` and authenticate with an `apikey` request header (your 64-character key from the dashboard). There is no OAuth and no Bearer token.\n\nMany check-scoped operations expose two equivalent forms: a POST form that takes `check_id` in the body, and a RESTful form that takes the id in the URL (e.g. `POST /check/status` and `GET /checks/{checkId}/status`). They are interchangeable.\n\n**Rate limit:** 60 requests per minute, counted per client IP address (not per API key) and shared across every endpoint. The limit is the same on all plans. Failed calls, including 401s, count against it. Over the limit the API returns 429 with a `Retry-After` header.\n\n**Timestamps** are UTC strings formatted `YYYY-MM-DD HH:MM:SS`.\n\n**Polling:** analysis is asynchronous. After `POST /check/start`, poll `POST /check/status` until `status_id` is 4 (completed) or 3 (failed); results endpoints return 409 until then. Poll every 20-30 seconds — a tight loop will exhaust the rate limit long before a check finishes.\n\n**Webhooks (instead of polling):** set `callback_url` when you create a check, or an account-wide webhook URL in Dashboard → API Keys, and Codequiry POSTs a JSON body to it when the check finishes:\n\n```json\n{\n  \"event\": \"check.completed\",\n  \"check_id\": 12345,\n  \"name\": \"Week 4 essays\",\n  \"course_id\": 678,\n  \"status_id\": 4,\n  \"status\": \"Completed\",\n  \"submissions_count\": 30,\n  \"avg_peer_similarity\": 12.4,\n  \"avg_web_similarity\": 3.1,\n  \"results_url\": \"https://dashboard.codequiry.com/course/678/assignment/12345\",\n  \"timestamp\": \"2026-01-31T12:00:00+00:00\"\n}\n```\n\n`event` is `check.completed` or `check.failed`. Each delivery carries `X-Codequiry-Event` and `X-Codequiry-Signature: sha256=<hex>`, an HMAC-SHA256 of the raw request body keyed with your API key — verify it with a constant-time compare before trusting the payload, and reply 2xx to acknowledge. Delivery is best-effort and unauthenticated destinations are rejected: the URL must be public http(s), so loopback, private and link-local addresses are refused with 422 at create time.\n\n**Errors** are always JSON, on every status, whether or not you send an `Accept` header. `error` carries the human-readable reason; 422 adds `validation_errors` keyed by field. A 402 means the account is suspended for an unpaid invoice and every endpoint will refuse until it is paid.",
    "contact": { "name": "Codequiry Support", "url": "https://codequiry.com/contact" },
    "license": { "name": "Proprietary", "url": "https://codequiry.com/terms-of-service" }
  },
  "servers": [
    { "url": "https://codequiry.com/api/v1", "description": "Production" }
  ],
  "security": [ { "apikey": [] } ],
  "tags": [
    { "name": "Auth", "description": "Validate credentials and read account/quota." },
    { "name": "Reference", "description": "Languages and engine (test type) catalogs." },
    { "name": "Checks", "description": "Create, list, update, and delete checks." },
    { "name": "Submissions", "description": "Upload code and manage submissions within a check." },
    { "name": "Run", "description": "Start analysis and track progress." },
    { "name": "Results", "description": "Overview, detailed matches, AI detection, summaries, and exports." }
  ],
  "paths": {
    "/auth/validate": {
      "get": { "tags": ["Auth"], "operationId": "validateApiKeyGet", "summary": "Validate API key", "description": "Confirms the supplied `apikey` header is valid and returns the owning account.", "responses": { "200": { "description": "Key is valid", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/KeyValidation" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" } } },
      "post": { "tags": ["Auth"], "operationId": "validateApiKeyPost", "summary": "Validate API key (POST)", "description": "Identical to the GET form.", "responses": { "200": { "description": "Key is valid", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/KeyValidation" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" } } }
    },
    "/account": {
      "get": { "tags": ["Auth"], "operationId": "getAccount", "summary": "Get account & quota", "description": "Returns the authenticated user's profile, plan, and remaining check quota.", "responses": { "200": { "description": "Account info", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Account" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" } } },
      "post": { "tags": ["Auth"], "operationId": "getAccountPost", "summary": "Get account & quota (POST)", "responses": { "200": { "description": "Account info", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Account" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" } } }
    },
    "/languages": {
      "get": { "tags": ["Reference"], "operationId": "getLanguages", "summary": "List supported languages", "description": "Languages you may pass to `language` when creating a check. Each entry includes the numeric `id` used by the API.", "responses": { "200": { "description": "Language catalog", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LanguageList" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" } } },
      "post": { "tags": ["Reference"], "operationId": "getLanguagesPost", "summary": "List supported languages (POST)", "responses": { "200": { "description": "Language catalog", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LanguageList" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" } } }
    },
    "/test-types": {
      "get": { "tags": ["Reference"], "operationId": "getTestTypes", "summary": "List engines (test types)", "description": "Returns the analysis engines available to your account. Use a returned `id` as `test_type` on create/start/quick. `default_test_type` is 1 and `recommended_test_type` is 9 (Group Similarity). Engine `id`s are live database ids, not a fixed sequence.", "responses": { "200": { "description": "Engine catalog and your access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TestTypeList" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/ServerError" } } },
      "post": { "tags": ["Reference"], "operationId": "getTestTypesPost", "summary": "List engines (test types) (POST)", "responses": { "200": { "description": "Engine catalog and your access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TestTypeList" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/ServerError" } } }
    },
    "/checks": {
      "get": { "tags": ["Checks"], "operationId": "listChecks", "summary": "List your checks", "description": "Returns every check (assignment) owned by the account, newest first, each with its status object. Unpaged by default for backwards compatibility; pass `limit` (and optionally `offset`) to page through a large account instead of pulling every check on each call.", "parameters": [ { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "example": 25, "minimum": 1, "maximum": 500 }, "description": "Maximum checks to return. Omit for all of them." }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "default": 0 }, "description": "Checks to skip, newest first. Supplying offset without limit caps the page at 500." }, { "name": "with_stats", "in": "query", "required": false, "schema": { "type": "boolean", "example": true }, "description": "Attach a `stats` object to every check: submission counts, mean and max Group/Web/AI scores over finished submissions, flagged counts and the match total, so a list screen needs no per-check calls." } ], "responses": { "200": { "description": "Array of checks", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Check" } } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "422": { "$ref": "#/components/responses/ValidationError" }, "429": { "$ref": "#/components/responses/RateLimited" } } },
      "post": { "tags": ["Checks"], "operationId": "listChecksPost", "summary": "List your checks (POST)", "description": "Identical to the GET form; `limit` and `offset` may be sent in the body.", "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "limit": { "type": "integer", "example": 25, "minimum": 1, "maximum": 500 }, "offset": { "type": "integer", "example": 0, "minimum": 0 }, "with_stats": { "type": "boolean", "example": true, "description": "Attach a `stats` object to every check (see the GET form)." } } } } } }, "responses": { "200": { "description": "Array of checks", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Check" } } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "422": { "$ref": "#/components/responses/ValidationError" }, "429": { "$ref": "#/components/responses/RateLimited" } } }
    },
    "/check/create": {
      "post": { "tags": ["Checks"], "operationId": "createCheck", "summary": "Create a check", "description": "Creates an empty check. Only `name` is required; `language` and `test_type` are optional and default to 13 and 1 respectively.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "example": "CS-201 Assignment 4", "minLength": 3, "maxLength": 255, "description": "Check name." }, "language": { "type": "integer", "default": 13, "description": "Language id from GET /languages. Use 999 for Auto Detect; an unknown/invalid id falls back to Auto Detect instead of returning an error." }, "test_type": { "type": "integer", "minimum": 1, "default": 1, "description": "Engine id from GET /test-types." }, "ai_run": { "type": "boolean", "default": true, "description": "Run AI-generated-code detection on this check. Accepts true/false/1/0. Costs 1 check on a peer-only engine, nothing extra on a web engine. Defaults to off on a peer-only engine and to the account setting on a web engine." }, "base_code_detection": { "type": "boolean", "default": false, "description": "Detect shared base/boilerplate (starter) code." }, "callback_url": { "type": "string", "format": "uri", "example": "https://example.edu/hooks/codequiry", "maxLength": 500, "description": "Webhook destination for this check. Codequiry POSTs a signed JSON payload here when the check completes or fails, so you do not have to poll. Must be a publicly reachable http(s) URL - loopback, private and link-local addresses are rejected with 422. Overrides the account-level webhook URL set in Dashboard -> API Keys. See the Webhooks section of the API description." } } } } } }, "responses": { "201": { "description": "Created check", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CheckCreated" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/upload": {
      "post": { "tags": ["Submissions"], "operationId": "uploadFile", "summary": "Upload a submission (ZIP)", "description": "Uploads one ZIP archive of source code into a check. Max 10 MB. Call once per submission, or use /check/upload-batch.", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": ["check_id", "file"], "properties": { "check_id": { "type": "integer", "description": "Target check id.", "example": 12345 }, "file": { "type": "string", "format": "binary", "description": "ZIP archive (mimes:zip, max 10 MB).", "example": "nowak_alice_a4.zip" } } } } } }, "responses": { "200": { "description": "Upload accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UploadResult" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "403": { "$ref": "#/components/responses/Forbidden" }, "422": { "$ref": "#/components/responses/ValidationError" }, "500": { "$ref": "#/components/responses/ServerError" } } }
    },
    "/check/upload-batch": {
      "post": { "tags": ["Submissions"], "operationId": "batchUpload", "summary": "Upload many submissions", "description": "Uploads 1-50 ZIP files into a check in one request. Validation is all-or-nothing: if any file is not a ZIP, is over 10 MB, or is not a file at all, the whole batch is rejected with 422 and nothing is stored - check the files before sending them. A file that passes validation but fails while being stored is reported in `failed_uploads`, alongside the ones that succeeded, with a 200 response.", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": ["check_id", "files"], "properties": { "check_id": { "type": "integer", "example": 12345 }, "files": { "type": "array", "minItems": 1, "maxItems": 50, "items": { "type": "string", "format": "binary", "example": "nowak_alice_a4.zip" }, "description": "1–50 ZIP archives (each mimes:zip, max 10 MB)." } } } } } }, "responses": { "200": { "description": "Batch processed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchUploadResult" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "403": { "$ref": "#/components/responses/Forbidden" }, "422": { "$ref": "#/components/responses/ValidationError" }, "500": { "$ref": "#/components/responses/ServerError" } } }
    },
    "/check/get": {
      "post": { "tags": ["Checks"], "operationId": "getCheck", "summary": "Get a check", "description": "Returns a check with its status, submission count, and submissions.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id"], "properties": { "check_id": { "type": "integer", "example": 12345, "minimum": 1 } } } } } }, "responses": { "200": { "description": "Check detail", "content": { "application/json": { "schema": { "type": "object", "properties": { "check": { "$ref": "#/components/schemas/Check" }, "status": { "type": "string", "example": "Completed" }, "submission_count": { "type": "integer", "example": 28 }, "submissions": { "type": "array", "items": { "$ref": "#/components/schemas/Submission" } } } } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/start": {
      "post": { "tags": ["Run"], "operationId": "startChecking", "summary": "Start a check", "description": "Queues analysis for a check that already has submissions. `webcheck` and `dbcheck` only take effect when BOTH are supplied (both true → engine 1, both false → engine 9); otherwise the check's existing engine is used. The check is set to status_id 7 (queued).", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id"], "properties": { "check_id": { "type": "integer", "example": 12345, "minimum": 1 }, "webcheck": { "type": "boolean", "description": "Enable internet/web matching.", "example": true }, "dbcheck": { "type": "boolean", "description": "Enable Codequiry database matching.", "example": true }, "test_type": { "type": "integer", "example": 1, "minimum": 1, "description": "Approved engine id (overrides webcheck/dbcheck mapping)." }, "ai_run": { "type": "boolean", "default": true, "description": "Run AI-generated-code detection on this check. Accepts true/false/1/0. Costs 1 check on a peer-only engine, nothing extra on a web engine. Defaults to off on a peer-only engine and to the account setting on a web engine." }, "base_code_detection": { "type": "boolean", "default": false, "description": "Detect shared base/boilerplate (starter) code." } } } } } }, "responses": { "200": { "description": "Check queued", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "check": { "$ref": "#/components/schemas/Check" }, "status": { "type": "string", "example": "In Queue" }, "submission_count": { "type": "integer", "example": 28 }, "checkURL": { "type": "string", "example": "https://dashboard.codequiry.com/course/678/assignment/12345/overview" } } } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "403": { "$ref": "#/components/responses/Forbidden" }, "409": { "$ref": "#/components/responses/Conflict" }, "422": { "$ref": "#/components/responses/ValidationError" }, "503": { "description": "Analysis services are temporarily offline.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }
    },
    "/check/quick": {
      "post": { "tags": ["Run"], "operationId": "quickCheck", "summary": "Quick check (all-in-one)", "description": "Creates a check, uploads files, and starts analysis in a single authenticated call. Distinct from the public website Quick Check widget.", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": ["name", "files"], "properties": { "name": { "type": "string", "example": "CS-201 Assignment 4", "minLength": 3, "maxLength": 255 }, "language": { "type": "integer", "default": 13, "description": "Language id from GET /languages. Use 999 for Auto Detect; an unknown/invalid id falls back to Auto Detect." }, "files": { "type": "array", "items": { "type": "string", "format": "binary", "example": "nowak_alice_a4.zip" }, "description": "One or more ZIP archives (each mimes:zip, max 10 MB)." }, "webcheck": { "type": "boolean", "example": true }, "dbcheck": { "type": "boolean", "example": true }, "test_type": { "type": "integer", "example": 1, "minimum": 1 }, "ai_run": { "type": "boolean", "default": true, "description": "Run AI-generated-code detection on this check. Accepts true/false/1/0. Costs 1 check on a peer-only engine, nothing extra on a web engine. Defaults to off on a peer-only engine and to the account setting on a web engine." }, "base_code_detection": { "type": "boolean", "default": false, "description": "Detect shared base/boilerplate (starter) code." } } } } } }, "responses": { "201": { "description": "Created and started", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QuickCheckResult" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "422": { "$ref": "#/components/responses/ValidationError" }, "500": { "$ref": "#/components/responses/ServerError" }, "503": { "description": "Analysis services are temporarily offline.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }
    },
    "/check/status": {
      "post": { "tags": ["Run"], "operationId": "getCheckStatusPost", "summary": "Get check status", "description": "Polling endpoint. Equivalent to GET /checks/{checkId}/status.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id"], "properties": { "check_id": { "type": "integer", "example": 12345 } } } } } }, "responses": { "200": { "description": "Status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CheckStatus" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/checks/{checkId}/status": {
      "get": { "tags": ["Run"], "operationId": "getCheckStatus", "summary": "Get check status (REST)", "parameters": [ { "$ref": "#/components/parameters/CheckId" } ], "responses": { "200": { "description": "Status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CheckStatus" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/overview": {
      "post": { "tags": ["Results"], "operationId": "getOverview", "summary": "Get results overview", "description": "Per-submission similarity scores and bar-chart data. The check must be completed (status_id 4) or you get 409.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id"], "properties": { "check_id": { "type": "integer", "example": 12345, "minimum": 1 } } } } } }, "responses": { "200": { "description": "Overview", "content": { "application/json": { "schema": { "type": "object", "properties": { "overviewURL": { "type": "string", "example": "https://dashboard.codequiry.com/course/678/assignment/12345/overview" }, "submissions": { "type": "array", "items": { "$ref": "#/components/schemas/Submission" } }, "bardata": { "type": "array", "items": { "type": "object", "properties": { "submission": { "type": "string", "example": "nowak_alice_a4.zip" }, "score": { "type": "number", "example": 75 } } } } } } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "409": { "$ref": "#/components/responses/Conflict" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/overviewCSV": {
      "post": { "tags": ["Results"], "operationId": "getOverviewCSV", "summary": "Get overview as CSV", "description": "Streams a CSV download with columns Submission,Score. Requires a completed check.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id"], "properties": { "check_id": { "type": "integer", "example": 12345 } } } } } }, "responses": { "200": { "description": "CSV file", "content": { "text/csv": { "schema": { "type": "string", "example": "Submission,Score\nnowak_alice_a4.zip,75.00\ncarter_ben_a4.zip,82.00" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "409": { "$ref": "#/components/responses/Conflict" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/results": {
      "post": { "tags": ["Results"], "operationId": "getResult", "summary": "Get detailed results", "description": "Full match detail for one submission, including peer, web/external, and AI matches.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id", "submission_id"], "properties": { "check_id": { "type": "integer", "example": 12345, "minimum": 1 }, "submission_id": { "type": "integer", "example": 90271 } } } } } }, "responses": { "200": { "description": "Detailed results", "content": { "application/json": { "schema": { "type": "object", "properties": { "submission": { "$ref": "#/components/schemas/Submission" }, "avg": { "type": "number", "example": 18.4 }, "max": { "type": "number", "example": 89 }, "min": { "type": "number", "example": 0 }, "other_matches": { "type": "array", "items": { "$ref": "#/components/schemas/Match" } }, "related_submissions": { "type": "array", "items": { "$ref": "#/components/schemas/Submission" } }, "related_files": { "type": "array", "items": { "type": "object", "description": "A stored source file from any submission in the check, so a client can render both sides of a match.", "properties": { "id": { "type": "integer", "example": 785285 }, "submission_id": { "type": "integer", "example": 90271 }, "filedir": { "type": "string", "description": "Path of the file inside the uploaded archive.", "example": "nowak_alice_a4/BankAccount.java" }, "content": { "type": "string", "description": "The stored source text.", "example": "package banking;\n\npublic class BankAccount {\n    private double balance;\n}\n" }, "language_id": { "type": "integer", "example": 13 }, "updated_at": { "type": "string", "example": "2026-08-11 09:41:37" } } } } } } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "409": { "$ref": "#/components/responses/Conflict" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/getRemoteFile": {
      "post": { "tags": ["Results"], "operationId": "getRemoteFile", "summary": "Get a matched web file", "description": "Fetches the stored content of an external/web match. `location` and `source` come verbatim from a match object in /check/results - do not construct them by hand. You may only read a stored file that one of your own submissions matched against: a file that exists but belongs to another account returns 403, and a location/source pair that matches nothing returns 404.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["location", "source"], "properties": { "location": { "type": "string", "example": "src/BankAccount.java" }, "source": { "type": "string", "example": "https://github.com/example-org/banking-utils/blob/main/src/BankAccount.java" } } } } } }, "responses": { "200": { "description": "Stored web file", "content": { "application/json": { "schema": { "type": "object", "properties": { "file": { "$ref": "#/components/schemas/RemoteFile" } } } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/ai-results": {
      "get": { "tags": ["Results"], "operationId": "getAIResults", "summary": "Get AI detection results", "description": "AI-generated-code detection and code-quality analysis for every submission in a check.", "parameters": [ { "name": "assignment_id", "in": "query", "required": true, "schema": { "type": "integer", "example": 12345, "minimum": 1 }, "description": "Check id." } ], "responses": { "200": { "description": "AI results", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AIResults" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } },
      "post": { "tags": ["Results"], "operationId": "getAIResultsPost", "summary": "Get AI detection results (POST)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["assignment_id"], "properties": { "assignment_id": { "type": "integer", "example": 12345, "minimum": 1 } } } } } }, "responses": { "200": { "description": "AI results", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AIResults" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/summary": {
      "post": { "tags": ["Results"], "operationId": "getCheckSummaryPost", "summary": "Get check summary", "description": "Aggregate stats for a check. Equivalent to GET /checks/{checkId}/summary.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id"], "properties": { "check_id": { "type": "integer", "example": 12345 } } } } } }, "responses": { "200": { "description": "Summary", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CheckSummary" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/checks/{checkId}/summary": {
      "get": { "tags": ["Results"], "operationId": "getCheckSummary", "summary": "Get check summary (REST)", "parameters": [ { "$ref": "#/components/parameters/CheckId" } ], "responses": { "200": { "description": "Summary", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CheckSummary" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/export": {
      "post": { "tags": ["Results"], "operationId": "exportCheckResultsPost", "summary": "Export results", "description": "Exports a completed check as JSON or CSV (`format`, default csv). Equivalent to GET /checks/{checkId}/export.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id"], "properties": { "check_id": { "type": "integer", "example": 12345 }, "format": { "type": "string", "enum": ["csv", "json"], "default": "csv" } } } } } }, "responses": { "200": { "description": "Export (JSON body or CSV download)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExportResult", "example": "\"Submission ID\",Filename,Status,\"Plagiarism Local %\",\"Plagiarism Web %\",\"Plagiarism Total %\",\"Matches Local\",\"Matches Web\",\"AI Detection Avg %\",\"AI Detection Max %\",\"Code Quality Avg\",\"File Size (bytes)\",\"Created At\",\"Updated At\"\n90271,nowak_alice_a4.zip,Completed,75.00,89.00,89.00,3,12,9,21,74,10874,\"2026-08-11 09:14:02\",\"2026-08-11 09:41:37\"" } }, "text/csv": { "schema": { "type": "string", "example": "\"Submission ID\",Filename,Status,\"Plagiarism Local %\",\"Plagiarism Web %\",\"Plagiarism Total %\",\"Matches Local\",\"Matches Web\",\"AI Detection Avg %\",\"AI Detection Max %\",\"Code Quality Avg\",\"File Size (bytes)\",\"Created At\",\"Updated At\"\n90271,nowak_alice_a4.zip,Completed,75.00,89.00,89.00,3,12,9,21,74,10874,\"2026-08-11 09:14:02\",\"2026-08-11 09:41:37\"" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/checks/{checkId}/export": {
      "get": { "tags": ["Results"], "operationId": "exportCheckResults", "summary": "Export results (REST)", "parameters": [ { "$ref": "#/components/parameters/CheckId" }, { "name": "format", "in": "query", "required": false, "schema": { "type": "string", "enum": ["csv", "json"], "default": "csv" } } ], "responses": { "200": { "description": "Export (JSON body or CSV download)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExportResult", "example": "\"Submission ID\",Filename,Status,\"Plagiarism Local %\",\"Plagiarism Web %\",\"Plagiarism Total %\",\"Matches Local\",\"Matches Web\",\"AI Detection Avg %\",\"AI Detection Max %\",\"Code Quality Avg\",\"File Size (bytes)\",\"Created At\",\"Updated At\"\n90271,nowak_alice_a4.zip,Completed,75.00,89.00,89.00,3,12,9,21,74,10874,\"2026-08-11 09:14:02\",\"2026-08-11 09:41:37\"" } }, "text/csv": { "schema": { "type": "string", "example": "\"Submission ID\",Filename,Status,\"Plagiarism Local %\",\"Plagiarism Web %\",\"Plagiarism Total %\",\"Matches Local\",\"Matches Web\",\"AI Detection Avg %\",\"AI Detection Max %\",\"Code Quality Avg\",\"File Size (bytes)\",\"Created At\",\"Updated At\"\n90271,nowak_alice_a4.zip,Completed,75.00,89.00,89.00,3,12,9,21,74,10874,\"2026-08-11 09:14:02\",\"2026-08-11 09:41:37\"" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/update": {
      "post": { "tags": ["Checks"], "operationId": "updateCheckPost", "summary": "Update a check", "description": "Renames a check and/or changes its language. Equivalent to PATCH /checks/{checkId}.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id"], "properties": { "check_id": { "type": "integer", "example": 12345 }, "name": { "type": "string", "example": "CS-201 Assignment 4 (regrade)", "minLength": 3, "maxLength": 255 }, "language": { "type": "integer", "example": 13, "description": "Language id from GET /languages. Use 999 for Auto Detect. As on /check/create, an unknown or invalid id falls back to Auto Detect and still returns 200 - the check is never left pointing at a language that does not exist, but a typo will not be reported either." } } } } } }, "responses": { "200": { "description": "Updated check", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "message": { "type": "string", "example": "Check updated successfully" }, "check": { "$ref": "#/components/schemas/Check" } } } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/checks/{checkId}": {
      "get": { "tags": ["Checks"], "operationId": "getCheckRest", "summary": "Get a check (REST)", "description": "Retrieves a check with its status, submission count, and submissions. Equivalent to POST /check/get.", "parameters": [ { "$ref": "#/components/parameters/CheckId" } ], "responses": { "200": { "description": "Check detail", "content": { "application/json": { "schema": { "type": "object", "properties": { "check": { "$ref": "#/components/schemas/Check" }, "status": { "type": "string", "example": "Completed" }, "submission_count": { "type": "integer", "example": 28 }, "submissions": { "type": "array", "items": { "$ref": "#/components/schemas/Submission" } } } } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "422": { "$ref": "#/components/responses/ValidationError" } } },
      "patch": { "tags": ["Checks"], "operationId": "updateCheck", "summary": "Update a check (REST)", "parameters": [ { "$ref": "#/components/parameters/CheckId" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "example": "CS-201 Assignment 4 (regrade)", "minLength": 3, "maxLength": 255 }, "language": { "type": "integer", "example": 13, "description": "Language id from GET /languages. Use 999 for Auto Detect. An unknown or invalid id falls back to Auto Detect and still returns 200." } } } } } }, "responses": { "200": { "description": "Updated check", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "message": { "type": "string", "example": "Check updated successfully" }, "check": { "$ref": "#/components/schemas/Check" } } } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } },
      "delete": { "tags": ["Checks"], "operationId": "deleteCheck", "summary": "Delete a check (REST)", "parameters": [ { "$ref": "#/components/parameters/CheckId" } ], "responses": { "200": { "description": "Deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteResult" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" } } }
    },
    "/check/delete": {
      "post": { "tags": ["Checks"], "operationId": "deleteCheckPost", "summary": "Delete a check", "description": "Equivalent to DELETE /checks/{checkId}. Requires the Rapid add-on (403 with requires_rapid otherwise); demo checks cannot be deleted (403); a processing check cannot be deleted (409).", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id"], "properties": { "check_id": { "type": "integer", "example": 12345 } } } } } }, "responses": { "200": { "description": "Deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteResult" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/deleteSubmission": {
      "post": { "tags": ["Submissions"], "operationId": "deleteSubmission", "summary": "Delete a submission", "description": "Removes one submission from a check. Requires the Rapid add-on (403 with requires_rapid otherwise); demo checks cannot be deleted (403).", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id", "submission_id"], "properties": { "check_id": { "type": "integer", "example": 12345 }, "submission_id": { "type": "integer", "example": 90271, "minimum": 1 } } } } } }, "responses": { "200": { "description": "Deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "message": { "type": "string", "example": "The submission has been deleted successfully." } } } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" }, "403": { "$ref": "#/components/responses/Forbidden" }, "422": { "$ref": "#/components/responses/ValidationError" }, "500": { "$ref": "#/components/responses/ServerError" } } }
    },
    "/status": {
      "get": { "tags": ["Auth"], "operationId": "getStatus", "summary": "Service status", "description": "Whether the checking engine (core) and its live-progress stream are up, from a one-minute cache shared with the dashboard's status badge. Poll this rather than the engine host itself; it costs one upstream probe a minute however many clients ask.", "responses": { "200": { "description": "Engine status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EngineStatus" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/BillingSuspended" }, "429": { "$ref": "#/components/responses/RateLimited" } } }
    },
    "/check/viewer": {
      "post": { "tags": ["Results"], "operationId": "getViewerResults", "summary": "Results viewer payload", "description": "Everything the dashboard's results page loads for one submission, in one call: the submission's files (the first one with content inline, the rest fetched through /check/viewer/file), its peer and AI matches, its web sources collapsed to one entry per source, and a rail of every submission in the check carrying the Group, Web and AI scores the dashboard prints beside each name. Built by the same loader as the dashboard, so the two never disagree. Omit submission_id for the highest-scoring submission. Results that are paywalled on the account answer 402 with `paywalled: true`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id"], "properties": { "check_id": { "type": "integer", "example": 12345, "minimum": 1 }, "submission_id": { "type": "integer", "example": 90271, "minimum": 1, "description": "Which submission to load. Omit for the highest-scoring one." } } } } } }, "responses": { "200": { "description": "Viewer payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ViewerResults" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/ResultsLocked" }, "429": { "$ref": "#/components/responses/RateLimited" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/viewer/file": {
      "post": { "tags": ["Results"], "operationId": "getViewerFile", "summary": "Results viewer: one submission file", "description": "The stored text of one of a submission's own files, for the viewer's file tabs. /check/viewer ships content for the first file only; fetch the others here by their `filedir`. Resolved the way the dashboard resolves them: the engine's cache under every spelling of the path, then the submission's stored archive.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id", "submission_id", "file_path"], "properties": { "check_id": { "type": "integer", "example": 12345, "minimum": 1 }, "submission_id": { "type": "integer", "example": 90271, "minimum": 1 }, "file_path": { "type": "string", "example": "nowak_alice_a4/BankAccount.java", "description": "The file's `filedir` from the viewer payload." } } } } } }, "responses": { "200": { "description": "File text", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ViewerFile" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/ResultsLocked" }, "429": { "$ref": "#/components/responses/RateLimited" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    },
    "/check/viewer/counterpart": {
      "post": { "tags": ["Results"], "operationId": "getViewerCounterpart", "summary": "Results viewer: the other side of a match", "description": "The code a match was found against: the peer submission's file for a peer match, or the cached copy of the external source for a web match, with the line ranges on both sides so a client can draw the comparison. AI matches have no counterpart. A web entry flagged `is_legacy_web` carries an id from a different table; send `legacy: true` for those. 404 means the source's text is simply not stored, which is a normal state for older web sources.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["check_id", "submission_id", "match_id"], "properties": { "check_id": { "type": "integer", "example": 12345, "minimum": 1 }, "submission_id": { "type": "integer", "example": 90271, "minimum": 1 }, "match_id": { "type": "integer", "example": 1849201, "minimum": 1, "description": "The `id` of an entry in `matches` or `web_files`." }, "legacy": { "type": "boolean", "example": false, "description": "true when the entry's `is_legacy_web` is true." } } } } } }, "responses": { "200": { "description": "Counterpart text and line ranges", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ViewerCounterpart" } } } }, "401": { "$ref": "#/components/responses/InvalidKey" }, "402": { "$ref": "#/components/responses/ResultsLocked" }, "429": { "$ref": "#/components/responses/RateLimited" }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/ValidationError" } } }
    }
  },
  "components": {
    "securitySchemes": {
      "apikey": { "type": "apiKey", "in": "header", "name": "apikey", "description": "Your 64-character API key from the Codequiry dashboard." }
    },
    "parameters": {
      "CheckId": { "name": "checkId", "in": "path", "required": true, "schema": { "type": "integer", "example": 12345 }, "description": "The check (assignment) id." }
    },
    "responses": {
      "ResultsLocked": { "description": "Payment required. Either the account is suspended for an unpaid invoice (every endpoint answers this until it is paid), or results are paywalled on this account until it upgrades (the viewer endpoints only). `paywalled` tells the two apart; the request was not performed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "paywalled": { "type": "boolean", "example": true, "description": "Present and true when the results paywall, not a suspension, refused the request." }, "upgrade_url": { "type": "string", "example": "https://dashboard.codequiry.com/v2/billing-usage" }, "invoice": { "type": "string", "nullable": true, "description": "Stripe invoice id of the unpaid invoice, on a suspension." } } }, "example": { "error": "Results are locked on this account. Upgrade to view results.", "paywalled": true, "upgrade_url": "https://dashboard.codequiry.com/v2/billing-usage" } } } },
      "RateLimited": { "description": "Rate limit exceeded: more than 60 requests in one minute from this IP. Retry after the number of seconds in the Retry-After header. Successful responses carry X-RateLimit-Limit and X-RateLimit-Remaining too, so you can pace a client without waiting to be refused.", "headers": { "Retry-After": { "description": "Seconds to wait before retrying.", "schema": { "type": "integer" } }, "X-RateLimit-Limit": { "description": "Always 60.", "schema": { "type": "integer" } }, "X-RateLimit-Remaining": { "description": "Calls left in the window (0 here).", "schema": { "type": "integer" } }, "X-RateLimit-Reset": { "description": "Unix timestamp when the window reopens. Sent only on 429.", "schema": { "type": "integer" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "InvalidKey": { "description": "Missing or invalid API key. The API key is checked before any endpoint logic runs, so this is returned for every operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "missing": { "summary": "No apikey header", "value": { "error": "No API Key (apikey) provided in header request" } }, "invalid": { "summary": "Unknown or malformed key", "value": { "error": "Unauthorized, make sure your API Key is valid an associated with an account. Create an account at codequiry.com" } } } } } },
      "BillingSuspended": { "description": "The account is suspended for an unpaid invoice. Every endpoint returns this until the invoice is paid from the billing dashboard; it is not retryable and the request was not performed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "invoice": { "type": "string", "nullable": true, "description": "Stripe invoice id of the unpaid invoice." } } }, "example": { "error": "Account suspended due to an unpaid invoice. Pay the outstanding invoice from your billing dashboard to restore API access.", "invoice": "in_1QxYz..." } } } },
      "ValidationError": { "description": "Request validation failed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "validation_errors": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } } } } } },
      "NotFound": { "description": "Resource not found or not owned by this account.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "Forbidden": { "description": "Not permitted (e.g. deleting without the Rapid add-on, or a read-only demo check).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "Conflict": { "description": "Check is in a state that does not allow this operation (e.g. still processing, or not yet completed).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "ServerError": { "description": "Unexpected server error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
    },
    "schemas": {
      "Error": { "type": "object", "properties": { "error": { "type": "string", "example": "Invalid check_id provided." } } },
      "KeyValidation": { "type": "object", "properties": { "valid": { "type": "boolean", "example": true }, "user_id": { "type": "integer", "example": 20481 }, "email": { "type": "string", "example": "d.whitfield@university.edu" }, "name": { "type": "string", "example": "Dana Whitfield" } } },
      "Account": { "type": "object", "properties": { "id": { "type": "integer", "example": 20481 }, "name": { "type": "string", "example": "Dana Whitfield" }, "email": { "type": "string", "example": "d.whitfield@university.edu" }, "quota": { "type": "object", "properties": { "remaining": { "type": "integer", "example": 842 }, "total": { "type": "integer", "example": 1000 }, "unlimited": { "type": "boolean", "example": false }, "checks_remaining": { "type": "integer", "example": 842 }, "reset_date": { "type": "string", "nullable": true, "example": "2026-09-01 00:00:00" } } }, "submissions": { "type": "integer", "example": 1364 }, "is_pro": { "type": "boolean", "example": true }, "plan_id": { "type": "integer", "nullable": true, "example": 2 }, "edu_verified": { "type": "boolean", "example": true } } },
      "LanguageList": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "count": { "type": "integer", "example": 65 }, "languages": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 13 }, "language": { "type": "string", "example": "Java (.java)" }, "extensions": { "type": "string", "example": ".java" } } } } } },
      "TestTypeList": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "test_types": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 1 }, "name": { "type": "string", "example": "Hexagram™ Fast v2.01 Web + Peer (Recommended)" }, "description": { "type": "string", "example": "Our most popular engine, and the best all-round choice. Scans 2 trillion+ web sources (GitHub, StackOverflow, tutorial sites, homework-help sites) and compares every submission against the others. Balanced speed and accuracy for everyday use. ~20 min runtime." }, "features": { "type": "array", "items": { "type": "string", "example": "Advanced plagiarism detection" } }, "consumption": { "type": "integer", "example": 179 }, "peer_only": { "type": "boolean", "example": false }, "auto_detect_base_code": { "type": "boolean", "example": false }, "available": { "type": "boolean", "example": true }, "requires": { "type": "string", "description": "Present only when `available` is false: what unlocks this engine.", "example": "Pro subscription, EDU verification, or Enterprise plan" } } } }, "user_access": { "type": "object", "properties": { "has_full_access": { "type": "boolean", "example": true }, "is_pro": { "type": "boolean", "example": true }, "is_edu_verified": { "type": "boolean", "example": true }, "is_enterprise": { "type": "boolean", "example": false } } }, "default_test_type": { "type": "integer", "example": 1 }, "recommended_test_type": { "type": "integer", "example": 9 }, "note": { "type": "string", "example": "Engine availability and quota consumption may vary based on your subscription plan" } } },
      "Check": { "type": "object", "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.", "properties": { "stats": { "type": "object", "nullable": true, "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", "example": 24 }, "completed": { "type": "integer", "example": 24 }, "failed": { "type": "integer", "example": 0 }, "avg_group": { "type": "number", "nullable": true, "example": 18.4 }, "max_group": { "type": "number", "nullable": true, "example": 82 }, "avg_web": { "type": "number", "nullable": true, "example": 9.1 }, "max_web": { "type": "number", "nullable": true, "example": 100 }, "flagged": { "type": "integer", "example": 2, "description": "Finished submissions at or above 75% Group or Web." }, "avg_ai": { "type": "number", "nullable": true, "example": 31.6 }, "max_ai": { "type": "number", "nullable": true, "example": 97.2 }, "ai_submissions": { "type": "integer", "example": 24 }, "ai_flagged": { "type": "integer", "example": 3, "description": "Submissions whose mean AI probability is 75% or more." }, "matches": { "type": "integer", "example": 41, "description": "Match total as the dashboard counts it: peer fragments, web sources (one per source) and AI blocks." } } }, "id": { "type": "integer", "example": 12345 }, "name": { "type": "string", "example": "CS-201 Assignment 4" }, "status_id": { "type": "integer", "example": 4 }, "language_id": { "type": "integer", "example": 13 }, "test_type": { "type": "integer", "example": 1 }, "ai_run": { "type": "integer", "description": "1 if AI-generated-code detection runs for this check.", "example": 1 }, "base_code_detection": { "type": "integer", "description": "1 if base/boilerplate-code detection is enabled.", "example": 0 }, "created_at": { "type": "string", "example": "2026-08-11 09:14:02" }, "updated_at": { "type": "string", "example": "2026-08-11 09:41:37" }, "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", "example": 4 }, "status": { "type": "string", "example": "Completed" } } } } },
      "CheckCreated": { "type": "object", "description": "The check as returned by /check/create. Same row as Check but without the expanded assignmentstatuses relation.", "properties": { "id": { "type": "integer", "description": "Save this - it is the check_id every other endpoint takes.", "example": 12345 }, "name": { "type": "string", "example": "CS-201 Assignment 4" }, "status_id": { "type": "integer", "description": "Always 1 (new) on creation.", "example": 1 }, "language_id": { "type": "integer", "example": 13 }, "test_type": { "type": "integer", "example": 1 }, "ai_run": { "type": "integer", "example": 1 }, "base_code_detection": { "type": "integer", "example": 0 }, "job_id": { "type": "integer", "description": "0 until the check is started.", "example": 0 }, "created_at": { "type": "string", "example": "2026-08-11 09:14:02" }, "updated_at": { "type": "string", "example": "2026-08-11 09:14:02" } } },
      "Submission": { "type": "object", "properties": { "id": { "type": "integer", "example": 90271 }, "assignment_id": { "type": "integer", "example": 12345 }, "filename": { "type": "string", "example": "nowak_alice_a4.zip" }, "status_id": { "type": "integer", "example": 4 }, "total_result": { "type": "number", "example": 75 }, "result_web": { "type": "number", "example": 89 }, "submissionresults": { "type": "array", "description": "One row per peer submission this one scored against, highest score first.", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 3104428 }, "submission_id": { "type": "integer", "example": 90271 }, "submission_id_compared": { "type": "integer", "example": 90272 }, "score": { "type": "number", "description": "Similarity percentage against that submission.", "example": 86 }, "file": { "type": "string", "example": "nowak_alice_a4/BankAccount.java" }, "file_matched": { "type": "string", "example": "carter_ben_a4/BankAccount.java" }, "lines": { "type": "integer", "description": "Lines covered by the matched region.", "example": 90 }, "longest": { "type": "integer", "description": "Longest single matched run, in lines.", "example": 60 }, "location": { "type": "string", "description": "Empty for peer matches; the path within the source for web matches.", "example": "" }, "source": { "type": "string", "example": "Peer submission" } } } } } },
      "Match": { "type": "object", "description": "A matched code region. match_type 1 = peer, >1 = external/web, 10 = AI. The example below is a web match: external matches carry `location` and `source` (feed both to /check/getRemoteFile) and leave `submission_id_matched` and `matched_similarity` at 0. Peer matches are the mirror image - both ids and both similarity scores are set, and `location` and `source` are empty strings.", "properties": { "id": { "type": "integer", "example": 8094205 }, "submission_id": { "type": "integer", "example": 90271 }, "submission_id_matched": { "type": "integer", "example": 0 }, "similarity": { "type": "number", "example": 89 }, "matched_similarity": { "type": "number", "example": 0 }, "file": { "type": "string", "example": "nowak_alice_a4/BankAccount.java" }, "file_matched": { "type": "string", "example": "gh/0d831123eb6907cfed2e11f47a9e95df2401024b.java" }, "line_start": { "type": "integer", "example": 3 }, "line_end": { "type": "integer", "example": 26 }, "line_matched_start": { "type": "integer", "example": 1 }, "line_matched_end": { "type": "integer", "example": 16 }, "tokens": { "type": "integer", "example": 33 }, "match_type": { "type": "integer", "example": 4 }, "location": { "type": "string", "example": "src/BankAccount.java" }, "source": { "type": "string", "example": "https://github.com/example-org/banking-utils/blob/main/src/BankAccount.java" } } },
      "RemoteFile": { "type": "object", "description": "A stored copy of an external page or file that a submission matched against. The web corpus is shared - one stored file can be matched by many submissions - so a row carries no submission or timestamp of its own.", "properties": { "id": { "type": "integer", "example": 1148302 }, "filedir": { "type": "string", "description": "Path/name of the file within the stored source.", "example": "src/BankAccount.java" }, "filename": { "type": "string", "nullable": true, "example": "BankAccount.java" }, "content": { "type": "string", "description": "The stored source text.", "example": "package banking;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class BankAccount {\n    private final List<String> ledger = new ArrayList<>();\n    private double balance;\n\n    public void deposit(double amount) {\n        if (amount <= 0) throw new IllegalArgumentException(\"amount must be positive\");\n        balance += amount;\n        ledger.add(\"deposit \" + amount);\n    }\n}\n" }, "language_id": { "type": "integer", "example": 13 }, "location": { "type": "string", "description": "Display label for the match, echoed from the match object.", "example": "src/BankAccount.java" }, "source": { "type": "string", "description": "Origin URL, echoed from the match object.", "example": "https://github.com/example-org/banking-utils/blob/main/src/BankAccount.java" } } },
      "UploadResult": { "type": "object", "properties": { "data": { "type": "array", "description": "The submission rows created by this upload.", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 90271 }, "filename": { "type": "string", "description": "Archive name without the .zip extension.", "example": "nowak_alice_a4" }, "file_size": { "type": "integer", "description": "Bytes stored.", "example": 10874 }, "status_id": { "type": "integer", "description": "2 (ready) immediately after upload.", "example": 2 }, "created_at": { "type": "string", "example": "2026-08-11 09:14:02" } } } }, "file": { "type": "string", "example": "nowak_alice_a4.zip" }, "file_size": { "type": "integer", "example": 10874 }, "submission_count": { "type": "integer", "example": 12 }, "check": { "$ref": "#/components/schemas/Check" } } },
      "BatchUploadResult": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "message": { "type": "string", "example": "3 of 4 files uploaded." }, "uploaded": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 90271 }, "filename": { "type": "string", "example": "nowak_alice_a4.zip" }, "file_size": { "type": "integer", "example": 10874 }, "status_id": { "type": "integer", "example": 2 } } } }, "uploaded_count": { "type": "integer", "example": 3 }, "failed_count": { "type": "integer", "example": 1 }, "failed_uploads": { "type": "array", "items": { "type": "object", "properties": { "file": { "type": "string", "example": "duffy_erin_a4.rar" }, "error": { "type": "string", "example": "The files.3 must be a file of type: zip." } } } }, "check": { "$ref": "#/components/schemas/Check" } } },
      "CheckStatus": { "type": "object", "properties": { "check_id": { "type": "integer", "example": 12345 }, "status_id": { "type": "integer", "example": 6 }, "status": { "type": "string", "example": "Processing" }, "status_message": { "type": "string", "example": "Waiting for the server to pick up your check" }, "progress": { "type": "number", "example": 64 }, "submissions_total": { "type": "integer", "example": 28 }, "submissions_completed": { "type": "integer", "example": 18 }, "estimated_completion": { "type": "string", "nullable": true, "description": "ISO-8601, set only while status_id is 6 or 7.", "example": "2026-08-11T09:41:37+00:00" } } },
      "CheckSummary": { "type": "object", "properties": { "check_id": { "type": "integer", "example": 12345 }, "check_name": { "type": "string", "example": "CS-201 Assignment 4" }, "status": { "type": "string", "example": "Completed" }, "status_id": { "type": "integer", "example": 4 }, "submission_count": { "type": "integer", "example": 28 }, "completed_submissions": { "type": "integer", "example": 28 }, "plagiarism_stats": { "type": "object", "properties": { "avg": { "type": "number", "example": 18.4 }, "max": { "type": "number", "example": 89 }, "min": { "type": "number", "example": 0 } } }, "ai_detection_stats": { "type": "object", "properties": { "avg": { "type": "number", "example": 22.7 }, "max": { "type": "number", "example": 96 } } }, "flagged_submissions": { "type": "integer", "description": "Count where plagiarism total > 75 OR avg AI > 75.", "example": 3 }, "processing_time_seconds": { "type": "integer", "nullable": true, "example": 1642 }, "created_at": { "type": "string", "example": "2026-08-11 09:14:02" }, "updated_at": { "type": "string", "example": "2026-08-11 09:41:37" } } },
      "ExportResult": { "type": "object", "properties": { "check_id": { "type": "integer", "example": 12345 }, "check_name": { "type": "string", "example": "CS-201 Assignment 4" }, "export_date": { "type": "string", "example": "2026-08-11 09:45:12" }, "submissions": { "type": "array", "items": { "type": "object", "properties": { "submission_id": { "type": "integer", "example": 90271 }, "filename": { "type": "string", "example": "nowak_alice_a4.zip" }, "status": { "type": "string", "example": "Completed" }, "plagiarism_local": { "type": "number", "example": 75 }, "plagiarism_web": { "type": "number", "example": 89 }, "plagiarism_total": { "type": "number", "example": 89 }, "matches_local": { "type": "integer", "example": 3 }, "matches_web": { "type": "integer", "example": 12 }, "ai_detection_avg": { "type": "number", "example": 9 }, "ai_detection_max": { "type": "number", "example": 21 }, "code_quality_avg": { "type": "number", "example": 74 }, "file_size": { "type": "integer", "example": 10874 }, "created_at": { "type": "string", "example": "2026-08-11 09:14:02" }, "updated_at": { "type": "string", "example": "2026-08-11 09:41:37" } } } } } },
      "DeleteResult": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "message": { "type": "string", "example": "Check deleted successfully" }, "check_id": { "type": "integer", "example": 12345 }, "check_name": { "type": "string", "example": "CS-201 Assignment 4" } } },
      "QuickCheckResult": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "message": { "type": "string", "example": "Check created, files uploaded, and analysis started successfully." }, "data": { "type": "object", "properties": { "check_id": { "type": "integer", "example": 12345 }, "check_name": { "type": "string", "example": "CS-201 Assignment 4" }, "language": { "type": "string", "example": "Java (.java)" }, "language_id": { "type": "integer", "example": 13 }, "status": { "type": "string", "example": "Processing" }, "status_id": { "type": "integer", "example": 7 }, "test_type": { "type": "integer", "example": 1 }, "submissions": { "type": "object", "properties": { "uploaded": { "type": "integer", "example": 28 }, "failed": { "type": "integer", "example": 0 }, "total": { "type": "integer", "example": 28 }, "details": { "type": "array", "description": "The submission rows created by this call.", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 90271 }, "filename": { "type": "string", "example": "nowak_alice_a4" }, "file_size": { "type": "integer", "example": 10874 }, "status_id": { "type": "integer", "example": 2 }, "created_at": { "type": "string", "example": "2026-08-11 09:14:02" } } } } } }, "failed_uploads": { "type": "array", "description": "Files rejected during upload. Empty when everything landed.", "items": { "type": "object", "properties": { "file": { "type": "string", "example": "duffy_erin_a4.rar" }, "error": { "type": "string", "example": "The files.3 must be a file of type: zip." } } } }, "detection_settings": { "type": "object", "description": "Which external corpora this check searches, resolved from webcheck/dbcheck and the engine.", "properties": { "web_check": { "type": "boolean", "example": true }, "github_check": { "type": "boolean", "example": true }, "stackoverflow_check": { "type": "boolean", "example": true }, "gist_check": { "type": "boolean", "example": true } } }, "check_url": { "type": "string", "example": "https://dashboard.codequiry.com/course/678/assignment/12345/overview" }, "execution_time_ms": { "type": "number", "example": 4182 } } }, "next_steps": { "type": "object", "description": "Literal follow-up calls, with the new check id already substituted in.", "properties": { "poll_status": { "type": "string", "example": "Use GET /check/get with check_id=12345 to monitor progress" }, "get_results": { "type": "string", "example": "Once status is 'Completed', use POST /check/overview with check_id=12345" } } } } },
      "AIResults": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "assignment_id": { "type": "integer", "description": "Echo of the requested check id.", "example": 12345 }, "assignment_name": { "type": "string", "example": "CS-201 Assignment 4" }, "message": { "type": "string", "description": "Present only when the check has no submissions yet; `statistics` and `assignment_status` are omitted in that case.", "example": "No submissions found for this check." }, "assignment_status": { "type": "integer", "description": "Numeric status_id.", "example": 4 }, "statistics": { "type": "object", "properties": { "total_submissions": { "type": "integer", "example": 28 }, "submissions_with_ai_detection": { "type": "integer", "example": 26 }, "submissions_with_code_quality": { "type": "integer", "example": 26 }, "avg_ai_detection": { "type": "number", "example": 22.7 }, "avg_code_quality": { "type": "number", "example": 71.3 }, "high_ai_risk_count": { "type": "integer", "example": 3 }, "medium_ai_risk_count": { "type": "integer", "example": 7 }, "low_ai_risk_count": { "type": "integer", "example": 16 } } }, "submissions": { "type": "array", "items": { "type": "object", "properties": { "submission_id": { "type": "integer", "example": 90271 }, "filename": { "type": "string", "example": "nowak_alice_a4.zip" }, "status": { "type": "string", "example": "Completed" }, "status_id": { "type": "integer", "example": 4 }, "plagiarism_score": { "type": "object", "properties": { "local": { "type": "number", "example": 75 }, "web": { "type": "number", "example": 89 }, "total": { "type": "number", "example": 89 } } }, "matches": { "type": "object", "properties": { "local": { "type": "integer", "example": 3 }, "web": { "type": "integer", "example": 12 } } }, "ai_detection": { "type": "object", "nullable": true, "description": "AI-generated-code detection for this submission. null until the AI engine has run.", "properties": { "total_files": { "type": "integer", "example": 4 }, "avg_ai_probability": { "type": "number", "example": 91 }, "max_ai_probability": { "type": "number", "example": 94 }, "min_ai_probability": { "type": "number", "example": 88 }, "risk_level": { "type": "string", "description": "high (>=70), medium (>=45), or low.", "enum": ["high", "medium", "low"], "example": "high" }, "files": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 150669 }, "file_path": { "type": "string", "example": "nowak_alice_a4/BankAccount.java" }, "ai_probability": { "type": "number", "example": 94 }, "human_probability": { "type": "number", "example": 6 }, "classification": { "type": "string", "description": "Human-readable verdict, e.g. AI-Generated, Likely AI, Human.", "example": "AI-Generated" }, "confidence": { "type": "number", "description": "0-1 confidence in the classification.", "example": 0.96 }, "summary": { "type": "string", "example": "Uniform structure, textbook docstrings and near-zero stylistic variance across functions are strong indicators of AI-generated code." }, "detailed_report": { "type": "string", "nullable": true, "example": null }, "created_at": { "type": "string", "example": "2026-08-11 09:14:02" } } } } } }, "ai_code_quality": { "type": "object", "nullable": true, "description": "Static code-quality analysis for this submission. null until the AI engine has run.", "properties": { "total_files": { "type": "integer", "example": 4 }, "avg_score": { "type": "number", "example": 77 }, "max_score": { "type": "number", "example": 93 }, "min_score": { "type": "number", "example": 61 }, "files": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 156147 }, "file_path": { "type": "string", "example": "nowak_alice_a4/BankAccount.java" }, "score": { "type": "number", "example": 93 }, "level": { "type": "string", "description": "High, Medium, or Low.", "example": "High" }, "total_lines": { "type": "integer", "example": 84 }, "comment_density": { "type": "number", "description": "Comment lines as a fraction of total lines.", "example": 0.31 }, "entropy": { "type": "number", "description": "Token entropy; lower is more repetitive.", "example": 3.9 }, "issues": { "type": "array", "description": "Detected code-quality issues. Empty when none were found.", "items": { "type": "string", "example": "Deeply nested control flow in transfer()" } }, "created_at": { "type": "string", "example": "2026-08-11 09:14:02" } } } } } }, "file_size": { "type": "integer", "example": 10874 }, "created_at": { "type": "string", "example": "2026-08-11 09:14:02" }, "updated_at": { "type": "string", "example": "2026-08-11 09:41:37" } } } } } },
      "EngineStatus": { "type": "object", "properties": { "online": { "type": "boolean", "example": true, "description": "true only when both core and stream are up." }, "core": { "type": "object", "properties": { "online": { "type": "boolean", "example": true } } }, "stream": { "type": "object", "properties": { "online": { "type": "boolean", "example": true }, "subscribers": { "type": "integer", "nullable": true, "example": 3 } } }, "latency_ms": { "type": "integer", "example": 412 }, "cached_at": { "type": "string", "example": "2026-08-21T11:40:00+00:00" }, "stale": { "type": "boolean", "example": false, "description": "Present when a probe was already running and the last known answer was served instead." } } },
      "ViewerFileEntry": { "type": "object", "properties": { "id": { "type": "integer", "example": 785285 }, "submission_id": { "type": "integer", "example": 90271 }, "filedir": { "type": "string", "example": "nowak_alice_a4/BankAccount.java" }, "size_bytes": { "type": "integer", "example": 2310 }, "total_lines": { "type": "integer", "example": 96 }, "content": { "type": "string", "example": "package banking;\n", "description": "Only the first file carries content (and only under 256KB); fetch the others with /check/viewer/file." } } },
      "ViewerMatch": { "type": "object", "properties": { "id": { "type": "integer", "example": 1849201 }, "submission_id": { "type": "integer", "example": 90271 }, "match_type": { "type": "integer", "example": 1, "description": "1 peer, 2 database, 3 StackOverflow, 4 GitHub, 5 open web, 6 library, 10 AI block." }, "similarity": { "type": "number", "example": 82 }, "matched_similarity": { "type": "number", "example": 75 }, "file": { "type": "string", "example": "nowak_alice_a4/BankAccount.java" }, "file_matched": { "type": "string", "nullable": true, "example": "carter_ben_assignment4/BankAccount.java" }, "submission_id_matched": { "type": "integer", "nullable": true, "example": 90272 }, "line_start": { "type": "integer", "example": 12 }, "line_end": { "type": "integer", "example": 58 }, "line_matched_start": { "type": "integer", "example": 10 }, "line_matched_end": { "type": "integer", "example": 56 }, "tokens": { "type": "integer", "example": 47 }, "location": { "type": "string", "nullable": true, "example": "GitHub: octocat/bank-account" }, "source": { "type": "string", "nullable": true, "example": "https://github.com/octocat/bank-account/blob/main/BankAccount.java" }, "flags": { "type": "array", "description": "AI-detection flags the engine attached to the block, if any.", "items": { "type": "string", "example": "uniform_style" } }, "is_peer": { "type": "boolean", "example": true }, "is_web": { "type": "boolean", "example": false }, "is_ai": { "type": "boolean", "example": false }, "is_legacy_web": { "type": "boolean", "example": false, "description": "Web entries only: the id belongs to the legacy web table; pass legacy=true to /check/viewer/counterpart." }, "has_content": { "type": "boolean", "example": true, "description": "Web entries only: whether the source's text is stored, which decides whether a side-by-side can be opened." }, "web_lines": { "type": "integer", "example": 33, "description": "Web entries only: matched lines the engine reported for the whole source." }, "web_longest": { "type": "integer", "example": 12, "description": "Web entries only: the longest unbroken run of matched lines." } } },
      "ViewerRailEntry": { "type": "object", "properties": { "id": { "type": "integer", "example": 90271 }, "filename": { "type": "string", "example": "Nowak_Alice_A4" }, "status_id": { "type": "integer", "example": 4 }, "status": { "type": "string", "example": "Completed" }, "group_score": { "type": "number", "example": 75 }, "web_score": { "type": "number", "example": 89 }, "web_score_derived": { "type": "boolean", "example": false, "description": "true when the engine left no overall web score and the strongest single source is shown instead." }, "total_result": { "type": "number", "example": 0 }, "ai_score": { "type": "number", "nullable": true, "example": 64.3 }, "ai_max": { "type": "number", "nullable": true, "example": 91.2 }, "ai_files": { "type": "integer", "example": 1 }, "matches_local": { "type": "integer", "example": 3 }, "matches_web": { "type": "integer", "example": 12 }, "file_size": { "type": "integer", "example": 1091 }, "created_at": { "type": "string", "nullable": true, "example": "2026-08-11 09:41:37" }, "updated_at": { "type": "string", "nullable": true, "example": "2026-08-11 09:52:10" } } },
      "ViewerResults": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "check": { "type": "object", "properties": { "id": { "type": "integer", "example": 12345 }, "name": { "type": "string", "example": "Assignment 4" }, "status_id": { "type": "integer", "example": 4 }, "status": { "type": "string", "example": "Completed" }, "test_type": { "type": "integer", "example": 1 }, "language_id": { "type": "integer", "example": 13 }, "ai_run": { "type": "boolean", "example": true }, "created_at": { "type": "string", "nullable": true, "example": "2026-08-11 09:40:00" }, "updated_at": { "type": "string", "nullable": true, "example": "2026-08-11 09:52:10" } } }, "submission": { "type": "object", "description": "The submission being viewed.", "properties": { "id": { "type": "integer", "example": 90271 }, "assignment_id": { "type": "integer", "example": 12345 }, "filename": { "type": "string", "example": "Nowak_Alice_A4" }, "total_result": { "type": "number", "example": 0 }, "result1": { "type": "number", "example": 75 }, "result2": { "type": "number", "example": 89 }, "updated_at": { "type": "string", "nullable": true, "example": "2026-08-11 09:52:10" } } }, "rail": { "type": "array", "items": { "$ref": "#/components/schemas/ViewerRailEntry" } }, "submissions": { "type": "array", "description": "Minimal sibling list as the dashboard loads it; `rail` carries the scores.", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 90272 }, "filename": { "type": "string", "example": "carter_ben_assignment4" }, "total_result": { "type": "number", "example": 0 }, "updated_at": { "type": "string", "nullable": true, "example": "2026-08-11 09:52:10" } } } }, "files": { "type": "array", "items": { "$ref": "#/components/schemas/ViewerFileEntry" } }, "matches": { "type": "array", "description": "Peer and AI matches for the viewed submission.", "items": { "$ref": "#/components/schemas/ViewerMatch" } }, "web_files": { "type": "array", "description": "Web sources for the viewed submission, one entry per source.", "items": { "$ref": "#/components/schemas/ViewerMatch" } }, "ai_files": { "type": "array", "description": "Per-file AI verdicts for the viewed submission.", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 5120 }, "file_path": { "type": "string", "example": "nowak_alice_a4/BankAccount.java" }, "ai_probability": { "type": "number", "example": 91.2 }, "human_probability": { "type": "number", "example": 8.8 }, "classification": { "type": "string", "nullable": true, "example": "AI-generated" }, "confidence": { "type": "number", "nullable": true, "example": 0.93 }, "summary": { "type": "string", "nullable": true, "example": "Uniform structure and comment density typical of generated code." } } } }, "stats": { "type": "object", "properties": { "avg": { "type": "number", "example": 18.4 }, "max": { "type": "number", "example": 89 }, "min": { "type": "number", "example": 0 } } }, "avg": { "type": "number", "example": 18.4 }, "max": { "type": "number", "example": 89 }, "min": { "type": "number", "example": 0 }, "dashboard_url": { "type": "string", "example": "https://dashboard.codequiry.com/course/57963/assignment/12345/result-drillerv2" }, "meta": { "type": "object", "properties": { "execution_time_ms": { "type": "number", "example": 84.2 }, "cached": { "type": "boolean", "example": false }, "optimized": { "type": "boolean", "example": true } } } } },
      "ViewerFile": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "content": { "type": "string", "example": "package banking;\n" }, "filedir": { "type": "string", "example": "nowak_alice_a4/BankAccount.java" } } },
      "ViewerCounterpart": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "file": { "type": "object", "properties": { "content": { "type": "string", "example": "package banking;\n" }, "filedir": { "type": "string", "example": "carter_ben_assignment4/BankAccount.java" } } }, "match": { "type": "object", "properties": { "line_start": { "type": "integer", "example": 12 }, "line_end": { "type": "integer", "example": 58 }, "line_matched_start": { "type": "integer", "example": 10 }, "line_matched_end": { "type": "integer", "example": 56 }, "similarity": { "type": "number", "example": 82 } } } } }
    }
  }
}
