{
 "openapi": "3.1.0",
 "info": {
  "title": "ALL AI FORMS public API",
  "version": "1.0.0",
  "description": "Read-only discovery API for ALL AI FORMS listings (U.S. state, county and federal forms, $4.99 one-time each via Stripe). Not a government agency. Not legal advice."
 },
 "servers": [
  {
   "url": "https://www.allaiforms.com"
  }
 ],
 "paths": {
  "/api/forms.json": {
   "get": {
    "operationId": "listForms",
    "summary": "List every live form with issuer, official source, price and pay URL",
    "responses": {
     "200": {
      "description": "Manifest",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "api_version": {
           "type": "string"
          },
          "count": {
           "type": "integer"
          },
          "forms": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Form"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/forms/{id}.json": {
   "get": {
    "operationId": "getForm",
    "summary": "Get one form record by ID (e.g. US-KS-TR312)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Form",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Form"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/catalog.json": {
   "get": {
    "operationId": "catalog",
    "summary": "Legacy simple catalog",
    "responses": {
     "200": {
      "description": "Catalog"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Form": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "jurisdiction": {
      "type": "string"
     },
     "state": {
      "type": "string"
     },
     "category": {
      "type": "string"
     },
     "document_type": {
      "type": "string"
     },
     "official_status": {
      "type": "string"
     },
     "issuing_agency": {
      "type": "string"
     },
     "official_source_url": {
      "type": "string"
     },
     "summary": {
      "type": "string"
     },
     "pay_url": {
      "type": "string"
     },
     "page_url": {
      "type": "string"
     },
     "json_url": {
      "type": "string"
     },
     "last_verified": {
      "type": "string"
     },
     "listing_updated": {
      "type": "string"
     },
     "price": {
      "type": "object",
      "properties": {
       "amount": {
        "type": "number"
       },
       "currency": {
        "type": "string"
       },
       "billing": {
        "type": "string"
       }
      }
     },
     "faq": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "q": {
         "type": "string"
        },
        "a": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 }
}
