{
  "openapi": "3.0.3",
  "info": {
    "title": "Obvlo Content Engine",
    "description": "Obvlo Content Engine API",
    "version": "4.0.0"
  },
  "servers": [
    {
      "url": "https://api.obvlo.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "key",
        "in": "query"
      }
    }
  },
  "paths": {
    "/v2/orgs/{orgId}/chat": {
      "get": {
        "tags": [
          "AI Chat"
        ],
        "description": "Returns the listings referenced by a guide card in the AI assistant experience.",
        "operationId": "v2ChatGuideListings",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "description": "Organization Account Number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "guideId",
            "in": "query",
            "required": true,
            "description": "Guide identifier used to fetch listings for a specific guide",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "BCP-47 language code (e.g. en-GB). When provided, localizable fields are returned as a single string instead of a language map.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "api_key": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "listings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "geoDistance": {
                            "type": "number"
                          },
                          "googleRating": {
                            "type": "number"
                          },
                          "priceLevel": {
                            "type": "number"
                          },
                          "openNow": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "photo": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "url"
                            ],
                            "additionalProperties": false,
                            "nullable": true
                          },
                          "googleMapsUrl": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "category",
                          "address",
                          "geoDistance",
                          "googleRating",
                          "priceLevel",
                          "openNow",
                          "photo",
                          "googleMapsUrl"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "listings"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "No matches"
          }
        }
      },
      "post": {
        "tags": [
          "AI Chat"
        ],
        "description": "Conversational AI endpoint for destination recommendations, itinerary generation, and itinerary email delivery.",
        "operationId": "v2Chat",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "description": "Organization Account Number",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "api_key": []
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Chat request payload.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "default": "",
                    "type": "string"
                  },
                  "orgId": {
                    "type": "string"
                  },
                  "lang": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "latlng": {
                    "type": "string"
                  },
                  "profileId": {
                    "type": "string"
                  },
                  "conversationHistory": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "role",
                        "content"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "action": {
                    "default": "chat",
                    "type": "string",
                    "enum": [
                      "chat",
                      "createItinerary",
                      "sendEmail"
                    ]
                  },
                  "preferences": {
                    "type": "object",
                    "properties": {
                      "tripType": {
                        "type": "string"
                      },
                      "userCategory": {
                        "type": "string"
                      },
                      "interests": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "additionalProperties": false
                  },
                  "sessionId": {
                    "type": "string"
                  },
                  "fingerprintId": {
                    "type": "string"
                  },
                  "isInitialSearch": {
                    "type": "boolean"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "itinerary": {},
                  "durationDays": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 7
                  }
                },
                "required": [
                  "message",
                  "action"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "listings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "geoDistance": {
                            "type": "number"
                          },
                          "googleRating": {
                            "type": "number"
                          },
                          "priceLevel": {
                            "type": "number"
                          },
                          "openNow": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "photo": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "url"
                            ],
                            "additionalProperties": false,
                            "nullable": true
                          },
                          "googleMapsUrl": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "category",
                          "address",
                          "geoDistance",
                          "googleRating",
                          "priceLevel",
                          "openNow",
                          "photo",
                          "googleMapsUrl"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "guides": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "coverImage": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "url"
                            ],
                            "additionalProperties": false,
                            "nullable": true
                          },
                          "listingCount": {
                            "type": "number"
                          },
                          "geoDistance": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "description",
                          "coverImage",
                          "listingCount",
                          "geoDistance"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "toolUsed": {
                      "type": "boolean"
                    },
                    "actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "query",
                              "tripType",
                              "userCategory",
                              "interest",
                              "confirm",
                              "email"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "value",
                          "type"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "hostInterests": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "travellerTypes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "travellerTypes"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "itinerary": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "durationDays": {
                          "type": "number"
                        },
                        "summary": {
                          "type": "string"
                        },
                        "days": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "dayNumber": {
                                "type": "number"
                              },
                              "summary": {
                                "type": "string"
                              },
                              "activities": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "timeOfDay": {
                                      "type": "string",
                                      "enum": [
                                        "morning",
                                        "afternoon",
                                        "evening",
                                        "night"
                                      ]
                                    },
                                    "activityType": {
                                      "type": "string"
                                    },
                                    "placeType": {
                                      "type": "string",
                                      "enum": [
                                        "listing",
                                        "location"
                                      ]
                                    },
                                    "placeId": {
                                      "type": "string"
                                    },
                                    "placeName": {
                                      "type": "string"
                                    },
                                    "rationale": {
                                      "type": "string"
                                    },
                                    "placePhoto": {
                                      "type": "string"
                                    },
                                    "travelTime": {
                                      "type": "number"
                                    },
                                    "listing": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "name": {
                                          "type": "string"
                                        },
                                        "category": {
                                          "type": "string"
                                        },
                                        "address": {
                                          "type": "string"
                                        },
                                        "geoDistance": {
                                          "type": "number"
                                        },
                                        "googleRating": {
                                          "type": "number"
                                        },
                                        "priceLevel": {
                                          "type": "number"
                                        },
                                        "openNow": {
                                          "type": "boolean",
                                          "nullable": true
                                        },
                                        "photo": {
                                          "type": "object",
                                          "properties": {
                                            "url": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "url"
                                          ],
                                          "additionalProperties": false,
                                          "nullable": true
                                        },
                                        "googleMapsUrl": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "name",
                                        "category",
                                        "address",
                                        "geoDistance",
                                        "googleRating",
                                        "priceLevel",
                                        "openNow",
                                        "photo",
                                        "googleMapsUrl"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "location": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "name": {
                                          "type": "string"
                                        },
                                        "address": {
                                          "type": "string"
                                        },
                                        "description": {
                                          "type": "string"
                                        },
                                        "geoDistance": {
                                          "type": "number"
                                        },
                                        "photo": {
                                          "type": "object",
                                          "properties": {
                                            "url": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "url"
                                          ],
                                          "additionalProperties": false,
                                          "nullable": true
                                        },
                                        "googleMapsUrl": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "name",
                                        "address",
                                        "description",
                                        "geoDistance",
                                        "photo",
                                        "googleMapsUrl"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "timeOfDay",
                                    "activityType",
                                    "placeType",
                                    "placeId",
                                    "placeName"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "dayNumber",
                              "activities"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "name",
                        "durationDays",
                        "days"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "message",
                    "listings",
                    "guides",
                    "toolUsed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "No matches"
          }
        }
      }
    }
  }
}