{
  "openapi": "3.1.0",
  "info": {
    "title": "LegalPulse API",
    "description": "Global legal intelligence API \u2014 10 endpoints covering the full legal lifecycle for individuals, entrepreneurs, and small businesses. Demand letter generation ($0.25), contract analysis + red flag identification, tenant rights by jurisdiction, employment law (wrongful termination, wages, discrimination), business formation guide (LLC/Corp/sole prop with LegalZoom/Northwest Registered Agent affiliate links), estate planning (wills, trusts with Trust & Will/LegalZoom links), consumer rights, small claims court guide, IP protection (trademark/copyright with LegalZoom/Trademark Engine links), and individual rights reference. Global scope \u2014 190+ jurisdictions via ?country= parameter. All require x402 micropayment (USDC on Base).",
    "version": "1.2.0"
  },
  "servers": [
    {
      "url": "https://legalpulse-rho.vercel.app"
    }
  ],
  "paths": {
    "/api/legal/letter": {
      "get": {
        "summary": "Advocacy letter writer",
        "description": "Generate a complete, ready-to-send advocacy letter with statute citations for medical bills, debt settlement, insurance appeals, tenant disputes, employment, FDCPA, FCRA, and more.",
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "medical-bill",
                "debt-settlement",
                "insurance-appeal",
                "tenant-dispute",
                "employment-dispute",
                "fdcpa-validation",
                "fcra-dispute",
                "contract-breach",
                "refund-demand",
                "general"
              ]
            }
          },
          {
            "name": "situation",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recipient",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete advocacy letter with citations, tips, and escalation path"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC on Base, $0.25"
          }
        },
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Response includes legal document service links; follow with /api/legal/small-claims if the letter fails to resolve the dispute"
      }
    },
    "/api/legal/contract": {
      "get": {
        "summary": "Contract clause review",
        "description": "Plain-English explanation of contract clauses with red flags, risk rating, standard terms, and negotiation guidance.",
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clause",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contract_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Clause analysis with risk level, red flags, and negotiation guidance"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC on Base, $0.10"
          }
        },
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Response includes Rocket Lawyer and LegalZoom document links; pair with /api/legal/letter if contract has been breached"
      }
    },
    "/api/legal/tenant": {
      "get": {
        "summary": "Tenant rights by state",
        "description": "State-specific tenant rights with statute citations, landlord obligations, notice deadlines, and escalation options.",
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "issue",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tenant rights analysis with statutes and action steps"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC on Base, $0.10"
          }
        },
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Pair with /api/legal/letter to generate a notice or demand letter to landlord based on identified violations"
      }
    },
    "/api/legal/employment": {
      "get": {
        "summary": "Employment law rights",
        "description": "Wrongful termination, wage theft, discrimination, non-compete enforceability, FMLA/ADA rights, EEOC filing deadlines.",
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "issue",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Employment law analysis with deadlines and claim strength"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC on Base, $0.10"
          }
        },
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Pair with /api/legal/letter to generate a demand letter to employer after identifying violations"
      }
    },
    "/api/legal/business": {
      "get": {
        "summary": "Business formation comparison",
        "description": "LLC vs S-Corp vs C-Corp vs sole prop comparison by state: costs, tax treatment, liability protection, recommended structure.",
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entity_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "situation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entity comparison with recommendation and formation steps"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC on Base, $0.10"
          }
        },
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Response includes LegalZoom/Northwest/Stripe Atlas business formation links; follow with /api/legal/ip for trademark and IP protection strategy"
      }
    },
    "/api/legal/estate": {
      "get": {
        "summary": "Estate planning checklist",
        "description": "Will vs trust, probate thresholds by state, beneficiary designations, avoidance tools, urgency flags.",
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "situation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Estate planning checklist with probate threshold and avoidance tools"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC on Base, $0.10"
          }
        },
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Response includes Trust & Will, LegalZoom, and Rocket Lawyer estate planning links for direct document creation"
      }
    },
    "/api/legal/consumer": {
      "get": {
        "summary": "Consumer rights \u2014 FDCPA, FCRA, FTC",
        "description": "Consumer protection rights with prohibited conduct, complaint agencies, and statutory damages available.",
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "issue",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consumer rights analysis with damages and complaint steps"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC on Base, $0.10"
          }
        },
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/legal/small-claims": {
      "get": {
        "summary": "Small claims court guide",
        "description": "Filing limits, fees, service methods, evidence checklist, day-of-court tips, enforcement options by state.",
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "situation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete small claims guide for the state"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC on Base, $0.08"
          }
        },
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Pair with /api/legal/letter \u2014 generate the demand letter first, then use this for the filing guide if no response"
      }
    },
    "/api/legal/ip": {
      "get": {
        "summary": "Intellectual property guide",
        "description": "Trademark, copyright, patent, trade secret: registration process, costs, enforcement options.",
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "trademark",
                "copyright",
                "patent",
                "trade_secret"
              ]
            }
          },
          {
            "name": "situation",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "IP guidance with registration process and enforcement options"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC on Base, $0.10"
          }
        },
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Response includes LegalZoom IP and Trademark Engine filing links for direct action"
      }
    },
    "/api/legal/rights": {
      "get": {
        "summary": "Know your rights",
        "description": "Traffic stops, search/seizure, Miranda, workplace surveillance: exact scripts for what to say and not say.",
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "situation",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rights analysis with exact scripts"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC on Base, $0.08"
          }
        },
        "x-agent-use-case": "on-demand"
      }
    }
  }
}
