{
  "openapi": "3.1.0",
  "info": {
    "title": "Podlaski LLP Public Agent API",
    "version": "0.1.0",
    "description": "Public discovery, pricing, service-fit, consultation, and limited-intake API for Podlaski LLP. Public endpoints do not provide legal advice and do not create an attorney-client relationship."
  },
  "servers": [
    {
      "url": "https://www.podlaskilegal.com",
      "description": "Production website"
    },
    {
      "url": "https://api.podlaskilegal.com",
      "description": "Production API placeholder"
    }
  ],
  "paths": {
    "/api/public/firm-profile": {
      "get": {
        "operationId": "getFirmProfile",
        "summary": "Get public firm profile",
        "description": "Returns public identity, contact, location, practice area, consultation, and disclaimer information for Podlaski LLP.",
        "responses": {
          "200": {
            "description": "Firm profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FirmProfile"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/practice-areas": {
      "get": {
        "operationId": "listPracticeAreas",
        "summary": "List public practice areas",
        "responses": {
          "200": {
            "description": "Practice areas",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PracticeArea"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/public/pricing": {
      "get": {
        "operationId": "listPricingOptions",
        "summary": "List public consultation and pricing options",
        "description": "Returns firm-approved prices or quote-required placeholders. Do not infer or invent fees.",
        "responses": {
          "200": {
            "description": "Pricing options",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricingCatalog"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/service-fit": {
      "post": {
        "operationId": "checkServiceFit",
        "summary": "Check non-advice service fit",
        "description": "Determines whether a matter appears to match public practice areas. This is intake routing only and not legal advice.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceFitRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Service fit result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceFitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/public/consultation-request": {
      "post": {
        "operationId": "requestConsultation",
        "summary": "Consultation request disabled",
        "description": "Validates minimum contact and conflict-screen fields, but public consultation submission is currently disabled. This endpoint does not submit, queue, email, or create a consultation or intake record.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultationRequest"
              }
            }
          }
        },
        "responses": {
          "503": {
            "description": "Public consultation submission disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisabledSubmissionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/public/intake-start": {
      "post": {
        "operationId": "startLimitedIntake",
        "summary": "Limited intake disabled",
        "description": "Validates minimum contact and conflict-screen fields, but public intake submission is currently disabled. This endpoint does not submit, queue, email, or create a consultation or intake record.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultationRequest"
              }
            }
          }
        },
        "responses": {
          "503": {
            "description": "Public intake submission disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisabledSubmissionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/public/document-upload-link": {
      "post": {
        "operationId": "createPublicUploadLink",
        "summary": "Create one-time upload link after consent",
        "description": "Creates a one-time secure upload link only if the firm enables public intake uploads and the user acknowledges consent/disclaimer.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadLinkRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Upload link created or queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadLinkResponse"
                }
              }
            }
          },
          "403": {
            "description": "Uploads disabled or not authorized"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "FirmProfile": {
        "type": "object",
        "required": [
          "name",
          "url",
          "phone",
          "locations",
          "practiceAreas",
          "disclaimer"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "alternateNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "phone": {
            "type": "string"
          },
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Location"
            }
          },
          "practiceAreas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PracticeArea"
            }
          },
          "consultationPolicy": {
            "$ref": "#/components/schemas/ConsultationPolicy"
          },
          "disclaimer": {
            "type": "string"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Location": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "street": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "isPrimary": {
            "type": "boolean"
          }
        }
      },
      "PracticeArea": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "summary": {
            "type": "string"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "jurisdiction": {
            "type": "string"
          }
        }
      },
      "ConsultationPolicy": {
        "type": "object",
        "properties": {
          "defaultPolicy": {
            "type": "string"
          },
          "paidExceptions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "matterType": {
                  "type": "string"
                },
                "feeUsd": {
                  "type": "number"
                },
                "creditPolicy": {
                  "type": "string"
                }
              }
            }
          },
          "relationshipDisclaimer": {
            "type": "string"
          }
        }
      },
      "PricingCatalog": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string"
          },
          "consultation": {
            "$ref": "#/components/schemas/ConsultationPolicy"
          },
          "packages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PricingPackage"
            }
          },
          "lastReviewed": {
            "type": "string"
          }
        }
      },
      "PricingPackage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "published",
              "quote_required",
              "firm_approved"
            ]
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "priceType": {
            "type": "string",
            "enum": [
              "flat_fee",
              "quote_required"
            ]
          },
          "retainerCredit": {
            "type": "number"
          },
          "includes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "excludes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "nextStep": {
            "type": "string"
          }
        }
      },
      "ServiceFitRequest": {
        "type": "object",
        "required": [
          "matterType",
          "matterLocation"
        ],
        "properties": {
          "matterType": {
            "type": "string",
            "maxLength": 120
          },
          "matterLocation": {
            "type": "string",
            "maxLength": 120
          },
          "userLocation": {
            "type": "string",
            "maxLength": 120
          },
          "urgency": {
            "type": "string",
            "enum": [
              "normal",
              "soon",
              "urgent",
              "court_deadline",
              "unknown"
            ]
          },
          "upcomingDeadline": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          },
          "alreadyRepresented": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "shortSummary": {
            "type": "string",
            "maxLength": 1200
          }
        }
      },
      "ServiceFitResponse": {
        "type": "object",
        "required": [
          "status",
          "disclaimer"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "likely_fit",
              "maybe_fit",
              "not_fit",
              "needs_attorney_review"
            ]
          },
          "matchedPracticeAreas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reason": {
            "type": "string"
          },
          "consultationPolicy": {
            "$ref": "#/components/schemas/ConsultationPolicy"
          },
          "nextSteps": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "disclaimer": {
            "type": "string"
          }
        }
      },
      "ConsultationRequest": {
        "type": "object",
        "required": [
          "name",
          "email",
          "matterType",
          "consents"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 160
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "preferredContactMethod": {
            "type": "string",
            "enum": [
              "email",
              "phone",
              "either"
            ]
          },
          "matterType": {
            "type": "string",
            "maxLength": 120
          },
          "matterLocation": {
            "type": "string",
            "maxLength": 120
          },
          "adverseParties": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 160
            },
            "maxItems": 20
          },
          "shortNonConfidentialSummary": {
            "type": "string",
            "maxLength": 1200
          },
          "upcomingDeadline": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          },
          "consents": {
            "$ref": "#/components/schemas/ConsentAcknowledgements"
          }
        }
      },
      "ConsentAcknowledgements": {
        "type": "object",
        "required": [
          "notLegalAdvice",
          "noAttorneyClientRelationship",
          "conflictScreenOnly",
          "contactConsent"
        ],
        "properties": {
          "notLegalAdvice": {
            "type": "boolean",
            "const": true
          },
          "noAttorneyClientRelationship": {
            "type": "boolean",
            "const": true
          },
          "conflictScreenOnly": {
            "type": "boolean",
            "const": true
          },
          "contactConsent": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "DisabledSubmissionResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "disabled",
              "contact_on_ice"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "consultation_request",
              "intake_start"
            ]
          },
          "message": {
            "type": "string"
          },
          "disclaimer": {
            "type": "string"
          }
        }
      },
      "UploadLinkRequest": {
        "type": "object",
        "properties": {
          "submissionId": {
            "type": "string"
          },
          "consentToUpload": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "UploadLinkResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "uploadUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    }
  }
}
