Skip to navigation

Destination Weather

POST /v1/destination/weather — a daily forecast for a destination, honestly degraded.

POST /v1/destination/weather returns a multi-day forecast for a destination, resolved server-side from an airport code, a city name, or explicit coordinates.

Airline-scoped, model-free: X-Session-Id is optional and enables flight-aware dates. A missing or malformed optional header is treated as sessionless, never a 400, and starts at the provider’s first local forecast day. Only a valid bound session can change the start date: it uses the scheduled arrival date in the destination’s time when the flight destination matches the requested airport, never before local today. A different airport or a city/coordinate-only request uses the date without flight alignment. A shorter forecast is never padded, so a later arrival can return fewer rows.

A failed flight read is logged and uses local today. If the forecast supplies no offset, the first forecast date is used. If no forecast is available, UTC today is used. The provider’s current offset is used, so a daylight-saving transition can affect an arrival within an hour of midnight. No JSON field is added, removed or retyped.

Body (max 16 KiB):

FieldRequiredRules
airportno*An airport code.
cityno*A city name.
lat / lonno*Coordinates — both must be present together to count.
daysnoForecast horizon. null or ≤ 0 defaults to 7. Values over 7 are clamped to 7, not rejected. An in-range value (1–7) is honored exactly.

* At least one of airport, city, or the lat+lon pair is required — see the error note below.

curl -X POST "https://api.staging.westiq.ai/v1/destination/weather" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "airport": "JFK", "days": 5 }'
{
"schemaVersion": "1",
"correlationId": "req_0197c0a1b2c3d4e5f60718293a4b5c6d",
"forecast": [
{
"date": "2026-08-01",
"tempHigh": 30.0,
"tempLow": 21.0,
"weatherCode": 0,
"label": "Clear sky",
"icon": "sun",
"precipProb": 5
}
],
"weatherAvailable": true
}
  • weatherAvailable is a required field — always present, true or false, never omitted (it’s a boolean, not a nullable one, so the null-omission rule doesn’t apply here).
  • On honest degradation, forecast is an empty array, not omitted.
  • precipProb is the only optional field on a forecast day; it’s omitted when unknown.

Honest degradation

Two distinct failure modes both return 200 with weatherAvailable: false and forecast: [] — never an error:

  1. The locator doesn’t resolve to a known place (an unrecognized city with no airport/coordinates to fall back on).
  2. The weather provider call itself fails.

Errors

This is the one endpoint on the platform where request.validation is a 400, not a 422. Every other validation failure across this API returns 422 request.validation — see Errors & Limits. Here specifically, sending a request with none of airport, city, or a lat+lon pair returns 400 request.validation. Branch on the code field as always; just don’t assume this one is a 422 by pattern-matching on the code name.

Standard envelope otherwise: 401 / 403, 500. There is no 429 — this endpoint is model-free, so the per-client request-rate limit on AI-backed endpoints does not apply to it, and no dedicated 500 case exists beyond the platform-wide generic one (a provider failure degrades honestly, per above, rather than erroring).