{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hedgespecialty-com/json-schema/hedgespecialty-com-application-section-schema.json",
  "title": "ApplicationSection",
  "description": "One carrier application (a carrier-API quote session) inside the\nworkspace: its schema, current answers, per-field ownership, and\nreadiness. `application_id` is the `session_id` used by the\ncheckpoint / request-quote / employers-classes paths. Revisions\n(`answer_revision`, `fact_revision`, `selection_revision`) and\n`schema_fingerprint` are the optimistic-concurrency tokens every\ncommand must echo.\n",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hedgespecialty-com-openapi.yml#/components/schemas/ApplicationSection",
  "type": "object",
  "required": [
    "application_id",
    "workspace_id",
    "provider_key",
    "program_identifier",
    "schema",
    "schema_fingerprint",
    "answers",
    "answer_revision",
    "readiness",
    "request_state"
  ],
  "properties": {
    "application_id": {
      "type": "string"
    },
    "workspace_id": {
      "type": "string"
    },
    "connection_id": {
      "type": "string"
    },
    "provider_key": {
      "type": "string"
    },
    "program_identifier": {
      "type": "string"
    },
    "owner_host": {
      "type": "string",
      "enum": [
        "hedge",
        "bindly"
      ]
    },
    "owner_session_id": {
      "type": "string"
    },
    "route": {
      "type": "string",
      "enum": [
        "hedge",
        "direct"
      ]
    },
    "market_program_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "submission_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "line_of_business": {
      "type": [
        "string",
        "null"
      ]
    },
    "schema": {
      "type": "object",
      "description": "The normalized question schema (fields, required_field_keys, program identity); the same questions GET /broker/programs/{program_id}/application-schema projects."
    },
    "schema_fingerprint": {
      "type": "string"
    },
    "answers": {
      "type": "object",
      "additionalProperties": true,
      "description": "Current answers keyed by question key."
    },
    "ownership": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "explicit",
              "derived",
              "cleared"
            ]
          },
          "revision": {
            "type": "integer"
          },
          "source": {
            "$ref": "#/$defs/SourceReference"
          },
          "dependencies": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "answer_revision": {
      "type": "integer"
    },
    "fact_revision": {
      "type": "integer"
    },
    "selection_revision": {
      "type": "integer"
    },
    "selected_products": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "available_products": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "mapping_state": {
      "type": "string",
      "description": "Whether Hedge's fact-to-answer mapping is idle or still running for this application."
    },
    "unresolved_dependencies": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "missing": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Required question keys still unanswered."
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        }
      }
    },
    "visible_fields": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "readiness": {
      "type": "string",
      "description": "`needs_information` until every required visible question is answered, then `ready_for_quote`."
    },
    "request_state": {
      "type": "string",
      "description": "Lifecycle of the last quote request for this application (draft until one is made)."
    },
    "request_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "result": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "The carrier outcome of the last request",
      "when any.": null
    },
    "allowed_actions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "SourceReference": {
      "type": "object",
      "description": "Provenance of a fact or answer.",
      "required": [
        "source_id",
        "content_hash",
        "channel"
      ],
      "properties": {
        "source_id": {
          "type": "string"
        },
        "content_hash": {
          "type": "string"
        },
        "channel": {
          "type": "string",
          "enum": [
            "broker_portal",
            "broker_email",
            "insured",
            "connected_app",
            "document",
            "paste",
            "mapping"
          ]
        },
        "evidence": {
          "type": "string",
          "enum": [
            "explicit",
            "translated",
            "assumed"
          ],
          "default": "explicit"
        },
        "snippet": {
          "type": [
            "string",
            "null"
          ]
        },
        "extractor_version": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}