{
 "openapi": "3.1.0",
 "info": {
  "title": "RisingTests AI Request Desk",
  "version": "1.3.0",
  "description": "Ask for information you could not find; search answers checked against official or clearly reliable sources. No key needed."
 },
 "servers": [
  {
   "url": "https://risingtests.com"
  }
 ],
 "paths": {
  "/api/answers": {
   "get": {
    "operationId": "searchAnswers",
    "summary": "List or search published answers",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Keywords"
     },
     {
      "name": "id",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "One answer by id"
     },
     {
      "name": "kind",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "number",
        "calculator",
        "rule",
        "deadline",
        "procedure",
        "other"
       ]
      }
     },
     {
      "name": "topic",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Topic, for example tax, travel, software, education, health"
     },
     {
      "name": "changed_since",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "Only answers checked on or after this date (refresh a cache)"
     },
     {
      "name": "due",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "1"
       ]
      },
      "description": "Only answers past their next_review date (possibly out of date)"
     },
     {
      "name": "ids",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Comma-separated answer ids (max 25)"
     }
    ],
    "responses": {
     "200": {
      "description": "Answers with source links and checked dates"
     }
    }
   }
  },
  "/api/request": {
   "post": {
    "operationId": "requestInfo",
    "summary": "Ask for something you could not find",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "question",
         "kind"
        ],
        "properties": {
         "question": {
          "type": "string",
          "minLength": 10,
          "maxLength": 500
         },
         "kind": {
          "type": "string",
          "enum": [
           "number",
           "calculator",
           "rule",
           "deadline",
           "procedure",
           "other"
          ]
         },
         "topic": {
          "type": "string"
         },
         "context": {
          "type": "string"
         },
         "client": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "Request id"
     },
     "400": {
      "description": "Invalid"
     },
     "429": {
      "description": "Rate limit"
     }
    }
   },
   "get": {
    "operationId": "requestStatus",
    "summary": "Status of a request",
    "parameters": [
     {
      "name": "id",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Status, and the answer when answered"
     }
    }
   }
  },
  "/api/feedback": {
   "post": {
    "operationId": "sendFeedback",
    "summary": "Say what helped or what was missing",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "message"
        ],
        "properties": {
         "message": {
          "type": "string",
          "minLength": 10,
          "maxLength": 500
         },
         "useful": {
          "type": "boolean"
         },
         "answer_id": {
          "type": "string"
         },
         "client": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "Received"
     }
    }
   }
  },
  "/api/info": {
   "get": {
    "operationId": "siteInfo",
    "summary": "What this desk offers, recent updates and endpoints",
    "responses": {
     "200": {
      "description": "Info"
     }
    }
   }
  },
  "/api/verify": {
   "get": {
    "operationId": "verifyClaim",
    "summary": "Fact-check a number against checked official answers",
    "parameters": [
     {
      "name": "value",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Number to check, e.g. 1776 or $1,776"
     },
     {
      "name": "answer_id",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "claim",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "What the number is, e.g. 2027 Medicare Part A deductible"
     }
    ],
    "responses": {
     "200": {
      "description": "verdict: matches | matches_a_listed_figure | matches_previous_value (outdated) | differs | not_covered, with official value, source and checked date"
     }
    }
   }
  }
 }
}