# QBridge API - [Introduction](https://docs.qbridge.dev/index.md): Where the QBridge API lives, how to authenticate, and what every response looks like. - [Who can call what](https://docs.qbridge.dev/access.md): Which roles may call each endpoint, read from the permission check in each handler. - [List bookings](https://docs.qbridge.dev/api-reference/bookings/list-bookings.md): Returns a page of bookings, newest `booking_start` first by default. Every filter is optional and filters combine with AND. - [Create a booking](https://docs.qbridge.dev/api-reference/bookings/create-a-booking.md): Creates a booking with confirmed start and end times. Enquiries without confirmed times are leads and are not created here. - [Get a booking](https://docs.qbridge.dev/api-reference/bookings/get-a-booking.md): Returns one booking. Who receives the whole booking and who a reduced view is set out below. The reduced view holds only `id`, `venue_id`, `guest_count`, `booking_start`, `booking_end`, `sessions` and a `user` with the booker's `id` and `first_name`. - [Convert a booking back to a lead](https://docs.qbridge.dev/api-reference/bookings/convert-a-booking-back-to-a-lead.md): Parks a future confirmed booking as a rescheduling lead, releasing its tables, session and Square reservation - [Toggle the corporate flag on a booking](https://docs.qbridge.dev/api-reference/bookings/toggle-the-corporate-flag-on-a-booking.md): Sets bookings.is_corporate. The only write path for the flag after creation; records a booking activity. - [End a booking's session](https://docs.qbridge.dev/api-reference/bookings/end-a-bookings-session.md): Sets `ended_at` on the booking's one session to the server's current time. No request body is needed. - [Toggle the event flag on a booking](https://docs.qbridge.dev/api-reference/bookings/toggle-the-event-flag-on-a-booking.md): Sets bookings.is_event. The only write path for the flag after creation; records a booking activity. - [Extend a booking](https://docs.qbridge.dev/api-reference/bookings/extend-a-booking.md): Moves the end of the booking to one of the options returned by `GET /bookings/{id}/extend-options`. Send the chosen option's `added_minutes` and `new_end` back unchanged. Nothing is paid here: the price is added to the bill that is already open for the table. Sending the same option again succeeds w… - [Get a booking's extension options](https://docs.qbridge.dev/api-reference/bookings/get-a-bookings-extension-options.md): Returns the extra time that can be added to the end of the booking, each option with its price for the whole party. At most three options are offered, in steps of the venue's time slot length. When `can_extend` is `false`, `options` is empty, `reason` holds a reason code and `reason_label` says why… - [Set the kiosk ordering override on a booking](https://docs.qbridge.dev/api-reference/bookings/set-the-kiosk-ordering-override-on-a-booking.md): Sets bookings.kiosk_orders_enabled. true or false overrides the session option, null follows it again; the venue's switch still wins. The only write path for the field; records a booking activity and tells the table. - [Toggle booking lock status](https://docs.qbridge.dev/api-reference/bookings/toggle-booking-lock-status.md): Sets the locked status of a booking to prevent table reassignment - [Preview the price of moving a booking](https://docs.qbridge.dev/api-reference/bookings/preview-the-price-of-moving-a-booking.md): Reports what moving a booking to new times would do to its price. Nothing is changed, so this is safe to call repeatedly. Prices are per guest. Multiply by the guest count for the total. - [Start a booking's session](https://docs.qbridge.dev/api-reference/bookings/start-a-bookings-session.md): Sets `started_at` on the booking's one session to the server's current time. No request body is needed. The booking's tables are added to the session as its session tables. - [Replace all table assignments for a booking](https://docs.qbridge.dev/api-reference/bookings/replace-all-table-assignments-for-a-booking.md): Replaces all table assignments for a booking with the provided table IDs - [Get a booking by payment intent](https://docs.qbridge.dev/api-reference/bookings/get-a-booking-by-payment-intent.md): Returns the booking a payment was taken for, with its sessions and their check-in codes. The id is the one checkout returned for the payment: a Stripe payment intent id or, for a payment taken through Square, the booking payment id or the Square payment id. - [Get today's bookings on a pool table](https://docs.qbridge.dev/api-reference/bookings/get-todays-bookings-on-a-pool-table.md): Returns the confirmed bookings on the pool table for the venue's current business day, earliest first. The business day changes at the venue's cut-off hour, not at midnight, so in the early hours it is still the day before. `is_currently_booked` is `true` when the current time falls inside one of th… - [List the games on a booking's tables](https://docs.qbridge.dev/api-reference/games/list-the-games-on-a-bookings-tables.md): Returns every table of the booking with the game types it can play right now, in `available_game_type_ids`. `inherited_game_type_ids` holds the game types the table would fall back to if its own setting were removed. The list is not paged. - [Create a game](https://docs.qbridge.dev/api-reference/games/create-a-game.md): Creates a game on a session table. The new game has not started; start it with `POST /games/{id}/start`. - [Update a game](https://docs.qbridge.dev/api-reference/games/update-a-game.md): Stores a new `game_data` payload for the game, the only field this endpoint changes. The payload is not returned: the response carries `game_data_s3_key`, the key it is stored under. A body without `game_data` changes nothing and still returns the game. To start or end a game use `POST /games/{id}/s… - [End a game](https://docs.qbridge.dev/api-reference/games/end-a-game.md): Sets the game's `ended_at`. The body is optional: without `occurred_at` the current server time is used. `occurred_at` is an RFC 3339 timestamp. UTC ending in `Z` is usual; a time with an offset such as `+01:00` is accepted too. - [Start a game](https://docs.qbridge.dev/api-reference/games/start-a-game.md): Sets the game's `started_at`. The body is optional: without `occurred_at` the current server time is used. `occurred_at` is an RFC 3339 timestamp. UTC ending in `Z` is usual; a time with an offset such as `+01:00` is accepted too. - [Create a game with its teams and players](https://docs.qbridge.dev/api-reference/games/create-a-game-with-its-teams-and-players.md): Creates a game, its teams and each team's players in one request. The game type is chosen by `dll_name`. Teams are numbered from 0 in the order given, and players are sequenced from 0 within their team. A player's `ratings` is present only when the player has a rating from a game that has ended. - [List venue game types](https://docs.qbridge.dev/api-reference/games/list-venue-game-types.md): Returns one entry for each game type set up at a venue, whether or not the venue currently offers it. At most one filter is applied: `organization_id` takes precedence over `brand_id`, and `brand_id` over `venue_id`. Without a filter the list covers every venue. The list is not paged. - [Get a venue game type](https://docs.qbridge.dev/api-reference/games/get-a-venue-game-type.md): **Who can call it:** Any staff role with access to the venue. Also the machine key. - [List a venue's floor plan items](https://docs.qbridge.dev/api-reference/floor-plan/list-a-venues-floor-plan-items.md): Returns every item on the floor plan of the venue given in `venue_id`, which is required. The list is not paged. - [Get a floor plan item](https://docs.qbridge.dev/api-reference/floor-plan/get-a-floor-plan-item.md): **Who can call it:** Any staff role with access to the venue. Also the machine key. - [List game shots](https://docs.qbridge.dev/api-reference/game-shots/list-game-shots.md): Returns every shot that matches the filters. The list is not paged. Every filter is optional and filters combine with AND, except that only one of `organization_id`, `brand_id` and `venue_id` is applied: the first one given, in that order. With none of `organization_id`, `brand_id`, `venue_id` and `… - [Create a game shot](https://docs.qbridge.dev/api-reference/game-shots/create-a-game-shot.md): Records one shot taken by a team player. The shot's game, team, user and venue are taken from the team player. When `previous_rating`, `shots_played`, `difficulty` and `successful` are all given, the shot is rated and the response carries `eps`, `rating_delta` and `new_rating`. `shot_data` is not re… - [Get a game shot](https://docs.qbridge.dev/api-reference/game-shots/get-a-game-shot.md): **Who can call it:** Any staff role with access to the venue. Also the machine key. - [Delete a game shot](https://docs.qbridge.dev/api-reference/game-shots/delete-a-game-shot.md): **Who can call it:** Venue Admin, Brand Admin or Organization Admin with access to the venue. Also the machine key. - [Update a game shot](https://docs.qbridge.dev/api-reference/game-shots/update-a-game-shot.md): Changes only the fields that are given; at least one is required. A field sent as `null` is left unchanged. The rating fields are not recalculated. - [List a team player's game shots](https://docs.qbridge.dev/api-reference/game-shots/list-a-team-players-game-shots.md): Returns every shot the team player has taken, in ascending `round_number`. The list is not paged. The caller needs read access across all venues; access to one organisation, brand or venue is not enough. A team player id that matches no team player returns an empty list. - [Get a user's latest rating](https://docs.qbridge.dev/api-reference/game-shots/get-a-users-latest-rating.md): Returns the rating the user held at the end of their most recently ended game as `latest`, and the one from the ended game before it as `previous` when there is one. A game that is still in progress is not counted. The caller needs read access across all venues; access to one organisation, brand or… - [List a user's game shots](https://docs.qbridge.dev/api-reference/game-shots/list-a-users-game-shots.md): Returns every shot the user has taken, at any venue, newest first. The list is not paged. The caller needs read access across all venues; access to one organisation, brand or venue is not enough. A user id that matches no user returns an empty list. - [List game type stat mappings](https://docs.qbridge.dev/api-reference/stats/list-game-type-stat-mappings.md): Returns every mapping. Each one pairs a game type with a stat type, and mappings are the same for all venues. The list is not paged. - [Get a game type stat mapping](https://docs.qbridge.dev/api-reference/stats/get-a-game-type-stat-mapping.md): **Who can call it:** The machine key only. No staff role is enough. - [List stat types](https://docs.qbridge.dev/api-reference/stats/list-stat-types.md): Returns every stat type. Stat types are the same for all venues. The list is not paged. - [Get a stat type](https://docs.qbridge.dev/api-reference/stats/get-a-stat-type.md): **Who can call it:** The machine key only. No staff role is enough. - [List team player stats](https://docs.qbridge.dev/api-reference/stats/list-team-player-stats.md): Returns every team player stat: one team player's value for one stat type. A team player is a player's place in a team for one game, so these are per-game stats. The list is not paged and cannot be filtered. - [Create or replace a team player stat](https://docs.qbridge.dev/api-reference/stats/create-or-replace-a-team-player-stat.md): Records a team player's value for a stat type. A team player has one stat of each stat type: if one already exists, its value is replaced and the existing stat is returned, also with `201`. - [Get a team player stat](https://docs.qbridge.dev/api-reference/stats/get-a-team-player-stat.md): **Who can call it:** The machine key only. No staff role is enough. - [Delete a team player stat](https://docs.qbridge.dev/api-reference/stats/delete-a-team-player-stat.md): **Who can call it:** The machine key only. No staff role is enough. - [Update a team player stat](https://docs.qbridge.dev/api-reference/stats/update-a-team-player-stat.md): Changes only the fields that are sent. - [List user stats](https://docs.qbridge.dev/api-reference/stats/list-user-stats.md): Returns every user stat: one user's value for one stat type. The list is not paged and cannot be filtered. - [Create a user stat](https://docs.qbridge.dev/api-reference/stats/create-a-user-stat.md): Records a user's value for a stat type. A user can have one stat of each stat type. - [Get a user stat](https://docs.qbridge.dev/api-reference/stats/get-a-user-stat.md): **Who can call it:** The machine key only. No staff role is enough. - [Delete a user stat](https://docs.qbridge.dev/api-reference/stats/delete-a-user-stat.md): **Who can call it:** The machine key only. No staff role is enough. - [Update a user stat](https://docs.qbridge.dev/api-reference/stats/update-a-user-stat.md): Changes only the fields that are sent. - [List pool tables](https://docs.qbridge.dev/api-reference/pool-tables/list-pool-tables.md): At most one filter is applied: `organization_id` takes precedence over `brand_id`, and `brand_id` over `venue_id`. Without a filter the list covers every venue. The list is not paged. - [Get a pool table](https://docs.qbridge.dev/api-reference/pool-tables/get-a-pool-table.md): **Who can call it:** Any staff role with access to the venue. Also the machine key. - [List session players](https://docs.qbridge.dev/api-reference/session-players/list-session-players.md): Returns the players checked in to sessions. Every filter is optional and the list is not paged. Without `organization_id`, `brand_id` or `venue_id` the list covers every venue, which a caller whose access is limited to an organisation, brand or venue may not ask for. - [Get a session player](https://docs.qbridge.dev/api-reference/session-players/get-a-session-player.md): **Who can call it:** Any staff role with access to the venue. Also the machine key. - [Delete a session player](https://docs.qbridge.dev/api-reference/session-players/delete-a-session-player.md): Removes the player from the session. The player stays on record: listing session players with `include_deleted=true` still returns them. - [Update a session player](https://docs.qbridge.dev/api-reference/session-players/update-a-session-player.md): Changes only the fields that are sent. `name` and `profile_picture_url` are saved on the player's user, so they change wherever that user appears. `pool_table_id` or `pool_table_public_id` moves the player to another of the booking's tables (`pool_table_id` wins when both are sent). On a booking wit… - [Add a guest to a session](https://docs.qbridge.dev/api-reference/session-players/add-a-guest-to-a-session.md): Creates a guest user called `name`, adds them to the booking's guests and checks them in to the session with this check-in code. `name` is required here and must not be blank. On a booking with several tables, `pool_table_id` or `pool_table_public_id` chooses the guest's table (`pool_table_id` wins… - [List session tables](https://docs.qbridge.dev/api-reference/sessions/list-session-tables.md): Returns every session table, or only those of one session when `session_id` is given. A session table is one pool table that a session is played on. The list is not paged. - [List sessions](https://docs.qbridge.dev/api-reference/sessions/list-sessions.md): Returns every session, or only those of one booking when `booking_id` is given. The list is not paged. - [Get a session](https://docs.qbridge.dev/api-reference/sessions/get-a-session.md): **Who can call it:** Any staff role with access to the venue. Also the machine key. - [Get the session on a pool table](https://docs.qbridge.dev/api-reference/sessions/get-the-session-on-a-pool-table.md): Returns one session that the pool table belongs to. - [List a user's achievements](https://docs.qbridge.dev/api-reference/achievements/list-a-users-achievements.md): Returns every achievement the user has earned, most recently earned first. The list is empty when the user has earned none, and also when no user has this id. It is not paged. ## OpenAPI Specs - [openapi](/openapi.yaml) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.