> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qbridge.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Toggle booking lock status

> Sets the locked status of a booking to prevent table reassignment

**Who can call it:** Manager, Sales, Host, Venue Admin, Brand Admin or Organization Admin with access to the venue.



## OpenAPI

````yaml /openapi.yaml patch /bookings/{id}/lock
openapi: 3.1.0
info:
  description: >-
    Authenticated endpoints need a bearer token: `Authorization: Bearer
    <token>`.

    Each endpoint says whether it needs one. Public endpoints need none.

    A person sends the token they signed in with. A machine, such as a Billy Q
    box, sends its machine key the same way.

    Each endpoint ends with who can call it, and "Who can call what" lists every
    endpoint against every role.


    Every response is wrapped the same way: `status` is always present
    (`success` or `error`),

    `message` carries text that is safe to show a user, and `data` holds the
    payload on success.

    One exception: a 410 for a session that has ended carries the status
    `ended`.


    Money is in minor units (pence). Timestamps are RFC 3339 in UTC. Dates are
    `YYYY-MM-DD`.
  title: CueBridge API
  version: 0.1.0
servers:
  - description: Pre-production
    url: https://api.preprod.poolhouse.dev/api
security: []
tags:
  - description: Confirmed bookings at a venue.
    name: Bookings
  - description: A booking's time at its tables, from check-in to the end of play.
    name: Sessions
  - description: The players checked in to a session.
    name: Session players
  - description: Games played during a session, and the game types a venue offers.
    name: Games
  - description: Shots recorded during a game, and the ratings derived from them.
    name: Game shots
  - description: Per-player statistics and the stat types they are measured in.
    name: Stats
  - description: A venue's pool tables.
    name: Pool tables
  - description: The items placed on a venue's floor plan.
    name: Floor plan
  - description: Achievements players have earned.
    name: Achievements
paths:
  /bookings/{id}/lock:
    patch:
      tags:
        - Bookings
      summary: Toggle booking lock status
      description: >-
        Sets the locked status of a booking to prevent table reassignment


        **Who can call it:** Manager, Sales, Host, Venue Admin, Brand Admin or
        Organization Admin with access to the venue.
      operationId: updateBookingLock
      parameters:
        - description: Booking ID
          in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/handlers.lockToggleRequest'
        description: Lock request containing locked status
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.ResponseOf-handlers_bookingResponse'
          description: Successfully toggled lock status
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.Response'
          description: Invalid request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.Response'
          description: The bearer token is missing, invalid or expired.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.Response'
          description: Insufficient permissions
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.Response'
          description: Booking not found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.Response'
          description: Something went wrong on our side.
      security:
        - BearerAuth: []
components:
  schemas:
    handlers.lockToggleRequest:
      properties:
        table_locked:
          type: boolean
      type: object
    api.ResponseOf-handlers_bookingResponse:
      properties:
        data:
          allOf:
            - $ref: '#/components/schemas/handlers.bookingResponse'
          description: The payload. Left out when there is none.
        message:
          description: Text that is safe to show a user. Left out when there is none.
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/api.Status'
          description: >-
            `success` or `error`. A 410 for a session that has ended says
            `ended` instead.
      type: object
    api.Response:
      properties:
        data:
          description: The payload. Left out when there is none.
        message:
          description: Text that is safe to show a user. Left out when there is none.
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/api.Status'
          description: >-
            `success` or `error`. A 410 for a session that has ended says
            `ended` instead.
      type: object
    handlers.bookingResponse:
      properties:
        acp_package:
          allOf:
            - $ref: '#/components/schemas/handlers.acpPackageSummary'
          description: >-
            The small-booking (ACP) package the customer bought. Left out when
            there is none. Filled in

            only when bookings are listed.
        administratively_disabled_notifications:
          description: >-
            Notification types that are switched off for the whole environment,
            such as

            `highlights_email`. They stay off for this booking whatever
            `enabled_notifications` says.

            Returned when a single booking is fetched or updated; left out of
            lists.
          items:
            type: string
          type: array
        assigned_to:
          format: uuid
          type:
            - string
            - 'null'
        associated_users:
          items:
            $ref: '#/components/schemas/models.User'
          type: array
        available_game_type_ids:
          items:
            type: string
          type: array
        booker_profile:
          $ref: '#/components/schemas/handlers.bookingProfileSummary'
        booking_end:
          format: date-time
          type:
            - string
            - 'null'
        booking_insights:
          items:
            $ref: '#/components/schemas/handlers.bookingInsightResponse'
          type: array
        booking_start:
          format: date-time
          type:
            - string
            - 'null'
        budget_max:
          type:
            - integer
            - 'null'
        budget_min:
          type:
            - integer
            - 'null'
        business_date:
          description: >-
            The venue's business day the booking counts towards, as YYYY-MM-DD.
            It changes at the venue's cut-off hour, not at midnight.
          type: string
        cancellation_reason:
          type:
            - string
            - 'null'
        cancelled_at:
          format: date-time
          type:
            - string
            - 'null'
        changeover_minutes:
          type:
            - integer
            - 'null'
        commission_rate:
          type:
            - integer
            - 'null'
        communication_method:
          type: string
        confirmed_at:
          format: date-time
          type:
            - string
            - 'null'
        corporate_signals:
          description: >-
            Why a personal booking looks corporate: `company_on_file`,
            `corporate_enquiry`. Left out when

            the booking is already corporate or nothing points that way. Staff
            apps show it as a "Looks

            corporate" hint.
          items:
            type: string
          type: array
        created_at:
          format: date-time
          type: string
        deposit_package:
          description: >-
            Whether the booking's package is a minimum spend. Left out when it
            is not.
          type: boolean
        deposit_percentage:
          description: >-
            The share of the price paid online as a deposit, as a percentage: 50
            means half. Left out

            when the whole price is paid online.
          type: integer
        enabled_notifications:
          items:
            type: string
          type: array
        enquiry_area:
          anyOf:
            - $ref: '#/components/schemas/models.EnquiryArea'
            - type: 'null'
        extension_price_per_guest:
          type:
            - integer
            - 'null'
        extensions:
          description: >-
            The booking's extensions. `null` when it has none. Always filled in
            when a single booking is

            returned.
          items:
            $ref: '#/components/schemas/handlers.bookingExtensionInfo'
          type: array
        feedback_email_sent_at:
          format: date-time
          type:
            - string
            - 'null'
        forecast_value:
          type:
            - integer
            - 'null'
        guest_count:
          type: integer
        guest_profiles:
          items:
            $ref: '#/components/schemas/handlers.bookingProfileSummary'
          type: array
        has_happy_hour_preorder:
          description: >-
            Whether at least one of those preorders is a happy-hour package.
            Filled in only when bookings

            are listed.
          type: boolean
        has_preorder:
          description: >-
            Whether the booking has at least one preorder that is not cancelled.
            Filled in only when

            bookings are listed; elsewhere it is always `false`.
          type: boolean
        highlights_email_sent_at:
          format: date-time
          type:
            - string
            - 'null'
        id:
          format: uuid
          type: string
        in_venue_balance:
          description: >-
            The rest of the price, in pence, to be paid at the venue. Left out
            when the whole price is

            paid online.
          type: integer
        is_corporate:
          type: boolean
        is_event:
          type: boolean
        kiosk_orders_enabled:
          description: >-
            Whether guests can order from the table's kiosk. `true` or `false`
            is a staff override; `null`

            follows the session option the booking was sold on.
          type:
            - boolean
            - 'null'
        last_interaction_at:
          format: date-time
          type:
            - string
            - 'null'
        minimum_spend:
          type:
            - integer
            - 'null'
        moved_from:
          description: >-
            The start time the booking had before it was first moved. Present
            only on a moved booking, and only when bookings are listed by date
            range.
          format: date-time
          type: string
        name:
          type:
            - string
            - 'null'
        next_follow_up_at:
          format: date-time
          type:
            - string
            - 'null'
        original_duration_minutes:
          type:
            - integer
            - 'null'
        package_amount:
          description: That package's total value in pence. Left out when there is none.
          type: integer
        payment_amount:
          type:
            - integer
            - 'null'
        payment_status:
          anyOf:
            - $ref: '#/components/schemas/models.PaymentStatus'
            - type: 'null'
        pool_inclusive_package:
          type: boolean
        pre_changeover_minutes:
          type:
            - integer
            - 'null'
        preorder_package:
          allOf:
            - $ref: '#/components/schemas/handlers.preorderPackageSummary'
          description: >-
            The package on the booking's preorders, whether staff created it or
            the customer bought it.

            Left out when no preorder offers one. Filled in only when bookings
            are listed.
        price_per_guest:
          type:
            - integer
            - 'null'
        pricing_source:
          $ref: '#/components/schemas/models.PricingSource'
        reminder_email_sent_at:
          format: date-time
          type:
            - string
            - 'null'
        reservation_recycled:
          type: boolean
        service_status:
          anyOf:
            - $ref: '#/components/schemas/models.ServiceStatus'
            - type: 'null'
        sessions:
          items:
            $ref: '#/components/schemas/handlers.bookingSessionInfo'
          type: array
        small_booking_package_id:
          description: >-
            The id of the small-booking package attached to the booking. Left
            out when there is none.
          type: string
        source:
          type:
            - string
            - 'null'
        sport_fixture:
          allOf:
            - $ref: '#/components/schemas/handlers.bookingSportFixtureSummary'
          description: >-
            The live sport fixture the booking is for. Left out when it is not a
            live sport booking.
        sport_surcharge_pence:
          description: >-
            The live sport surcharge for the whole party, not per guest, in
            pence.
          type: integer
        square_check_ids:
          items:
            type: string
          type: array
        square_order_ids:
          items:
            type: string
          type: array
        square_reservation_id:
          type: string
        status:
          $ref: '#/components/schemas/models.BookingStatus'
        table_count:
          type:
            - integer
            - 'null'
        table_locked:
          type: boolean
        tables:
          items:
            $ref: '#/components/schemas/handlers.tableInfo'
          type: array
        timezone:
          type: string
        updated_at:
          format: date-time
          type: string
        user:
          $ref: '#/components/schemas/models.User'
        utm_campaign:
          type: string
        utm_content:
          type: string
        utm_medium:
          type: string
        utm_source:
          type: string
        utm_term:
          type: string
        venue_booking_platform_id:
          format: uuid
          type: string
        venue_id:
          format: uuid
          type: string
        version:
          type: integer
      type: object
    api.Status:
      enum:
        - success
        - error
        - ended
      type: string
      x-enum-varnames:
        - StatusSuccess
        - StatusError
        - StatusEnded
    handlers.acpPackageSummary:
      properties:
        guest_count:
          type: integer
        happy_hour:
          type: boolean
        name:
          type: string
        total_value_pence:
          type: integer
      type: object
    models.User:
      properties:
        acquisition_campaign:
          description: >-
            Free-text detail under `acquisition_source`: the campaign, partner
            or event that brought the

            person in. Left out when the channel has no finer detail. Set once,
            with the source, and

            never changed.
          type: string
        acquisition_source:
          description: >-
            The channel this person first came through: `newsletter`, `enquiry`,
            `app`, `staff`,

            `paid_social`, `partner` or `event`. Set once, when the user is
            created, and never changed.

            Left out when it is not known.
          type: string
        auth0_user_id:
          type:
            - string
            - 'null'
        created_at:
          format: date-time
          type: string
        display_name:
          type:
            - string
            - 'null'
        email:
          type: string
        first_name:
          type: string
        id:
          format: uuid
          type: string
        last_name:
          type: string
        marketing_opt_in:
          type: boolean
        phone:
          type: string
        profile_picture_url:
          type: string
        updated_at:
          format: date-time
          type: string
        user_type:
          allOf:
            - $ref: '#/components/schemas/models.UserType'
          description: 'The kind of user: `primary`, `linked` or `guest`.'
        workos_user_id:
          type:
            - string
            - 'null'
      type: object
    handlers.bookingProfileSummary:
      properties:
        guest_profile_id:
          format: uuid
          type: string
        tags:
          items:
            type: string
          type: array
        user_id:
          format: uuid
          type: string
      type: object
    handlers.bookingInsightResponse:
      properties:
        booking_id:
          format: uuid
          type: string
        created_at:
          format: date-time
          type: string
        created_by:
          $ref: '#/components/schemas/models.User'
        id:
          format: uuid
          type: string
        insight:
          type: string
        rule:
          $ref: '#/components/schemas/handlers.insightRuleSummary'
        status:
          $ref: '#/components/schemas/models.BookingInsightStatus'
        updated_at:
          format: date-time
          type: string
      type: object
    models.EnquiryArea:
      enum:
        - pool
        - bar
      type: string
      x-enum-varnames:
        - EnquiryAreaPool
        - EnquiryAreaBar
    handlers.bookingExtensionInfo:
      properties:
        added_minutes:
          type: integer
        created_at:
          format: date-time
          type: string
        guest_count:
          type: integer
        id:
          format: uuid
          type: string
        price_per_guest:
          type: integer
        total_amount:
          type: integer
      type: object
    models.PaymentStatus:
      enum:
        - no_payment
        - pending
        - paid
        - refunded
        - partially_refunded
        - partially_paid
        - cancelled
        - expired
        - failed
        - card_on_file_saved
      type: string
      x-enum-comments:
        PaymentStatusCardOnFileSaved: 'Bar booking: card saved, no charge attempted'
      x-enum-descriptions:
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - 'Bar booking: card saved, no charge attempted'
      x-enum-varnames:
        - PaymentStatusNoPayment
        - PaymentStatusPending
        - PaymentStatusPaid
        - PaymentStatusRefunded
        - PaymentStatusPartiallyRefunded
        - PaymentStatusPartiallyPaid
        - PaymentStatusCancelled
        - PaymentStatusExpired
        - PaymentStatusFailed
        - PaymentStatusCardOnFileSaved
    handlers.preorderPackageSummary:
      properties:
        menu_id:
          type: string
        name:
          type: string
      type: object
    models.PricingSource:
      enum:
        - ''
        - quick_play
        - rate_window
        - fallback
        - manual
        - package_inclusive
        - sport
        - smart_price
      type: string
      x-enum-comments:
        PricingSourceFallback: rate type's 10-minute fallback × slots
        PricingSourceManual: set by hand; nothing writes this yet
        PricingSourceQuickPlay: flat venue-level quick play rate
        PricingSourceRateWindow: exact rate-window match for the duration
        PricingSourceUnknown: rows predating the column
      x-enum-descriptions:
        - rows predating the column
        - flat venue-level quick play rate
        - exact rate-window match for the duration
        - rate type's 10-minute fallback × slots
        - set by hand; nothing writes this yet
        - ''
        - ''
        - ''
      x-enum-varnames:
        - PricingSourceUnknown
        - PricingSourceQuickPlay
        - PricingSourceRateWindow
        - PricingSourceFallback
        - PricingSourceManual
        - PricingSourcePackageInclusive
        - PricingSourceSport
        - PricingSourceSmartPrice
    models.ServiceStatus:
      enum:
        - late
        - arrived_ground_floor_bar
        - arrived_first_floor_bar
        - partially_seated
        - no_show
      type: string
      x-enum-varnames:
        - ServiceStatusLate
        - ServiceStatusArrivedGroundFloorBar
        - ServiceStatusArrivedFirstFloorBar
        - ServiceStatusPartiallySeated
        - ServiceStatusNoShow
    handlers.bookingSessionInfo:
      properties:
        code:
          type: string
        ended_at:
          format: date-time
          type:
            - string
            - 'null'
        started_at:
          format: date-time
          type:
            - string
            - 'null'
      type: object
    handlers.bookingSportFixtureSummary:
      properties:
        away_team_name:
          type: string
        competition_name:
          type: string
        event_name:
          type:
            - string
            - 'null'
        home_team_name:
          type: string
        id:
          format: uuid
          type: string
        kickoff_at:
          format: date-time
          type: string
      type: object
    models.BookingStatus:
      enum:
        - new
        - in_progress
        - not_converted
        - rescheduling
        - confirmed
        - cancelled
        - no_show
        - completed
      type: string
      x-enum-varnames:
        - BookingStatusNew
        - BookingStatusInProgress
        - BookingStatusNotConverted
        - BookingStatusRescheduling
        - BookingStatusConfirmed
        - BookingStatusCancelled
        - BookingStatusNoShow
        - BookingStatusCompleted
    handlers.tableInfo:
      properties:
        id:
          format: uuid
          type: string
        max_capacity:
          type: integer
        pos_alias:
          type: string
        public_id:
          type: string
        table_alias:
          type: string
        table_type:
          type: string
      type: object
    models.UserType:
      enum:
        - primary
        - linked
        - guest
      type: string
      x-enum-varnames:
        - UserTypePrimary
        - UserTypeLinked
        - UserTypeGuest
    handlers.insightRuleSummary:
      properties:
        color_code:
          type: string
        id:
          format: uuid
          type: string
        priority:
          type: integer
        tag:
          type: string
      type: object
    models.BookingInsightStatus:
      enum:
        - pending
        - confirmed
      type: string
      x-enum-varnames:
        - BookingInsightStatusPending
        - BookingInsightStatusConfirmed
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.