Discovery

Cancel a flight AI search task

Cancels a task that has not ended. A task that already ended answers 409 CONFLICT.

post/v1/flight_ai_search/tasks/{task_id}:cancel

Request

  • Base URL
    https://api.gojinko.com
  • URL
    https://api.gojinko.com/v1/flight_ai_search/tasks/{task_id}:cancel
  • Auth
    • API key in header X-API-Key
    • or HTTP bearer

Path parameters

task_idstring required
Example:tsk_example

Response

The task, now canceled.

context_idstring nullable required

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

task_idstring required
status'working' | 'input_required' | 'completed' | 'failed' | 'canceled' 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.

messagestring

The reply to show the traveller, in English.

question'origin' | 'which_place' | 'dates' | 'passengers' | 'group_too_large' | 'contradiction' | 'out_of_scope'

What the reply asks for, when status is input_required.

criteriaobject

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.

has_moreboolean

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

superseded_bystring

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

Example response

{
  "context_id": "ctx_example",
  "task_id": "atk_example",
  "message": "Three round-trip options Paris–Tokyo, 3–17 Oct 2027, for 4 adults with at most one stop.",
  "question_options": [
    {
      "value": "SJO",
      "label": "San José, Costa Rica",
      "detail": "1 airport"
    }
  ],
  "notes": [
    {
      "kind": "passengers_assumed_adults"
    }
  ],
  "options": [
    {
      "option_id": "s1_1",
      "legs": [
        {
          "index": 1,
          "origin": {
            "code": "PAR",
            "name": "Paris",
            "airport": "CDG"
          },
          "destination": {
            "code": "PAR",
            "name": "Paris",
            "airport": "CDG"
          },
          "departure": "2027-10-03T10:20:00",
          "arrival": "2027-10-03T10:20:00",
          "duration_minutes": 975,
          "stops": 1,
          "segments": [
            {
              "marketing_carrier": "AF",
              "operating_carrier": "KL",
              "flight_number": "AF1240",
              "origin": "CDG",
              "destination": "AMS",
              "departure": "2027-10-03T10:20:00",
              "arrival": "2027-10-03T10:20:00",
              "duration_minutes": 80,
              "layover_minutes": 140
            }
          ]
        }
      ],
      "fares": [
        {
          "trip_item_token": "offer_7f3a9c21_1b2c3d4e:trip_item_0",
          "brand_name": "Economy Light",
          "cabin_class": "economy",
          "total": {
            "amount": 3412,
            "currency": "EUR"
          },
          "price_per_person": {
            "amount": 3412,
            "currency": "EUR"
          },
          "priced_for": {
            "adults": 4
          },
          "expires_at": "2026-10-27T10:58:12Z",
          "carry_on_baggage": "1 × 12 kg",
          "included_baggage": "1 × 23 kg"
        }
      ],
      "score": 100,
      "why": "Cheapest total for 4; one stop each way in Amsterdam."
    }
  ],
  "groups": [
    {
      "group_id": "g_1",
      "route": {
        "origin": "PAR",
        "destination": "TYO"
      },
      "dates": {
        "departure": "2027-10-03",
        "return": "2027-10-03"
      }
    }
  ],
  "charge": {
    "turn": 1,
    "llm_usd": 0.0195,
    "api_usd": 0.01,
    "total_usd": 0.0295
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.