{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/boardwalkai-com/json-schema/boardwalkai-com-document-response-schema.json",
  "title": "DocumentResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/boardwalkai-com-documents-api-openapi.yml#/components/schemas/DocumentResponse",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/$defs/Document"
    },
    "meta": {
      "type": "object",
      "properties": {
        "creditsUsed": {
          "type": "integer"
        },
        "creditsRemaining": {
          "type": "integer"
        }
      }
    }
  },
  "$defs": {
    "Document": {
      "type": "object",
      "description": "A source meeting document (council/commission meeting, agenda packet, staff report, etc.).",
      "properties": {
        "id": {
          "type": "integer"
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "meetingDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "type": {
          "type": [
            "string",
            "null"
          ]
        },
        "category": {
          "type": "string"
        },
        "city": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "id": {
              "type": "integer"
            },
            "name": {
              "type": "string"
            },
            "state": {
              "type": "string"
            }
          }
        },
        "county": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "id": {
              "type": "integer"
            },
            "name": {
              "type": "string"
            },
            "state": {
              "type": "string"
            }
          }
        },
        "specialDistrict": {
          "type": [
            "object",
            "null"
          ]
        },
        "filePath": {
          "type": [
            "string",
            "null"
          ],
          "description": "S3-relative path to the source PDF."
        },
        "fileSize": {
          "type": [
            "integer",
            "null"
          ]
        },
        "sourceUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "sourceUrlId": {
          "type": [
            "integer",
            "null"
          ]
        },
        "rawText": {
          "type": [
            "string",
            "null"
          ],
          "description": "Full extracted text. Can be very large."
        },
        "summary": {
          "type": [
            "string",
            "null"
          ],
          "description": "LLM-generated summary."
        },
        "analysisV2": {
          "type": [
            "object",
            "null"
          ],
          "description": "Structured analysis extracted from the document."
        },
        "officialsPresent": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "topics": {
          "type": [
            "string",
            "null"
          ]
        },
        "notes": {
          "type": [
            "string",
            "null"
          ]
        },
        "htmlContext": {
          "type": [
            "string",
            "null"
          ]
        },
        "extractionMethod": {
          "type": [
            "string",
            "null"
          ]
        },
        "contextConfidenceScore": {
          "type": [
            "integer",
            "null"
          ]
        },
        "processed": {
          "type": "boolean"
        },
        "processedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "propertiesExtracted": {
          "type": "boolean"
        },
        "propertiesExtractedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "audited": {
          "type": "boolean"
        },
        "auditedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "imagesExtracted": {
          "type": "boolean"
        },
        "imagesExtractedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "extractionFailed": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}