Skip to main content
GET
Read a flight AI search task
The task’s answer now: working with the early reply, or the final answer.

Authorizations

X-API-Key
string
header
required

Path Parameters

task_id
string
required
Required string length: 1 - 100
Example:

"tsk_example"

Response

The task.

context_id
string | null
required

The conversation; send it with the next message to continue.

Example:

"ctx_example"

task_id
string
required
Example:

"atk_example"

status
enum<string>
required

working: the search is still running, read the task again. input_required: the message asks a question; answer it in the same conversation. completed: the options are in the answer. failed: see error. canceled: a later message or a cancel replaced it.

Available options:
working,
input_required,
completed,
failed,
canceled
message
string

The reply to show the traveller, in English.

Example:

"Three round-trip options Paris–Tokyo, 3–17 Oct 2027, for 4 adults with at most one stop."

question
enum<string>

What the reply asks for, when status is input_required. relax: no flight met every condition of the request; the reply names them and asks which one to drop or change.

Available options:
origin,
which_place,
dates,
passengers,
group_too_large,
contradiction,
relax,
out_of_scope
question_options
object[]

Choices for the question, when it has some.

criteria
object

The search the request was understood as: trip_type, origins, destinations, departure, return, passengers, priority (only when the request says how to rank the options), currency, and the filters, in the flight_search field names. Each place of origins and destinations has code, type, name and country_code; code is null for a country, a region or a kind of trip, whose airports searched are on each option's legs. departure has weekdays when the request fixes the days of the week the trips leave on: thursday and friday for a long weekend, friday for a weekend. A field is absent when the request did not state it, except passengers and currency, which carry the values searched with.

notes
object[]

Assumptions and adjustments made while understanding the request and searching, each with a kind and the fields of that kind, and an optional text.

options
object[]

Every itinerary of the answer, each priced live.

groups
object[]

How to present the options; groups name them by option_id. shortlist: the options for one route and dates. per_destination: one row per destination compared. Options always meet every filter of the request; a row without one says why in empty_reason.

has_more
boolean

More options are available; ask for more in the same conversation.

error
object

Why the task failed, when status is failed.

superseded_by
string

The task that replaced this one, when status is canceled.

charge
object

What a turn was charged to the organization's balance, once the turn has ended (completed, input_required, failed or canceled); every amount is 0 when the turn cost nothing. Absent while the task is working. Carried on JSON answers only: an event stream does not carry it, so read it with GET /v1/flight_ai_search/tasks/{task_id}.