---
title: "Modify booking"
url: "https://kongair.terwilligar.com/apis/llm-flight-booking-assistant-1-0-0/versions/76f089d9-b12c-4dd8-a400-e4c611faf544/operations/updateBooking"
---

> Full API specification: https://kongair.terwilligar.com/apis/llm-flight-booking-assistant-1-0-0/versions/76f089d9-b12c-4dd8-a400-e4c611faf544.md

# Modify booking

`PATCH` `/flights/{bookingId}`

Operation ID: `updateBooking`

## Path parameters

- `bookingId` (string, uuid, required)

## Request body (required)

Content types: `application/json`

## Responses

- `200` - Booking updated
- `400` - Invalid request
- `404` - Resource not found

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Flight LLM Booking API
  version: 1.0.0
servers:
  - url: https://api.example.com/v1
    description: Production server
    variables:
      version:
        enum:
          - v1
          - v2
        default: v1
      region:
        enum:
          - us
          - eu
          - asia
        default: us
        description: Geographic region
  - url: https://sandbox.example.com/{version}
    description: Sandbox server
    variables:
      version:
        default: v1
paths:
  /flights/{bookingId}:
    parameters:
      - $ref: "#/components/parameters/bookingId"
    patch:
      tags:
        - flights
      summary: Modify booking
      operationId: updateBooking
      requestBody:
        $ref: "#/components/requestBodies/BookingPatchRequestBody"
      responses:
        "200":
          description: Booking updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BookingResponse"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
      security:
        - OAuth2Auth:
            - flight.write
security:
  - OAuth2Auth:
      - flight.write
components:
  parameters:
    bookingId:
      name: bookingId
      in: path
      required: true
      schema:
        type: string
        format: uuid
  requestBodies:
    BookingPatchRequestBody:
      description: Booking patch request body
      required: true
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/BookingPatchRequest"
  schemas:
    BookingResponse:
      allOf:
        - $ref: "#/components/schemas/BookingRequest"
        - type: object
          properties:
            bookingId:
              type: string
              format: uuid
            status:
              type: string
              enum:
                - pending
                - confirmed
                - cancelled
            totalPrice:
              $ref: "#/components/schemas/Price"
          required:
            - bookingId
            - status
    BookingPatchRequest:
      type: object
      properties:
        addPassenger:
          $ref: "#/components/schemas/Passenger"
        removePassengerId:
          type: string
          format: uuid
    BookingRequest:
      type: object
      properties:
        flightId:
          type: string
          format: uuid
        passengers:
          type: array
          items:
            $ref: "#/components/schemas/Passenger"
        payment:
          $ref: "#/components/schemas/PaymentMethod"
      required:
        - flightId
        - passengers
        - payment
    Price:
      type: object
      properties:
        amount:
          type: number
          format: float
        currency:
          type: string
          pattern: ^[A-Z]{3}$
      required:
        - amount
        - currency
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: array
          items:
            type: string
      required:
        - code
        - message
    Passenger:
      type: object
      properties:
        firstName:
          type: string
        lastName:
          type: string
        dateOfBirth:
          type: string
          format: date
        passportNumber:
          type: string
        nationality:
          type: string
      required:
        - firstName
        - lastName
        - dateOfBirth
    PaymentMethod:
      type: object
      discriminator:
        propertyName: type
      oneOf:
        - $ref: "#/components/schemas/CreditCard"
        - $ref: "#/components/schemas/PayPal"
    CreditCard:
      type: object
      properties:
        type:
          type: string
          enum:
            - credit_card
        cardNumber:
          type: string
        expiryMonth:
          type: integer
          minimum: 1
          maximum: 12
        expiryYear:
          type: integer
          minimum: 2025
        cvv:
          type: string
      required:
        - type
        - cardNumber
        - expiryMonth
        - expiryYear
        - cvv
    PayPal:
      type: object
      properties:
        type:
          type: string
          enum:
            - paypal
        email:
          type: string
          format: email
      required:
        - type
        - email
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
  securitySchemes:
    OAuth2Auth:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://example.com/oauth/authorize
          tokenUrl: https://example.com/oauth/token
          scopes:
            flight.read: Read flight data
            flight.write: Modify flight data
        clientCredentials:
          tokenUrl: https://example.com/oauth/token
          scopes:
            flight.admin: Administrative access
        implicit:
          authorizationUrl: https://example.com/oauth/authorize
          scopes:
            flight.read: Read flight data
        password:
          tokenUrl: https://example.com/oauth/token
          scopes:
            flight.read: Read flight data
            flight.write: Modify flight data
```
