Create Flight Search
agent-data call bd63936c-8611-45a8-8ad8-083aa4c51aa9 search-flights --date <date> [--sort <sort>] [--cabin <cabin>] [--limit <limit>] [--compact <compact>] [--max_stops <max_stops>] [--passengers <passengers>] [--request_id <request_id>] --origin_iata <origin_iata> [--return_date <return_date>] --destination_iata <destination_iata>curl -X POST "https://d1vrh75868.execute-api.us-east-2.amazonaws.com/api/v1/flight-searches" -H "Authorization: Bearer <YOUR_API_KEY>" -H "Content-Type: application/json"Start a flight search. This endpoint returns immediately with a job_id and status “pending”. The search runs in the background and typically finishes in 6-20 seconds. A 202 response means the search was accepted, not that results are ready. Check on the search by calling GET /api/v1/flight-searches/{job_id} every 2-5 seconds. While status is “pending” or “running”, keep checking. When status is “completed”, the offers are in data.result.offers. When status is “failed”, read error_code and error_message; if retryable is true, submitting the same search again may succeed. Errors always appear on the job you poll, never in this response. Sending the same request_id with the same search body returns the existing job instead of creating a new one. Sending the same request_id with a different body returns 409 idempotency_key_conflict.
Request Body required
Section titled “Request Body required ”object
Specify the outbound travel date to search. Send an ISO 8601 calendar date in YYYY-MM-DD format. This value is required. Every submission without a request_id runs a fresh upstream search; results are not shared across requests.
Choose how the API should order offers in the returned result set. Send one of the supported enum values: price, duration, departure, or stops.
Choose the cabin class to request for the priced itinerary. Send one of the documented enum values, such as economy, premium_economy, business, or first.
Cap how many priced offers the API should return in the completed search result. Send an integer from 1 through 30. Values outside that range fail validation with 422.
Set this flag to request the compact response mode supported by the search workflow. Send a boolean value. The request model accepts the flag today, but downstream response shaping should be described conservatively unless separate evidence confirms a material payload difference.
Specify how many passengers to price in the search request. Send an integer from 1 through 9. Values outside that range fail validation with 422.
Specify the 3-letter IATA code for the departure airport. Input is case-insensitive in practice and is normalized before the upstream search request is built. Send an airport code, not a city code or free-text location.
Specify the 3-letter IATA code for the arrival airport. Input is case-insensitive in practice and is normalized before the upstream search request is built. Send an airport code, not a city code or free-text location.
Responses
Section titled “ Responses ”Successful Response
object
Public-facing response for POST /flight-searches.
Extends FlightSearchJob with the operation pointer used by long-polling clients (operation_id/operation_url) and explicit trust-failure metadata when the upstream result cannot be served accurately.
object
object
object
object
Example
{ "data": { "status": "pending" }}Validation Error
object
object
object
Example generated
{ "detail": [ { "ctx": {}, "loc": [ "example" ], "msg": "example", "type": "example", "input": "example" } ]}