{"openapi":"3.1.0","info":{"title":"ScanForAI API","description":"Detect AI-written text and clean it up. Public endpoints: **scan** a document for AI-writing signals, and **cleanup** (strip machine typography, no rewriting). Authenticate with an `at_sk_` API key: `Authorization: Bearer <key>`. The score is a signal, not a verdict.","version":"1"},"paths":{"/api/scan":{"post":{"tags":["scan"],"summary":"Scan Endpoint","operationId":"scan_endpoint_api_scan_post","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"json","title":"Format"}},{"name":"use_model","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Use Model"}},{"name":"include_fixes","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Fixes"}},{"name":"background","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Background"}},{"name":"text_language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The language the text is written in: \"auto\" (the default) or the code of a language this api scores, from /api/config `languages` (for example \"en\" or \"es\"). Also accepted as `text_language` in a JSON body. A text clearly in another language is still read as that language, and the result says so in `text_language` (`picked`, `read_as`, `applied`).","title":"Text Language"},"description":"The language the text is written in: \"auto\" (the default) or the code of a language this api scores, from /api/config `languages` (for example \"en\" or \"es\"). Also accepted as `text_language` in a JSON body. A text clearly in another language is still read as that language, and the result says so in `text_language` (`picked`, `read_as`, `applied`)."},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"The scan result. It carries `outcome` (`scored`, `too_short`, `unsupported_language`, `deep_required` or `deep_failed`) and an `i18n` block (see `I18nBlock`). When the request named a `text_language` other than `auto`, it also carries `text_language`: `picked` (the code asked for), `read_as` (the language the text was read in, null when it was not scored for language reasons) and `applied` (false when the text said otherwise, or the language is not available right now).","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/extract":{"post":{"tags":["scan"],"summary":"Extract Endpoint","description":"Pull plain text out of an uploaded file so the client can drop it INTO the\ntextarea and review it before scanning (not an auto-scan). Nothing is stored.","operationId":"extract_endpoint_api_extract_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/fetch-url":{"post":{"tags":["scan"],"summary":"Fetch Url Endpoint","description":"Fetch a public web page's text for the textarea (review before scanning).\nSSRF-guarded (see services/urlfetch); nothing is stored.","operationId":"fetch_url_endpoint_api_fetch_url_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/verify":{"post":{"tags":["scan"],"summary":"Verify Endpoint","description":"Trade a Turnstile token for a scan pass. Proving browser-ness is now its own\nstep, not a passenger on the first scan.\n\nIt used to only happen INSIDE /api/scan, which forced the client to hold the\nscan until a token existed — www waits up to 2.8s for the widget and then scans\nwithout one anyway, so a slow link silently bought the weak engine. Verification\ncan now finish while the user is still typing, and the pass applies from the\nfirst scan onward.\n\nReturns the pass in the BODY as well as a cookie: the cookie is third-party for\nevery one of our clients (page scanforai.com, API api.scanforai.com), so it is\nthe copy most likely to be discarded. Clients keep the string and send it back\nas X-Scan-Pass.\n\nNever an error path for the caller: a bad token answers 200 with ok=false, and\nthe scan endpoint still degrades rather than rejecting, so a client that cannot\nverify at all keeps working on the unverified quota.","operationId":"verify_endpoint_api_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/config":{"get":{"tags":["scan"],"summary":"Config","description":"Limits the UI needs (counter cap, min-words hint, monthly quota) - no secrets.","operationId":"config_api_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/scan/image":{"post":{"tags":["scan"],"summary":"Scan Image","description":"Check what an image **declares** about AI generation.\n\nReads C2PA Content Credentials, IPTC digital-source-type, EXIF/XMP software\ntags and generation-prompt blocks. `declared: true` is a certainty — the\nfile says so itself. `declared: false` only means the file carries no\ndisclosure; most platforms strip metadata, so absence is not evidence a\nperson made the picture.","operationId":"scan_image_api_scan_image_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/cleanup":{"post":{"tags":["cleanup"],"summary":"Cleanup","operationId":"cleanup_api_cleanup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]},"get":{"tags":["cleanup"],"summary":"List Items","operationId":"list_items_api_cleanup_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}},"delete":{"tags":["cleanup"],"summary":"Delete All","operationId":"delete_all_api_cleanup_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/cleanup/file":{"post":{"tags":["cleanup"],"summary":"Cleanup File","description":"Clean an uploaded document IN PLACE and stream the cleaned file back — .docx\nand .odt keep their full structure/formatting; .pdf degrades to cleaned .txt.\nThis is the fix for 'cleaned file comes back as broken plain text'.","operationId":"cleanup_file_api_cleanup_file_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/cleanup/{hid}":{"get":{"tags":["cleanup"],"summary":"Get Item","operationId":"get_item_api_cleanup__hid__get","parameters":[{"name":"hid","in":"path","required":true,"schema":{"type":"string","title":"Hid"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}},"delete":{"tags":["cleanup"],"summary":"Delete Item","operationId":"delete_item_api_cleanup__hid__delete","parameters":[{"name":"hid","in":"path","required":true,"schema":{"type":"string","title":"Hid"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/report":{"post":{"tags":["report"],"summary":"Report","operationId":"report_api_report_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/report/injection":{"post":{"tags":["report"],"summary":"Injection Report","description":"PDF report of an image injection scan. Same three modes as /api/report:\nclient-posted result (no QR), a saved scan of the caller's own (durable\nverify-QR + stored thumbnail), or a share token (report built from the STORED\nscan, never from client data). Same rate bucket as text reports.","operationId":"injection_report_api_report_injection_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InjectionReportIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/feedback":{"post":{"tags":["feedback"],"summary":"Give Feedback","operationId":"give_feedback_api_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/ratings":{"post":{"tags":["ratings"],"summary":"Rate","operationId":"rate_api_ratings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatingIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/ratings/summary":{"get":{"tags":["ratings"],"summary":"Summary","description":"The published counters. ONE ROW BY PRIMARY KEY — no scan, no dedupe, no\npolicy. All of that happened in services/ratings_build when the row was built.\n\nWhich row is served is a SETTING (`ratings_public_key`), currently `public_all`\n— every channel, imports included. The alternative is `public_web`, our own\nchannels only.\n\nThat choice matters the day the JSON-LD goes live: presenting another platform's\nreviews inside your own aggregateRating is what earns a manual action. It is\ninert today because ratings_markup_enabled is off and nothing is rendered.","operationId":"summary_api_ratings_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/injection/image":{"post":{"tags":["injection"],"summary":"Scan Image","description":"Scan one image. Returns a density, a band, a confidence and the reads behind them.\n\nQuery/form flags:\n  deep=true      ask for the OCR tier (runs on a model worker; degrades to the\n                 light read if no worker answers — never 5xx)\n  redact=true    return classifications and hashes only, never extracted payload text\n  save=true      keep this scan in the account's history (result + a small\n                 thumbnail + a hash of the upload — never the original file).\n                 Default is NOT saved: nothing about an image scan is stored\n                 unless asked.","operationId":"scan_image_api_injection_image_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/injection/quota":{"get":{"tags":["injection"],"summary":"Quota","description":"What this account may scan, so a client can show it without guessing (the same limits the scan applies,\nchannel modifier included).","operationId":"quota_api_injection_quota_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/classes":{"get":{"tags":["classes"],"summary":"List Classes","operationId":"list_classes_api_classes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]},"post":{"tags":["classes"],"summary":"Create Class","operationId":"create_class_api_classes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}},"parameters":[{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}]}},"/api/classes/{class_id}":{"patch":{"tags":["classes"],"summary":"Edit Class","operationId":"edit_class_api_classes__class_id__patch","parameters":[{"name":"class_id","in":"path","required":true,"schema":{"type":"string","title":"Class Id"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassEdit"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}},"delete":{"tags":["classes"],"summary":"Delete Class","operationId":"delete_class_api_classes__class_id__delete","parameters":[{"name":"class_id","in":"path","required":true,"schema":{"type":"string","title":"Class Id"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/classes/{class_id}/submissions":{"get":{"tags":["classes"],"summary":"Submissions","operationId":"submissions_api_classes__class_id__submissions_get","parameters":[{"name":"class_id","in":"path","required":true,"schema":{"type":"string","title":"Class Id"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/classes/{class_id}/close":{"post":{"tags":["classes"],"summary":"Close Class","operationId":"close_class_api_classes__class_id__close_post","parameters":[{"name":"class_id","in":"path","required":true,"schema":{"type":"string","title":"Class Id"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/classes/{class_id}/rotate":{"post":{"tags":["classes"],"summary":"Rotate Code","operationId":"rotate_code_api_classes__class_id__rotate_post","parameters":[{"name":"class_id","in":"path","required":true,"schema":{"type":"string","title":"Class Id"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/classes/{class_id}/submissions/{sid}":{"delete":{"tags":["classes"],"summary":"Delete Submission","operationId":"delete_submission_api_classes__class_id__submissions__sid__delete","parameters":[{"name":"class_id","in":"path","required":true,"schema":{"type":"string","title":"Class Id"}},{"name":"sid","in":"path","required":true,"schema":{"type":"string","title":"Sid"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/classes/{class_id}/submissions/{sid}/report.pdf":{"get":{"tags":["classes"],"summary":"Submission Report","description":"The standard scan-report PDF for one submission — same artefact as any\nsaved scan's report (score, band, signal panel, sentence marks, source\nexcerpt), titled class — student. Teacher-only via ownership.","operationId":"submission_report_api_classes__class_id__submissions__sid__report_pdf_get","parameters":[{"name":"class_id","in":"path","required":true,"schema":{"type":"string","title":"Class Id"}},{"name":"sid","in":"path","required":true,"schema":{"type":"string","title":"Sid"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/classes/{class_id}/export.csv":{"get":{"tags":["classes"],"summary":"Export Csv","operationId":"export_csv_api_classes__class_id__export_csv_get","parameters":[{"name":"class_id","in":"path","required":true,"schema":{"type":"string","title":"Class Id"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/c/{code}":{"get":{"tags":["classes-public"],"summary":"Class Info","operationId":"class_info_api_c__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/c/{code}/qr.png":{"get":{"tags":["classes-public"],"summary":"Class Qr","description":"Server-rendered QR for the class link. Exists because email clients strip\ndata: URIs - the creation mail references THIS url; pages may reuse it.","operationId":"class_qr_api_c__code__qr_png_get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/c/{code}/submit":{"post":{"tags":["classes-public"],"summary":"Submit","operationId":"submit_api_c__code__submit_post","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}},"/api/health":{"get":{"summary":"Health","operationId":"health_api_health_get","parameters":[{"name":"x-status-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Status-Token"}},{"$ref":"#/components/parameters/XUILang"},{"$ref":"#/components/parameters/LangQuery"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"headers":{"Content-Language":{"description":"Language of `message`; sent only when the request named a language.","schema":{"type":"string"}}}}}}}},"components":{"schemas":{"ClassEdit":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":120,"minLength":3},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"ends":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ends"},"require_text":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Require Text"}},"type":"object","title":"ClassEdit"},"ClassIn":{"properties":{"name":{"type":"string","maxLength":120,"minLength":3,"title":"Name"},"roster":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":500},{"type":"null"}],"title":"Roster"},"roster_only":{"type":"boolean","title":"Roster Only","default":false},"ends":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ends"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"require_text":{"type":"boolean","title":"Require Text","default":false}},"type":"object","required":["name"],"title":"ClassIn"},"FeedbackIn":{"properties":{"verdict":{"type":"string","enum":["right","wrong"],"title":"Verdict"},"expected":{"anyOf":[{"type":"string","enum":["human","ai"]},{"type":"null"}],"title":"Expected"},"scan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scan Id"},"score":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Score"},"band":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}],"title":"Band"},"profile":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}],"title":"Profile"},"genre":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Genre"},"word_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Word Count"},"text":{"anyOf":[{"type":"string","maxLength":200000},{"type":"null"}],"title":"Text"},"consent_text":{"type":"boolean","title":"Consent Text","default":false}},"type":"object","required":["verdict"],"title":"FeedbackIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InjectionReportIn":{"properties":{"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"image_scan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Scan Id"},"share_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Share Token"},"hide_found_text":{"type":"boolean","title":"Hide Found Text","default":false}},"type":"object","title":"InjectionReportIn"},"RatingIn":{"properties":{"stars":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Stars"},"scan_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Scan Id"}},"type":"object","required":["stars"],"title":"RatingIn"},"ReportIn":{"properties":{"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"source_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Text"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"scan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scan Id"},"share_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Share Token"}},"type":"object","title":"ReportIn"},"SubmitIn":{"properties":{"student_name":{"type":"string","maxLength":120,"minLength":1,"title":"Student Name"},"result":{"additionalProperties":true,"type":"object","title":"Result"},"text":{"anyOf":[{"type":"string","maxLength":60000},{"type":"null"}],"title":"Text"},"consent":{"type":"boolean","title":"Consent","description":"must be true; the client button states what is sent"}},"type":"object","required":["student_name","result","consent"],"title":"SubmitIn"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyIn":{"properties":{"turnstile_token":{"type":"string","title":"Turnstile Token","default":""}},"type":"object","title":"VerifyIn"},"ErrorBody":{"type":"object","required":["detail","code","params"],"properties":{"detail":{"description":"The error in English, exactly as it has always read. A list of field problems for status 422.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"code":{"type":"string","description":"Stable identifier of the error, for programs. Never changes wording.","example":"err.rate_limit.scan"},"params":{"type":"object","additionalProperties":true,"description":"The values the error is about (for example the seconds to wait as `retry`)."},"message":{"type":"string","description":"The error in the language the request named. Present only when it named one."}}},"I18nBlock":{"type":"object","required":["v","text_lang","ui_lang","ids","params"],"description":"Added to every scan result, after the existing fields. It names the catalogue id of every sentence the result carries, so a program decides by ids and codes and never by reading English.","properties":{"v":{"type":"integer","example":1,"description":"Version of this block's shape."},"text_lang":{"type":"string","example":"en","description":"The language of the scanned text."},"ui_lang":{"type":"string","example":"en","description":"The language the request named for the answer (`en` when it named none)."},"ids":{"type":"object","additionalProperties":true,"description":"By field (`headline`, `label`, `confidence_note`, `length_note`, `notes`, `evidence`, `fixes`, `signals`, `override`, `chunk_note`, `deep_note`, `degraded`, `disclaimer`, `coverage`, `type_label`, `genre_note`, `excluded_note`, `extraction_note`, `document`): the id, a list of ids aligned with the field's list, or null when the field has no sentence. `text_language_line` (\"Text language: Spanish\") is the language the text was read in, on every result and every stored read of it (null when the text's language is not clear); its params are `{language: <code>}`, and `result.text_language.line_unscored` is the id for a language the scanner does not score yet. `text_language` (the note of a text-language pick the text overruled) is present only on the answer to the person who picked."},"params":{"type":"object","additionalProperties":true,"description":"The values the sentences are about (a language code, a minimum word count, the words a check matched), by field."},"sentence_why":{"type":"array","nullable":true,"items":{"type":"array","items":{"type":"string"}},"description":"For each entry of `sentences`, the codes of the checks behind its mark."},"coverage":{"type":"object","properties":{"missing":{"type":"array","items":{"type":"string"}}},"description":"What the reading of the text's language does not look at yet (capability codes)."},"text":{"type":"object","additionalProperties":true,"description":"The same fields as sentences in the language the request named. Present only when it named a language other than English."}}}},"parameters":{"XUILang":{"name":"X-UI-Lang","in":"header","required":false,"description":"Language of the answer's `message` fields (a language code such as `en` or `es`; only the part before any `-` is used). Without it, the answer is English as always and error bodies carry no `message`.","schema":{"type":"string","maxLength":16}},"LangQuery":{"name":"lang","in":"query","required":false,"description":"The same as the `X-UI-Lang` header, for requests a browser makes without custom headers. If both are sent, `lang` wins.","schema":{"type":"string","maxLength":16}}}}}