{"openapi":"3.1.0","info":{"title":"Reliability API","description":"Reliability scores for public organisations and public figures, with every claim, verdict and piece of evidence behind them. How the score is calculated: /methodology.","version":"0.1"},"paths":{"/health":{"get":{"summary":"Health","description":"Public liveness check for the platform's healthcheck. Says nothing about the service's state.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/status":{"get":{"summary":"Status","description":"Method version, queue depth and the daily spend against its ceiling.","operationId":"status_v1_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/subjects/resolve":{"post":{"summary":"Resolve Subjects","description":"Name plus identifiers, or a block of text, to candidate subjects. Known subjects come back with\ntheir ids at once; a new name is identified with a short model call and checked against the rules\n(public figure, not a serving politician).","operationId":"resolve_subjects_v1_subjects_resolve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subjects":{"get":{"summary":"List Subjects","description":"Subjects with at least one stored report, newest report first.","operationId":"list_subjects_v1_subjects_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/subjects/{subject_id}":{"get":{"summary":"Get Subject","operationId":"get_subject_v1_subjects__subject_id__get","parameters":[{"name":"subject_id","in":"path","required":true,"schema":{"type":"string","title":"Subject Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reports":{"post":{"summary":"Create Report","description":"Return a stored report under 90 days old at once; otherwise start a job (HTTP 202). A stale\nstored report is returned with `stale: true` while a refresh job runs.","operationId":"create_report_v1_reports_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reports/{report_or_job_id}":{"get":{"summary":"Get Report","description":"A job's status (queued, running, complete, insufficient, refused, failed) and, when complete,\nits report; or a stored report by its id.","operationId":"get_report_v1_reports__report_or_job_id__get","parameters":[{"name":"report_or_job_id","in":"path","required":true,"schema":{"type":"string","title":"Report Or Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reports/{report_id}/html":{"get":{"summary":"Get Report Html","operationId":"get_report_html_v1_reports__report_id__html_get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subjects/{subject_id}/claims":{"get":{"summary":"Get Claims","description":"Every claim behind the subject's latest report, filterable by type, broad topic and outcome.","operationId":"get_claims_v1_subjects__subject_id__claims_get","parameters":[{"name":"subject_id","in":"path","required":true,"schema":{"type":"string","title":"Subject Id"}},{"name":"claim_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Type"}},{"name":"topic","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topic"}},{"name":"outcome","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":50,"title":"Page Size"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Same as claim_type","title":"Type"},"description":"Same as claim_type"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/export":{"get":{"summary":"Export","description":"Download the stored database: every subject's latest report. `jsonl` gives one JSON record per line\n(`subject`, `score` and `claim` records, with verdicts, evidence links and quotes); `csv` gives one table,\n`claims` (default) or `scores`. Demo subjects are left out unless `include_demo=true`.","operationId":"export_v1_export_get","parameters":[{"name":"format","in":"query","required":false,"schema":{"enum":["jsonl","csv"],"type":"string","default":"jsonl","title":"Format"}},{"name":"table","in":"query","required":false,"schema":{"enum":["claims","scores"],"type":"string","default":"claims","title":"Table"}},{"name":"subject_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Id"}},{"name":"include_demo","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Demo"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/check":{"post":{"summary":"Check","description":"Claims or a block of text in; per-claim outcomes out, with no score. Runs as a job (HTTP 202).\nThe text is deleted from the job when it ends.","operationId":"check_v1_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/responses":{"post":{"summary":"Add Response","description":"A subject's reply or correction to a claim, with counter-evidence. Stored and shown on the claim\nas 'response received, not yet reviewed'.","operationId":"add_response_v1_responses_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/demo":{"get":{"summary":"Demo Database","description":"The demo database: subjects whose claims have outcomes published by others, each claim's machine verdict\nbeside the published outcome, and agreement rates per set. Agreement on these sets is not accuracy.","operationId":"demo_database_v1_demo_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/labels":{"post":{"summary":"Add Label","description":"A reviewer's own verdict on a claim, for the human-labelled gold set (SPEC section 8). The answer\nreveals the machine verdict and, for demo subjects, the published outcome.","operationId":"add_label_v1_labels_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Labels","description":"The labels made with the caller's key, optionally for one subject, as JSON or CSV.","operationId":"get_labels_v1_labels_get","parameters":[{"name":"subject_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Id"}},{"name":"format","in":"query","required":false,"schema":{"enum":["json","csv"],"type":"string","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/labels/claims":{"get":{"summary":"Label Queue","description":"A subject's researched claims for blind labelling: no machine verdict or rationale until the\ncaller has labelled the claim.","operationId":"label_queue_v1_labels_claims_get","parameters":[{"name":"subject_id","in":"query","required":true,"schema":{"type":"string","title":"Subject Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/methodology":{"get":{"summary":"Methodology","description":"The current method version, the published method and the latest published measurement.","operationId":"methodology_v1_methodology_get","parameters":[{"name":"format","in":"query","required":false,"schema":{"enum":["json","markdown","html"],"type":"string","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CheckClaim":{"properties":{"text":{"type":"string","maxLength":5000,"title":"Text"},"source_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Source Url"}},"type":"object","required":["text"],"title":"CheckClaim"},"CheckRequest":{"properties":{"text":{"anyOf":[{"type":"string","maxLength":50000},{"type":"null"}],"title":"Text","description":"A page or draft; checkable claims are taken from it"},"claims":{"anyOf":[{"items":{"$ref":"#/components/schemas/CheckClaim"},"type":"array","maxItems":50},{"type":"null"}],"title":"Claims","description":"Or a list of claims, each with an optional cited source"},"author":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Author","description":"Who wrote the text, if known"},"said_on":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Said On","description":"When the text was written (YYYY-MM-DD); defaults to today"}},"type":"object","title":"CheckRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LabelRequest":{"properties":{"claim_id":{"type":"string","maxLength":100,"title":"Claim Id"},"verdict":{"type":"string","enum":["true","mostly_true","mixed","mostly_false","false","unresolvable","not_a_claim"],"title":"Verdict"},"on_time":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"On Time"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"},"reviewer":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Reviewer"}},"type":"object","required":["claim_id","verdict"],"title":"LabelRequest"},"ReportRequest":{"properties":{"subject_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Subject Id"},"name":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Name"},"urls":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Urls"},"handles":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Handles"},"kind":{"anyOf":[{"type":"string","enum":["person","organisation","outlet"]},{"type":"null"}],"title":"Kind"},"topic":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Topic"},"depth":{"type":"string","enum":["quick","standard"],"title":"Depth","default":"quick"},"consent_ref":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Consent Ref","description":"Required for a person who is not a public figure"},"refresh":{"type":"boolean","title":"Refresh","description":"Start a new job even if a fresh report is stored","default":false}},"type":"object","title":"ReportRequest"},"ResolveRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Name","description":"Name of a person, organisation or outlet"},"urls":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Urls","description":"URLs that identify the subject"},"handles":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Handles"},"kind":{"anyOf":[{"type":"string","enum":["person","organisation","outlet"]},{"type":"null"}],"title":"Kind"},"text":{"anyOf":[{"type":"string","maxLength":50000},{"type":"null"}],"title":"Text","description":"A block of text, such as an application; the people and organisations it names are returned. The text is not stored."}},"type":"object","title":"ResolveRequest"},"ResponseRequest":{"properties":{"claim_id":{"type":"string","maxLength":100,"title":"Claim Id"},"name":{"type":"string","maxLength":300,"title":"Name"},"role":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Role","description":"For example 'the subject' or 'communications lead'"},"statement":{"type":"string","maxLength":10000,"title":"Statement"},"counter_evidence_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Counter Evidence Url"}},"type":"object","required":["claim_id","name","statement"],"title":"ResponseRequest"},"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"}}}}