1. Default Module
YGO Client API
v1
  • v2
  • v1
  • Default Module
    • Overview
    • Core Concepts
    • Authentication
    • Quickstart Guide
    • AI Search & Trip Planning
    • Booking Flow
    • Environments
    • General
      • Check API health status
      • Get current API key context
    • AI Search & Trip Planning
      • Send message to YGO AI
    • Product Search (Deprecated)
      • Search for hotel & package offers
      • Get transfers for booking
      • Get package price calendar
    • Bookings
      • Get or create open booking
      • Check offer availability
      • Update open booking
      • Update booking status and trigger workflows
      • List bookings
      • Get booking
    • Schemas
      • Schemas
        • PackageSearchRequest
        • GetPackageCalendarRequest
        • GetBookingRequest
        • ListBookingsRequest
        • SaveBookingStatusRequest
        • SaveOpenBookingRequest
        • GetOpenBookingRequest
        • GetTransfersRequest
        • Product
        • Booking
        • TransferOptionsResponse
        • PackageCalendarResponse
        • ProductTexts
        • BookingDetails
        • TripReference
        • TransferOption
        • PackageCalendarDate
        • LocaleContent
        • BookingItemInput
        • Trip
        • ProductImage
        • TransferImage
        • BookingItem
        • Traveller
        • PickupInformation
        • ProductDetails
        • PackageOffer
        • PickupLocation
        • Image
        • Pickup
        • TourOperator
        • CheckPickup
        • Accommodation
        • TransferRemark
        • Room
        • CancellationPolicy
        • Transport
        • Flight
        • Airport
        • Price
        • PriceByPax
        • SuccessResponse
        • ErrorResponse
        • Hotel
        • HotelFeatures
        • FeatureState
        • RoomFeatures
        • RoomContent
        • Facility
      • Response
        • Unauthorized
  1. Default Module

AI Search & Trip Planning

Overview#

The API features YGO AI, a sophisticated AI-powered system for travel search and planning. Unlike traditional search APIs that rely solely on supplier-provided data and rigid parameter structures, YGO AI aggregates, augments, and enhances hotel, flight, transfer, and activity information from multiple sources to deliver more complete and accurate results.
Key Capabilities:
Multi-Modal Intelligence: Accept natural language prompts, structured data, or combinations of both - YGO AI adapts to your input format
Specialized Model Flows: A single endpoint (/v1/sendMessage) routes to purpose-built flows — consumer search (packagelist, hotellist), B2B agency search (agency_packagelist, agency_hotellist), product Q&A (hotelinfo, hotelreviews, activityinfo), or full multi-agent trip planning (empty Model)
Superior Data Quality: Augmented travel product information from multiple sources ensures fresher, more complete, and more accurate data than supplier APIs alone
Hotels: Enhanced amenity details (up to 50 features), enriched descriptions, curated guest reviews, verified location data, and high-quality images aggregated from multiple platforms for unmatched completeness
Activities: Detailed inclusions/exclusions, accurate duration and timing, verified meeting points, guest experience insights, and authentic reviews analyzed for quality and relevance
Flights & Transfers: Optimized with real-time availability and routing intelligence
Multi-Layer Smart Filtering: Three-tier filter architecture from basic supplier filters to deep content search across reviews, descriptions, and metadata
Lightning-Fast Responses: Specialized AI flows deliver results in under 2 seconds for focused queries
Context-Aware: Maintains conversation history for natural, iterative refinement of search criteria
Sales-driven Recommendation Engine: Results optimized by balancing user preferences with commercial performance objectives
Multi-Lingual: Understands and responds in 50+ languages including English, German, French, Spanish, Italian, Portuguese, Chinese, Japanese, Korean, Arabic, and more - with fully localized responses, quick replies, and product summaries

Core Capabilities#

Smart Package Search#

Search hotel packages with enhanced flexibility using augmented, multi-source data for more accurate results.
Key Features:
Natural Language Processing: "Find me a beach hotel in Greece for around 5 nights in July" → YGO AI extracts all parameters
Flexible Duration Search: Automatically searches multiple durations (e.g., "around 5 nights" → searches 4, 5, and 6 nights)
Multi-Layer Smart Filtering: Three-tier filter architecture for unmatched search precision:
Layer 1: Supplier-native filters (star rating, room type, board type)
Layer 2: Enhanced hotel features (up to 50 augmented amenities beyond industry standards)
Layer 3: Deep content search across reviews, descriptions, images, and metadata
Augmented Product Data: Travel information aggregated and enhanced from multiple sources for superior accuracy and completeness
Hotels: Up to 50 enriched amenity features, verified guest reviews, location intelligence
Activities: Detailed logistics, guest experience analysis, requirement validation
Budget Optimization: Filters packages to match budget constraints with intelligent price sorting
Recommendation Ranking: Results sorted by AI-powered relevance scoring based on user preferences
Multi-Source Data Augmentation:
YGO AI enriches travel product information from multiple sources, creating more complete and accurate datasets than supplier APIs alone can provide.
For hotels:
Aggregates amenity data from suppliers, review platforms, and content providers to achieve up to 50 verified features per property
Cross-references guest reviews to validate facility claims and surface hidden insights
Enhances location data with proximity intelligence and neighborhood context
For activities:
Enriches official descriptions with verified guest experiences and practical details
Validates meeting points, timings, and requirements against actual traveler feedback
Analyzes reviews to extract specific insights about guides, group sizes, and experience quality
This enables searches like "hotels with rooftop terrace and good breakfast mentioned in reviews" or "family-friendly activities with flexible cancellation" - queries that go beyond basic structured fields to search across all available content.
Example Use Cases:
Package discovery on your website's search page
Complex natural language searches across reviews and descriptions
Budget-constrained searches with quality optimization
Feature-specific hotel filtering with enhanced amenity data

Hotel Information & Reviews#

Get detailed hotel insights combining official data with guest experience analysis.
Key Features:
Multi-Source Intelligence: Combines official hotel data with guest review insights
Source Attribution: Clearly distinguishes between hotel-provided information and guest feedback
Review Analysis: Analyzes guest reviews for common themes, pros/cons, and sentiment
Contextual Responses: Answers specific questions about amenities, policies, location, and services
Quick Follow-Ups: AI-generated contextual follow-up questions guide user exploration
Example Use Cases:
Hotel detail page Q&A features
"Ask about this hotel" chat widgets
Pre-booking information gathering
Guest review summarization

Activity & Attraction Information#

Provide detailed information about tours, activities, and attractions.
Key Features:
Comprehensive Details: Duration, timing, meeting points, inclusions/exclusions, requirements
Guest Experience Insights: Analysis of activity reviews and ratings
Source-Attributed Information: Clear distinction between official descriptions and guest feedback
Booking Requirements: Age limits, group size, accessibility, and special requirements
Example Use Cases:
Activity detail page enhancements
"Learn more about this tour" features
Pre-booking requirement validation
Activity comparison tools

Full Trip Planning (Advanced)#

Complete trip planning flow that transforms complex travel arrangements into walkable, optimized itineraries.
Key Features:
Intelligent Itinerary Generation: Creates day-by-day activity plans that are actually walkable
Optimizes routing based on real distances and travel times between locations
Respects opening hours and live availability for each activity
Considers logical flow (e.g., morning museum visits, afternoon outdoor activities)
Accounts for meal times and natural break points
Preference-Based Personalization: Adapts itineraries to individual traveler interests
Filters activities based on stated preferences (history, art, food, adventure, etc.)
Adjusts pace and intensity to match traveler style
Balances popular attractions with hidden gems based on preferences
Live Availability Integration: Uses real-time data to ensure activities are actually bookable
Multi-Agent Orchestration: Coordinates destination analysis, package search, itinerary creation, and budget validation
Conversational Refinement: Iteratively improves trip plans through natural dialogue
What This Solves:
Traditional itinerary planning requires travelers to manually research opening hours, calculate distances, check availability, and optimize routing - often taking hours of work. YGO AI handles this complexity automatically, creating practical, walkable plans that respect real-world constraints while matching personal preferences.
Example Use Cases:
Complete trip planning assistants that generate ready-to-use itineraries
Travel concierge chat interfaces with intelligent day planning
Complex multi-city trip arrangements with optimized routing
Personalized itinerary builders that adapt to individual interests

Request Shape#

Every /v1/sendMessage call uses the same envelope:
Headers:
HeaderValueRequired
AuthorizationBearer your_api_tokenYes — routes to your Sandbox or Production project
X-User-IDYour end customer's stable IDYes — identifies the human end user behind the request
Content-Typeapplication/jsonYes
Top-level body fields:
FieldTypeDescription
ChatIDstringChat session identifier (from createChat). Maintains context across messages.
ContentstringFree-text user message. Up to 2000 chars. May be empty when StructuredInput carries the full request.
LocalestringISO 639-1 language code (en, de, fr, …). Defaults to de.
ModelstringSpecialized AI flow to use. See Specialized AI Models. Empty string = full trip planning.
StructuredInputobjectPre-extracted user inputs (trip params, intents, product IDs). See below.
OptionsobjectPer-request behavior flags (e.g. IncludeHighlights). See Request Options.
DoNotSavebooleanSkip persisting this Run. Useful for previews or evals.
StructuredInput carries everything that came from explicit UI controls (pickers, filters, product detail pages):
TripParams — destination, dates, travellers, airports, budget, flexible-nights, lat/lng/radius
Intents — explicit intent codes (e.g. HOTEL_WITH_POOL)
ProductID — required for hotelinfo, hotelreviews, activityinfo
LoadHotelRecommendations — opt-in personalized hotel recommendations
PackageParams — direct Peakwork API params (advanced)

Multi-Modal Input: Maximum Flexibility#

YGO AI accepts input in three flexible formats - use whichever fits your application best:

Natural Language Only#

Send a text prompt - YGO AI extracts all parameters.

Structured Data Only#

Send pre-extracted parameters - YGO AI validates and processes.

Hybrid (Natural Language + Structured)#

Combine both for maximum control with natural enhancement.
Merge semantics: when both Content and StructuredInput are present, YGO AI extracts parameters from text, then overlays StructuredInput on top — so structured fields always win on conflicts. Intents from StructuredInput are placed first, with any additional LLM-extracted intents appended.
Coming Soon: Voice input support for hands-free search experiences.

Request Options#

The optional Options object carries per-request behavior flags that are independent of user input.
OptionTypeDefaultDescription
IncludeHighlightsbooleanfalseWhen true, each product in the response carries a short Highlights { Hotel, Reviews } block (concise comma-separated bullet strings) for rich card UIs. Pure opt-in; first call for a (productID, locale) pair adds ~3–5s, subsequent calls hit a 7-day Redis cache.

Specialized AI Models: Optimized for Speed#

YGO AI routes requests to specialized AI flows based on your use case, dramatically improving response times:
ModelPurposeResponse TimeUse Case
packagelistPackage search with smart filters (flight + hotel)<3 seconds"Find beach hotels in Greece under €1500"
hotellistHotel-only search (no transport)<3 seconds"Show me hotels in Barcelona for 3 to 5 nights"
agency_packagelistB2B agency package search (structured input only, MATCH + UNCLEAR tiers)~1–2 secondsCRM-driven request: destination + dates + travellers, returns flight + hotel
agency_hotellistB2B agency hotel-only search (structured input only)~1–2 secondsCRM-driven request: destination + dates + travellers, hotel-only suppliers
hotelinfoHotel details and amenities<2 seconds"What time is check-in at this hotel?"
hotelreviewsGuest review analysis<2 seconds"What do guests say about the breakfast?"
activityinfoActivity and attraction details<2 seconds"How long does this tour last?"
"" (empty)Full trip planning flow5-10 seconds"Plan a 5-day trip to Paris for 2 people"
Smart Routing Benefits:
80% faster for focused queries (hotel info, reviews, activities)
Reduced API costs through optimized processing
Better relevance with context-specific validation
Scalable architecture supporting new models without breaking changes

How Search Works: Under the Hood#

Package Search Flow (packagelist model)#

1.
Input Processing (Multi-Modal)
Natural language: "Hotels in Barcelona with pool for around 5 nights"
Structured: {Destination: "Barcelona", FlexibleNights: [4,5,6]}
Hybrid: Combination of both
2.
Parameter Extraction
Destination detection with geocoding
Flexible duration parsing (e.g., "around 5" → [4, 5, 6] nights)
Hotel feature extraction (pool, gym, spa, etc.)
Budget constraints and traveler counts
3.
Intelligent Search
Queries package inventory across multiple departure airports
Searches all flexible duration options simultaneously
Applies budget filters when specified
4.
Multi-Layer Smart Filtering
Layer 1: Supplier-native filters (star rating, room type, meal plans)
Layer 2: Enhanced hotel features with AND logic (must have ALL requested features)
Layer 3: Deep content search across reviews, descriptions, and metadata
Quality filters (star ratings, review scores)
Flight preferences (times, direct flights only)
5.
AI-Powered Ranking
Proprietary recommendation engine scores each result
Balances user preferences (current + historical behavior) with commercial objectives
Optimizes for high-margin inventory and strategic hotel partnerships
The system learns from successful bookings to improve future recommendations
Price-quality optimization
6.
Response Generation
Natural language explanation of results
Contextual quick replies for refinement
Clear attribution of filters applied

Hotel-Only Search Flow (hotellist model)#

Same flow as packagelist (TPA → INT → QUA → QFL → ranking → output) with two differences:
Action prefix forced to hotel-only: outgoing Peakwork calls use hotelproduct / hotelvariant for product searches and hotelgroup for destination-group validation.
Transport filter dropped: results never include flights.
Use this when the supplier exposes hotel-only inventory (e.g. agency keys with hotel-only brand mappings) or when a project should never return packages with flights. The Peakwork project key must have hotel-only brands wired up on the supplier side, otherwise hotellist returns 0 hotels even on a correctly formed request.

Agency Search Flows (agency_packagelist, agency_hotellist)#

Agent-oriented variants of packagelist / hotellist designed for B2B agent consoles where trip params come from structured pickers, not free text:
1.
No Trip Param Extraction (TPA)
The destination/dates/travellers/airports must come from StructuredInput.TripParams (or StructuredInput.PackageParams).
Free-text Content is parsed only by INT (intents/HotelFeatures) and QUA (quality keywords) for soft preferences.
Trip-param-like phrases in free text are silently ignored — agents change destination via the picker.
2.
No Destination Fallback Chain
Country/similar-city/MDP fallbacks are skipped. The request must already specify a valid destination.
3.
Required Structured Fields (returns 400 if missing)
Destination OR DestinationID
StartDate
EndDate OR FlexibleNights
TravellersAmount OR TravellerAges
4.
Bound Checks (returns 400)
TravellersAmount > 9 — supplier-side maximum
len(TravellerAges) > 9 — same cap
TravellersAmount > 0 && len(TravellerAges) > 0 && TravellersAmount != len(TravellerAges) — must agree
Any age outside [0, 120]
5.
Two-Tier Quality Result (QFL)
QFL surfaces UNCLEAR (potential) matches alongside MATCH so agents can interpret partial evidence themselves.
Data.Products contains MATCH and UNCLEAR products intermixed (MATCH first within each page).
Use Data.QualityEvaluations[].Decision (MATCH / UNCLEAR) to split the two tiers.
Data.QualityEvaluations and Data.Products are not index-aligned when pagination is active — correlate by HotelID (QualityEvaluations[i].HotelID == Products[j].ID).
6.
Preserved Instructions
Data.Instructions is preserved (unlike consumer flows where it's stripped). Use it for machine-readable signals: InstrInvalidDepAirport, InstrErrorPackagelistAPIFailure, InstrDateFallback, InstrEmpty, etc.
7.
agency_hotellist = agency_packagelist + OnlyHotels=true forced (action prefix becomes hotelproduct / hotelvariant / hotelgroup).
agency_* flows save ~2s + ~7 LLM calls per request vs the consumer flow because TPA, destination fallback, and the strict-MATCH gate are skipped.

Hotel Information Flow (hotelinfo model)#

1.
Query Processing
Validates ProductID (hotel identifier)
Processes natural language question
Applies safety and relevancy checks
2.
Data Gathering
Fetches official hotel details (amenities, policies, location)
Selects representative guest reviews (recent + extreme ratings)
Combines multiple data sources
3.
AI Analysis
Processes question against hotel data and reviews
Distinguishes official information from guest feedback
Generates source-attributed response
4.
Response Enhancement
Adds contextual follow-up questions
Provides confidence levels for review-based statements
Handles off-topic queries gracefully

Hotel Reviews Flow (hotelreviews model)#

Same shape as hotelinfo but the LLM is restricted to guest-review evidence and confidence-attributed sentiment summaries. Use it when you specifically want guest-feedback insights rather than official hotel facts.

Activity Information Flow (activityinfo model)#

ProductID-bound flow for tours, attractions, and experiences. Returns inclusions/exclusions, duration, meeting points, age and accessibility requirements, and review-derived guest insights with source attribution.

Full Trip Planning Flow (empty Model)#

The default multi-agent orchestration. Coordinates destination analysis, package search, day-by-day itinerary creation, walkability/timing optimization, and budget validation. Iterates conversationally and respects live availability per activity. Use for complete trip planning assistants — slower (5–10s) but produces ready-to-use itineraries.

Smart Features in Detail#

Flexible Duration Search#

YGO AI automatically interprets duration flexibility:
User InputInterpreted AsNights Searched
"5 nights"Exact duration[5]
"around 5 nights"Flexible ±1[4, 5, 6]
"approximately 7 nights"Flexible ±1[6, 7, 8]
"3 to 5 nights"Range[3, 4, 5]
"between 4 and 7 nights"Range[4, 5, 6, 7]
Why This Matters:
Increases availability by 3-5x compared to exact duration searches
Reveals better value options at nearby durations
Reduces "no results" scenarios

Multi-Layer Smart Filtering#

YGO AI employs a sophisticated three-tier filtering architecture that goes far beyond traditional search capabilities:
Layer 1 - Supplier Native Filters:
Standard filters provided by booking suppliers (star rating, room type, board type, meal plans). Fast and efficient for basic categorization.
Layer 2 - Enhanced Hotel Features:
Augmented feature set with up to 50 amenities that extend industry-standard classifications. Features are enriched and validated from multiple data sources for higher accuracy and completeness.
Supported Enhanced Features Include:
Pool, Spa, Sauna, Gym, Fitness
Pets Allowed, Wheelchair Accessible
WiFi, Air Conditioning, Elevator
Bar, Restaurant, Breakfast, Parking
Balcony, Reception 24h
And 30+ additional enhanced amenities
Layer 3 - Deep Content Search:
Searches across all available hotel data including guest reviews, descriptions, images, and metadata. Enables natural language queries like "hotels with rooftop terrace" or "good vegan breakfast praised by guests and a heated 50m pool, all close to the beach and train station"
Example Queries Across All Layers:
Layer 2: "Hotels with pool and gym where I can bring my dog" → Feature-based AND logic
Layer 3: "Hotels with rooftop bar and sea views" → Deep content search across descriptions and reviews
Combined: "4-star hotels with spa and highly rated breakfast" → Multi-layer filtering
Filtering Logic:
AND logic: Hotels must match ALL requested criteria
Clear error messages when no hotels match criteria with alternative suggestions
Intelligent handling of feature synonyms and natural language variations

AI Recommendation Ranking#

Results are sorted by our proprietary recommendation engine which balances user satisfaction with commercial performance:
User Preference Signals:
Current session interests and search patterns
Historical booking behavior and preferences
Price-quality ratio optimization
Location desirability and accessibility
Guest review sentiment and ratings
Commercial Intelligence:
Strategic inventory optimization (higher stock, better margins)
Supplier partnership priorities
Seasonal relevance and availability
Real-time booking trends and conversion data
Adaptive Learning:
The recommendation system is rewarded for high-margin sales and continuously adjusts product ranking accordingly. This creates a self-optimizing engine that maximizes both customer satisfaction and business performance - users get relevant results while your business optimizes revenue per booking.

Conversation Management#

Chat Sessions#

YGO AI maintains conversation context across multiple messages:
1.
Create Chat → Get unique ChatID
2.
Send Messages → Maintains full context and history
3.
Iterative Refinement → Build on previous responses
Example Conversation Flow:
User: "Find me hotels in Barcelona"
YGO AI: [Returns 50 hotels in Barcelona]

User: "Only show ones with a pool and under €150 per night"
YGO AI: [Refines previous results with new filters]

User: "What about the one near the beach?"
YGO AI: [Provides details on specific hotel from context]

Message History#

Each message (Run) contains:
User input and extracted parameters
System responses and recommendations
Applied filters and search criteria
Selected packages and itinerary items
This enables natural, multi-turn conversations without repeating information. Message relevance decays over the conversation, allowing YGO AI to focus on recent context while maintaining awareness of earlier preferences.

Localization & Multi-Lingual Support#

YGO AI understands and responds in 50+ languages, making it truly global:
Primary Supported Languages:
English, German, French, Spanish, Italian, Portuguese
Chinese, Japanese, Korean
Arabic, Dutch, Polish, Swedish, Norwegian, Danish, Finnish
And 35+ additional languages
Automatic Language Detection & Response:
Analyzes user input language automatically
Responds in the same language with proper grammar and cultural context
Generates localized quick reply suggestions in the user's language
Creates product summaries and descriptions in the detected language
No need to specify language for most queries - YGO AI adapts automatically
Locale Parameter:
For explicit control, use the Locale parameter:
"en": English responses
"de": German responses (Deutsch)
"fr": French responses
"es": Spanish responses
And more (ISO 639-1 language codes)
Fully Localized Elements:
Natural language responses with cultural nuances and local expressions
Error messages and validations in user's language
Quick reply suggestions contextually generated in the target language
Product summaries and descriptions adapted to local preferences
Hotel and activity information presented in user's language
Date and currency formatting per regional standards
Proper name handling and transliteration
Localized follow-up questions and conversation flows

Integration Patterns#

All examples use the standard v1 headers: Authorization: Bearer <api_token>, X-User-ID: <end_user_id>, and Content-Type: application/json.

Search Page Integration#

Use Case: Main package search functionality

Hotel-Only Search#

Use Case: Project / supplier with hotel-only inventory (no flights)

Agency Console — Structured Search#

Use Case: Travel-agent CRM with destination/date/traveller pickers

Hotel Detail Page Q&A#

Use Case: "Ask about this hotel" feature

Filter Refinement#

Use Case: Progressive filter application across turns

Review Analysis#

Use Case: Guest feedback summarization

Best Practices#

Model Selection#

Choose the right model for your use case:
packagelist: Consumer-facing package search (flight + hotel) with full natural-language understanding
✅ "Find hotels in Barcelona"
✅ "Show me beach resorts under €1000"
✅ "Hotels with pool and gym"
hotellist: Same as packagelist but hotel-only (no flights). Use when the supplier exposes hotel-only inventory.
✅ "Hotels in Barcelona for 3 to 5 nights"
✅ "City-break hotels in Lisbon under €120/night"
agency_packagelist: B2B agency package search. Trip params come from structured pickers — TPA, destination fallback, and the strict-MATCH gate are skipped (~1–2s, ~7 fewer LLM calls). Use this from agent consoles.
✅ Structured request: { DestinationID, StartDate, EndDate, TravellersAmount } + free-text soft preferences ("with a pool")
✅ Surfaces MATCH and UNCLEAR products so agents can interpret partial evidence
agency_hotellist: agency_packagelist + OnlyHotels=true forced. Use for agent consoles operating on hotel-only inventory.
hotelinfo: Questions about specific hotel amenities and policies (requires StructuredInput.ProductID)
✅ "What's the check-in time?"
✅ "Does this hotel have a spa?"
✅ "How far is it from the airport?"
hotelreviews: Guest feedback and experience questions (requires StructuredInput.ProductID)
✅ "What do guests say about the service?"
✅ "Are there complaints about noise?"
✅ "How do guests rate the breakfast?"
activityinfo: Activity and attraction details (requires StructuredInput.ProductID)
✅ "How long does this tour last?"
✅ "What's included in this cooking class?"
✅ "Where is the meeting point?"
Empty model (""): Complex trip planning — full multi-agent orchestration with day-by-day itinerary
✅ "Plan a 5-day trip to Paris for 2 people"
✅ "Create an itinerary for Rome with historical sites"

Performance Optimization#

Tips for fast responses:
1.
Use specialized models when possible (80% faster than the empty-model trip-planning flow)
2.
Use agency_* models when trip params are already structured — saves ~2s + ~7 LLM calls vs the consumer flow
3.
Provide structured input alongside natural language for best results
4.
Reuse ChatID to maintain context without repeating parameters
5.
Set the Locale to avoid language detection overhead
6.
Include X-User-ID for personalized recommendation ranking

Error Handling#

Common scenarios:
No results found: YGO AI provides clear explanation and suggests alternatives
Invalid parameters: Validation errors explain what's missing or incorrect
Off-topic queries: Specialized models politely redirect to relevant questions
Safety violations: Generic refusal messages for inappropriate content

Security Considerations#

Important practices:
Always send X-User-ID: Required header — identifies the end customer making the request. Set it to a stable per-user identifier from your verified session.
Validate API responses: Check for errors before displaying results
Sanitize user input: Although YGO AI has protections, additional validation is recommended
Rate limiting: Implement reasonable rate limits to prevent abuse
Error message handling: Don't expose internal errors to end users

Example Workflows#

Each sendMessage(...) call below is shorthand for a POST /v1/sendMessage with the standard headers (Authorization: Bearer …, X-User-ID: …, Content-Type: application/json).

Workflow 1: Discovering the Perfect Hotel#

Workflow 2: Budget-Constrained Search#

Workflow 3: Agency Console Structured Search#

Workflow 4: Activity Planning#

Response Structure#

All YGO AI responses follow a consistent envelope: { Data: <Run>, Error: null }. The Run object inside Data carries the full conversation state, extracted trip parameters, generated content, and any applied filters.
Notes:
TripParams.Packages carries products for the consumer flows (packagelist, hotellist); Data.Products is used by agency_packagelist / agency_hotellist.
Data.QualityEvaluations and Data.Products are not index-aligned across pages — correlate them by HotelID (QualityEvaluations[i].HotelID == Products[j].ID).
When the request set Options.IncludeHighlights: true, each product additionally carries a short Highlights { Hotel, Reviews } block; the field is omitted otherwise.
Consumer responses are filtered by default (internal fields like AgentConfigs, Latencies, QualityEvaluations, Instructions, PromptAudit are stripped). Projects with InternalAPIMode: true receive the full response.

Technical Limits#

Request Limits:
Max message length: 2000 characters
Timeout: 60 seconds per request
Search Limits:
Max flexible nights range: 10 nights
Max hotel features per query: 50
Max packages returned: 100 per search
Max reviews analyzed per hotel: 1000
Rate Limits:
Enforced per API token at the project level
Contact support for enterprise rate limit increases

Ready to get started? Check out the sendMessage API specification for complete technical details and request/response schemas.
Modified at 2026-05-07 13:33:39
Previous
Quickstart Guide
Next
Booking Flow
Built with