{
  "openapi": "3.1.0",
  "info": {
    "title": "AppealArmor public read-only data",
    "version": "1.0.0",
    "summary": "Three public, read-only GET endpoints. No patient data, no cases.",
    "description": "AppealArmor (https://appealarmor.com) is a free tool that drafts a health-insurance appeal letter from a patient's own denial letter. This description lists only public, read-only GET endpoints that carry no patient information. It deliberately lists nothing that starts, reads or changes a patient case: the patient tool at https://appealarmor.com/app/ is for a person to use in a browser and has no public API. Not legal advice.",
    "contact": { "name": "AppealArmor", "email": "admin@appealarmor.com", "url": "https://appealarmor.com/about/" },
    "termsOfService": "https://appealarmor.com/terms.html"
  },
  "servers": [{ "url": "https://appealarmor.com" }],
  "externalDocs": {
    "description": "Agent map: what AppealArmor is, how its letters are built, and the pages worth citing (llmstxt.org format).",
    "url": "https://appealarmor.com/llms.txt"
  },
  "paths": {
    "/api/version": {
      "get": {
        "operationId": "getVersion",
        "summary": "Version of the running site",
        "description": "The release that is live, and the commit it was built from.",
        "responses": {
          "200": {
            "description": "The live release.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": { "type": "string", "description": "Semantic version, for example 6.47.0." },
                    "buildDate": { "type": "string", "format": "date", "description": "Date of the response, America/New_York." },
                    "name": { "type": "string" },
                    "gitSha": { "type": ["string", "null"], "description": "40-character commit hash, or null when not known." }
                  },
                  "required": ["version"]
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/public/stats": {
      "get": {
        "operationId": "getPublicStats",
        "summary": "Aggregate counts of letters written and appeals reported won",
        "description": "Counts only, from real (non-test) cases. A count is null until it reaches a minimum (25 by default) and is rounded down to a multiple of 5, so a small number never leaves the server. Cached by the edge for about an hour.",
        "responses": {
          "200": {
            "description": "The counts. When the figures are not available, available is false and every count is null.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available": { "type": "boolean" },
                    "lettersWritten": { "type": ["integer", "null"], "description": "Appeal letters delivered, rounded down to a multiple of 5, or null below the minimum." },
                    "appealsWon": { "type": ["integer", "null"], "description": "Patients who reported their appeal was won, same rounding, or null." },
                    "since": { "type": ["string", "null"], "format": "date", "description": "The day counting began." }
                  },
                  "required": ["available", "lettersWritten", "appealsWon", "since"]
                }
              }
            }
          }
        }
      }
    },
    "/data/state-law.json": {
      "get": {
        "operationId": "getStateLaw",
        "summary": "The checked table of state law that appeal letters can quote",
        "description": "One row per provision (external review and step therapy), each with the citation, the exact quoted words, the official source URL, which plan types it applies to, when the letter may use it, and the date it was retrieved. Rows are public law quoted from official sources; this is not legal advice. States without a row are listed in _meta.jurisdictionsWithoutRows.",
        "responses": {
          "200": {
            "description": "The table.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_meta": { "type": "object", "description": "Counts, topics, license and how rows are chosen." },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": { "type": "string" },
                          "state": { "type": "string", "description": "Two-letter code." },
                          "stateName": { "type": "string" },
                          "topic": { "type": "string", "enum": ["external_review", "step_therapy"] },
                          "title": { "type": "string" },
                          "cite": { "type": "string" },
                          "quote": { "type": "string" },
                          "url": { "type": "string", "format": "uri", "description": "Official source." },
                          "appliesTo": { "type": "array", "items": { "type": "string" } },
                          "condition": { "type": "string" },
                          "letterUse": { "type": "string", "enum": ["letter", "letter_when_denial_matches", "next_steps_only"] },
                          "retrievedAt": { "type": "string", "format": "date-time" }
                        },
                        "required": ["id", "state", "topic", "cite", "quote", "url", "appliesTo", "letterUse", "retrievedAt"]
                      }
                    }
                  },
                  "required": ["_meta", "rows"]
                }
              }
            }
          }
        }
      }
    }
  }
}
