{
  "openapi": "3.1.0",
  "info": {
    "title": "Local Rules API",
    "version": "0.5.1",
    "description": "Cited local rules (San Diego County short-term rentals first) with official source URLs (.gov, or labeled official city or county sites), retrieved and last-checked dates. Free, keyless, read-only. Informational only, not legal advice. Rules are summarized from the cited official sources and may be incomplete, out of date or wrong. Do not rely on this data. Always verify with the issuing agency (and your own attorney) before acting. See https://rules.liteflow.app/terms (section 9, API use).",
    "contact": {
      "name": "Diamond Ray Inc",
      "email": "support@liteflow.app"
    },
    "termsOfService": "https://rules.liteflow.app/terms"
  },
  "servers": [
    {
      "url": "https://rules.liteflow.app"
    }
  ],
  "x-disclaimer": "Informational only, not legal advice. Rules are summarized from the cited official sources and may be incomplete, out of date or wrong. Do not rely on this data. Always verify with the issuing agency (and your own attorney) before acting.",
  "x-rate-limit": "Fair use. Responses are cached at the edge; excessive request rates may receive HTTP 429.",
  "paths": {
    "/v1/rules": {
      "get": {
        "summary": "Cited rules for one jurisdiction and rule type",
        "operationId": "getRules",
        "parameters": [
          {
            "name": "jurisdiction",
            "in": "query",
            "required": false,
            "description": "Jurisdiction id from /v1/jurisdictions",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-_]{1,64}$",
              "default": "ca-san-diego-city"
            }
          },
          {
            "name": "rule_type",
            "in": "query",
            "required": false,
            "description": "Rule type id",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-_]{1,64}$",
              "default": "str"
            }
          },
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "description": "Optional topic filter",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-_]{1,64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rules plus coverage status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jurisdiction": {
                      "type": "string"
                    },
                    "jurisdiction_name": {
                      "type": "string"
                    },
                    "rule_type": {
                      "type": "string"
                    },
                    "topic": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "coverage": {
                      "type": "object",
                      "description": "Always check status. not_covered means we have no data for this place; it does NOT mean the place has no rules.",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "covered",
                            "no_program_found",
                            "not_covered"
                          ]
                        },
                        "last_reviewed_on": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date"
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    },
                    "count": {
                      "type": "integer"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "jurisdiction": {
                            "type": "string"
                          },
                          "jurisdiction_name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "rule_type": {
                            "type": "string"
                          },
                          "topic": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "value": {
                            "type": "object"
                          },
                          "as_of": {
                            "type": "string",
                            "format": "date"
                          },
                          "citation": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri",
                                "description": "Official government source: a .gov site, or an official city or county site that is not .gov (the publisher then ends with \"(Official city website)\" or \"(Official county website)\")"
                              },
                              "title": {
                                "type": "string"
                              },
                              "publisher": {
                                "type": "string"
                              },
                              "section": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "retrieved_on": {
                                "type": "string",
                                "format": "date"
                              },
                              "last_checked_on": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "date"
                              }
                            }
                          }
                        }
                      }
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "operator": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "see": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "operator": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "unknown_jurisdiction or unknown_rule_type",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "see": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "operator": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests"
          },
          "502": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "see": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "operator": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/jurisdictions": {
      "get": {
        "summary": "All jurisdictions, rule types and per-jurisdiction coverage",
        "operationId": "listJurisdictions",
        "responses": {
          "200": {
            "description": "OK"
          },
          "502": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "see": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "operator": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/changes": {
      "get": {
        "summary": "Rule-change feed",
        "operationId": "listChanges",
        "parameters": [
          {
            "name": "jurisdiction",
            "in": "query",
            "required": false,
            "description": "Jurisdiction id",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-_]{1,64}$"
            }
          },
          {
            "name": "rule_type",
            "in": "query",
            "required": false,
            "description": "Rule type id",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-_]{1,64}$"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "see": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "operator": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "see": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "operator": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/license-transfers": {
      "get": {
        "summary": "California contractor license-transfer checklist",
        "operationId": "licenseTransfers",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "CA"
            }
          },
          {
            "name": "industry",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "contractor"
            }
          },
          {
            "name": "close_date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "see": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "operator": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "summary": "Health check",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "MCP server (JSON-RPC 2.0). Tools: str_rules_lookup, license_transfer_checklist",
        "operationId": "mcp",
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          }
        }
      }
    }
  }
}