Method
PUT /v1/products/:id/transport/departures/:departureId/segments
Path Parameters
Product ID that owns the departure.
Departure ID whose segments should be replaced.
Body Parameters
Bearer token (requires products:write).
Request Example
curl -X PUT "https://api.voyantcloud.com/v1/products/prod_123/transport/departures/dep_456/segments" \
-H "Authorization: Bearer $VOYANT_API_KEY" \
-H "content-type: application/json" \
-d '{
"segments": [
{
"mode_id": "mode_flight",
"operator_org_id": "org_airline",
"from_place_id": "ChIJ8UNwppk4j4ARzWPaN9xq_9o",
"to_place_id": "ChIJGaK-SZcYtUYR0Y1DSXB6QrM",
"depart_offset_minutes": 0,
"duration_minutes": 160,
"airline_code": "RO",
"flight_number": "381",
"cabin_class": "economy",
"seats_total": 40,
"seats_available": 18,
"luggage": { "checked_bag": 1 }
}
]
}'
Response
{
"segments": [
{
"id": "seg_001",
"departure_id": "dep_456",
"seq": 1,
"mode_id": "mode_flight",
"operator_org_id": "org_airline",
"resource_id": "res_aircraft",
"from_place_id": "ChIJ8UNwppk4j4ARzWPaN9xq_9o",
"to_place_id": "ChIJGaK-SZcYtUYR0Y1DSXB6QrM",
"depart_offset_minutes": 0,
"duration_minutes": 160,
"attributes": {},
"notes": "Direct flight",
"is_charter": false,
"airline_code": "RO",
"flight_number": "381",
"cabin_class": "economy",
"fare_class_code": "Y",
"seats_total": 40,
"seats_available": 18,
"luggage": { "checked_bag": 1 }
}
]
}
This endpoint replaces all existing segments for the departure. Send the complete list you want to persist each time you call it.