{
  "openapi": "3.0.3",
  "info": {
    "title": "The Jungle Safari Inquiry API",
    "description": "Agent-friendly endpoint for posting safari trip inquiries. For the full ChatGPT Actions surface (destinations, seasonality, plan links), use https://thejunglesafari.com/agent/openapi.json.",
    "version": "1.0.0",
    "contact": {
      "name": "The Jungle Safari",
      "email": "booking@thejunglesafari.com",
      "url": "https://thejunglesafari.com"
    }
  },
  "servers": [
    {
      "url": "https://thejunglesafari.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/inquiry": {
      "post": {
        "operationId": "submitTripInquiry",
        "summary": "Submit a safari trip inquiry",
        "description": "Posts a custom safari inquiry on behalf of a traveller. The Jungle Safari replies with a costed plan within one working day. We are an independent travel agency; park permits are issued by the relevant state Forest Department.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TripInquiry"
              },
              "example": {
                "name": "Alex Traveller",
                "email": "alex@example.com",
                "phone": "+14155552671",
                "destination": "Bandhavgarh",
                "tentative_date": "2026-11-10",
                "duration_days": 6,
                "travelers": 2,
                "country": "US",
                "notes": "First safari. Prefer Tala zone mornings."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inquiry accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquirySuccess"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TripInquiry": {
        "type": "object",
        "required": ["name", "email"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Traveller full name"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Contact email for the costed plan"
          },
          "phone": {
            "type": "string",
            "description": "Optional phone or WhatsApp number with country code"
          },
          "destination": {
            "type": "string",
            "description": "Primary park or sanctuary, e.g. Bandhavgarh, Corbett, Kanha, Kaziranga"
          },
          "tentative_date": {
            "type": "string",
            "description": "Preferred start as YYYY-MM-DD or month name, e.g. 2026-11-10 or November 2026"
          },
          "duration_days": {
            "type": "number",
            "description": "Desired trip length in days"
          },
          "travelers": {
            "type": "number",
            "description": "Number of travellers in the party"
          },
          "country": {
            "type": "string",
            "description": "Traveller country of residence (ISO code or name)"
          },
          "notes": {
            "type": "string",
            "description": "Free-text preferences, wildlife goals, accessibility needs, or a drafted itinerary"
          }
        }
      },
      "InquirySuccess": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["success"]
          },
          "message": {
            "type": "string",
            "example": "Inquiry received. A costed plan will be sent within 24 hours."
          }
        }
      },
      "InquiryError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["error"]
          },
          "error": {
            "type": "string"
          }
        }
      }
    }
  }
}
