{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vistalink-com/json-schema/vistalink-com-chat-response-schema.json",
  "title": "ChatResponse",
  "description": "POST /v1/chat response body.",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vistalink-com-openapi.json#/components/schemas/ChatResponse",
  "properties": {
    "session_id": {
      "type": "string",
      "format": "uuid",
      "title": "Session Id"
    },
    "message": {
      "type": "string",
      "title": "Message",
      "description": "Assistant reply text"
    },
    "hotels": {
      "items": {
        "$ref": "#/$defs/HotelCard"
      },
      "type": "array",
      "title": "Hotels"
    },
    "pois": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Pois"
    },
    "routes": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Routes"
    },
    "references": {
      "items": {
        "$ref": "#/$defs/Reference"
      },
      "type": "array",
      "title": "References"
    },
    "usage": {
      "anyOf": [
        {
          "$ref": "#/$defs/UsageInfo"
        },
        {
          "type": "null"
        }
      ]
    },
    "clarification_pending": {
      "anyOf": [
        {
          "$ref": "#/$defs/ClarificationPending"
        },
        {
          "type": "null"
        }
      ],
      "description": "Supervisor is waiting for the user to clarify their request"
    },
    "segments": {
      "items": {
        "$ref": "#/$defs/Segment"
      },
      "type": "array",
      "title": "Segments"
    },
    "calls": {
      "items": {
        "$ref": "#/$defs/CallHandle"
      },
      "type": "array",
      "title": "Calls",
      "description": "Voice calls initiated or updated during this turn. Use call_id with /v1/call/{call_id}/status to follow up."
    }
  },
  "type": "object",
  "required": [
    "session_id",
    "message"
  ],
  "$defs": {
    "CallHandle": {
      "properties": {
        "call_id": {
          "type": "string",
          "title": "Call Id"
        },
        "tool": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool",
          "description": "Which voice tool produced this handle"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status"
        },
        "success": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Success"
        },
        "ui_call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ui Call Id"
        },
        "hotel_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hotel Name"
        },
        "hotel_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hotel Id"
        },
        "scheduled_time": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scheduled Time"
        },
        "queue_position": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Queue Position"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        }
      },
      "type": "object",
      "required": [
        "call_id"
      ],
      "title": "CallHandle",
      "description": "A voice call placed (or updated) during a chat turn.\n\nDeliberately permissive beyond ``call_id``: the underlying tools return\ndifferent shapes (an initiate carries queue_position, a status poll carries\nstatus, a failure carries error), and the point of this object is that the\nHANDLE survives the turn. Losing it stranded a call the caller had paid for."
    },
    "ClarificationOptionCard": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "label": {
          "type": "string",
          "title": "Label"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Image Url"
        },
        "distance_meters": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Distance Meters"
        }
      },
      "type": "object",
      "required": [
        "id",
        "label"
      ],
      "title": "ClarificationOptionCard",
      "description": "A single clickable option in a clarification card (MCP surface)."
    },
    "ClarificationPending": {
      "properties": {
        "clarification_id": {
          "type": "string",
          "title": "Clarification Id"
        },
        "question": {
          "type": "string",
          "title": "Question"
        },
        "options": {
          "items": {
            "$ref": "#/$defs/ClarificationOptionCard"
          },
          "type": "array",
          "title": "Options"
        },
        "context_hint": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Context Hint"
        },
        "allow_free_text": {
          "type": "boolean",
          "title": "Allow Free Text",
          "default": true
        },
        "display_mode": {
          "type": "string",
          "enum": [
            "inline",
            "panel"
          ],
          "title": "Display Mode",
          "default": "inline"
        }
      },
      "type": "object",
      "required": [
        "clarification_id",
        "question"
      ],
      "title": "ClarificationPending",
      "description": "Phase 52.5: Clarification request surfaced to MCP clients when the\nsupervisor needs the user to pick one of 2-4 interpretations before\ncommitting to expensive work.  Mirrors the SSE ``clarification_request``\nevent payload."
    },
    "ExplanationFactor": {
      "properties": {
        "factor_type": {
          "type": "string",
          "title": "Factor Type"
        },
        "human_readable": {
          "type": "string",
          "title": "Human Readable"
        },
        "contribution": {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0,
          "title": "Contribution"
        }
      },
      "type": "object",
      "required": [
        "factor_type",
        "human_readable",
        "contribution"
      ],
      "title": "ExplanationFactor",
      "description": "Single ranking signal exposed to MCP clients."
    },
    "GuestInsightAspect": {
      "properties": {
        "type": {
          "type": "string",
          "title": "Type"
        },
        "summary": {
          "type": "string",
          "title": "Summary"
        },
        "sentiment": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sentiment"
        },
        "quote": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Quote"
        }
      },
      "type": "object",
      "required": [
        "type",
        "summary"
      ],
      "title": "GuestInsightAspect",
      "description": "Single guest insight aspect (e.g. food, staff)."
    },
    "GuestInsights": {
      "properties": {
        "highlights": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Highlights"
        },
        "aspects": {
          "items": {
            "$ref": "#/$defs/GuestInsightAspect"
          },
          "type": "array",
          "title": "Aspects"
        }
      },
      "type": "object",
      "title": "GuestInsights",
      "description": "Aggregated guest insights for a hotel."
    },
    "HotelCard": {
      "properties": {
        "hotel_id": {
          "type": "string",
          "title": "Hotel Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "City"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Country"
        },
        "address": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Address"
        },
        "star_rating": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Star Rating"
        },
        "review_score": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Review Score"
        },
        "review_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Review Count"
        },
        "latitude": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Latitude"
        },
        "longitude": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Longitude"
        },
        "website_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Website Url"
        },
        "parley_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Parley Url",
          "description": "Public hotel page on Parley (meetparley.ai) with the stay's dates; send users here to view or book the hotel."
        },
        "amenities": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Amenities"
        },
        "price": {
          "anyOf": [
            {
              "$ref": "#/$defs/StayPrice"
            },
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Price"
        },
        "images": {
          "items": {
            "$ref": "#/$defs/HotelImageCard"
          },
          "type": "array",
          "title": "Images",
          "description": "Ordered gallery of hotel images (up to 5 on /v1/chat and /v1/search; up to 50 on /v1/hotels/{id}). Use for lightbox/carousel — not as the card thumbnail. Empty list when the hotel has no images."
        },
        "review_highlight": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Review Highlight"
        },
        "guest_insights": {
          "anyOf": [
            {
              "$ref": "#/$defs/GuestInsights"
            },
            {
              "type": "null"
            }
          ]
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "hotel_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hotel Type"
        },
        "rates": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/RoomRate"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rates"
        },
        "hero_image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hero Image Url",
          "description": "Intent-aware thumbnail URL. Pre-selected to match the query context (e.g. a pool search returns a pool photo). Always use this field as the card thumbnail — do not substitute images[0]. Null only when the hotel has no images."
        },
        "hero_image_label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hero Image Label",
          "description": "Category label of the hero image (e.g. 'swimming pool indoor', 'building'). Null when unclassified."
        },
        "explanation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Explanation"
        },
        "explanation_factors": {
          "items": {
            "$ref": "#/$defs/ExplanationFactor"
          },
          "type": "array",
          "title": "Explanation Factors"
        },
        "poi_distances": {
          "additionalProperties": {
            "type": "number"
          },
          "type": "object",
          "title": "Poi Distances"
        },
        "routes_to_pois": {
          "additionalProperties": true,
          "type": "object",
          "title": "Routes To Pois"
        }
      },
      "type": "object",
      "required": [
        "hotel_id",
        "name"
      ],
      "title": "HotelCard",
      "description": "Hotel summary returned by ``/v1/chat``, ``/v1/search``, and ``/v1/hotels/{id}``.\n\n## Images\n\nTwo complementary image fields are provided — use both, never substitute one for the other:\n\n**``hero_image_url`` — use this as the card thumbnail.**\nA single, pre-selected image URL chosen to best represent the hotel *in the\ncontext of this specific query*. For example, a search for \"hotel with pool\"\nreturns a pool photo rather than a generic exterior shot. Always prefer this\nfield for the primary card image; do **not** fall back to ``images[0]`` as a\nthumbnail because ``hero_image_url`` may intentionally point to a different\n(more relevant) image. ``null`` only when the hotel has no images at all.\n\n**``images`` — use this for the gallery / lightbox.**\nThe full ordered gallery: up to 5 images per hotel on ``/v1/chat`` and\n``/v1/search``; up to 50 on ``/v1/hotels/{id}``. Each entry has a ``url``\nand an optional ``label`` (e.g. ``\"swimming pool indoor\"``, ``\"room\"``).\nAn empty list means no images are available for this hotel."
    },
    "HotelImageCard": {
      "properties": {
        "url": {
          "type": "string",
          "title": "Url",
          "description": "Fully-qualified CDN URL of the image."
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Label",
          "description": "Image category label (e.g. 'swimming pool indoor', 'building', 'room'). Null when unclassified."
        }
      },
      "type": "object",
      "required": [
        "url"
      ],
      "title": "HotelImageCard",
      "description": "One image in a hotel's gallery.\n\nThe ``url`` is a fully-qualified CDN URL ready to use in an ``<img>`` tag.\n``label`` is a human-readable category such as ``\"swimming pool indoor\"``,\n``\"building\"``, or ``\"room\"``; it may be ``null`` when the image has no\nclassified label."
    },
    "Reference": {
      "properties": {
        "url": {
          "type": "string",
          "title": "Url"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "domain": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Domain"
        },
        "index": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Index"
        }
      },
      "type": "object",
      "required": [
        "url"
      ],
      "title": "Reference",
      "description": "Web source reference backing an answer."
    },
    "RoomOffer": {
      "properties": {
        "price": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Price"
        },
        "currency": {
          "type": "string",
          "title": "Currency",
          "default": "EUR"
        },
        "includes_taxes_and_fees": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Includes Taxes And Fees"
        },
        "has_breakfast": {
          "type": "boolean",
          "title": "Has Breakfast",
          "default": false
        },
        "has_free_cancellation": {
          "type": "boolean",
          "title": "Has Free Cancellation",
          "default": false
        }
      },
      "type": "object",
      "title": "RoomOffer",
      "description": "A single price offer for a room.\n\nOn the developer API ``price`` is the all-inclusive total for the\nrequested stay (taxes and fees included); offers whose tax basis is\nunknown are not returned."
    },
    "RoomRate": {
      "properties": {
        "room_name": {
          "type": "string",
          "title": "Room Name",
          "default": ""
        },
        "amenities": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Amenities"
        },
        "room_size_sqm": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Room Size Sqm"
        },
        "room_description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Room Description"
        },
        "offers": {
          "items": {
            "$ref": "#/$defs/RoomOffer"
          },
          "type": "array",
          "title": "Offers"
        }
      },
      "type": "object",
      "title": "RoomRate",
      "description": "Room type with its available offers."
    },
    "Segment": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text",
            "hotel_ref",
            "trip_suggestion"
          ],
          "title": "Type"
        },
        "id": {
          "type": "string",
          "title": "Id"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "hotel_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hotel Id"
        },
        "hotel_ids": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hotel Ids"
        }
      },
      "type": "object",
      "required": [
        "type",
        "id"
      ],
      "title": "Segment",
      "description": "One unit in a structured chat reply (alternating text + hotel references)."
    },
    "StayPrice": {
      "properties": {
        "total": {
          "type": "number",
          "title": "Total",
          "description": "All-inclusive total for the whole stay, in `currency`."
        },
        "currency": {
          "type": "string",
          "title": "Currency",
          "description": "ISO 4217 currency of `total` (the requested currency)."
        },
        "includes_taxes_and_fees": {
          "type": "boolean",
          "title": "Includes Taxes And Fees",
          "description": "Always true: totals with an unknown tax basis are never returned.",
          "default": true
        },
        "check_in": {
          "type": "string",
          "format": "date",
          "title": "Check In"
        },
        "check_out": {
          "type": "string",
          "format": "date",
          "title": "Check Out"
        },
        "nights": {
          "type": "integer",
          "title": "Nights"
        },
        "adults": {
          "type": "integer",
          "title": "Adults",
          "default": 2
        },
        "rooms": {
          "type": "integer",
          "title": "Rooms",
          "default": 1
        },
        "source_total": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Total",
          "description": "The same total in the currency it was observed in."
        },
        "source_currency": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Currency"
        },
        "observed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Observed At",
          "description": "When this price was observed."
        }
      },
      "type": "object",
      "required": [
        "total",
        "currency",
        "check_in",
        "check_out",
        "nights"
      ],
      "title": "StayPrice",
      "description": "The price of one specific stay.\n\nOnly present when the request carried both ``check_in`` and\n``check_out``. Always the all-inclusive total (taxes and fees included)\nfor the whole stay, in ``currency``, for one room and ``adults`` guests,\nfrom a scrape no older than 72 hours."
    },
    "UsageInfo": {
      "properties": {
        "latency_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Latency Ms"
        },
        "cost_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cost Usd"
        }
      },
      "type": "object",
      "title": "UsageInfo",
      "description": "Per-request usage info attached to responses.\n\nSurfaces cost and latency — the metrics API clients need for\nbudgeting and performance monitoring.  Token-level detail is\nrecorded internally but not exposed here (billing is per-call,\nnot per-token)."
    }
  }
}