> ## 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.

# Who can call what

> Which roles may call each endpoint, read from the permission check in each handler.

This page is generated by `just openapi` from the code. Do not edit it by hand: to change who may call an endpoint, change the permission check in its handler.

## How to read it

* **A tick** means a person holding that role can call the endpoint.
* **A role counts where it is held.** A venue role works at its venue. Brand and organisation roles also cover the venues under them.
* **Machine key** is the key a Billy Q box or the Site Server signs in with.
* **Where** says which venue the role must cover. "Staff roles do not apply" means the endpoint is not tied to a venue, so no venue, brand or organisation role is enough.

## Bookings

| Endpoint | Manager | Sales | Host | Game Host | Finance | Viewer roles | Admin roles | Machine key | Where |
| - | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | - |
| List bookings `GET /bookings` | | | | | | | | | With `venue_booking_platform_id`: any staff role with access to that platform's venue. Without it: any staff role at any venue. |
| Create a booking `POST /bookings` | ✓ | ✓ | ✓ | | | | ✓ | | The venue it belongs to |
| Get a booking by payment intent `GET /bookings/payment-intent/{payment_intent_id}` | | | | | | | | | The booker. Otherwise any staff role with access to the booking's venue, or the machine key. |
| Get today's bookings on a pool table `GET /bookings/table/{table_id}/today` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |
| Get a booking `GET /bookings/{id}` | | | | | | | | | The booker, any staff role with access to the booking's venue and the machine key receive the whole booking. Any other signed-in customer receives the reduced view. |
| Convert a booking back to a lead `POST /bookings/{id}/convert-to-lead` | ✓ | ✓ | ✓ | | | | ✓ | | The venue it belongs to |
| Toggle the corporate flag on a booking `PATCH /bookings/{id}/corporate` | ✓ | ✓ | ✓ | | | | ✓ | | The venue it belongs to |
| End a booking's session `POST /bookings/{id}/end` | ✓ | | ✓ | ✓ | | | ✓ | ✓ | The venue it belongs to |
| Toggle the event flag on a booking `PATCH /bookings/{id}/event` | ✓ | ✓ | ✓ | | | | ✓ | | The venue it belongs to |
| Extend a booking `POST /bookings/{id}/extend` | | | | | | | ✓ | ✓ | The venue it belongs to |
| Get a booking's extension options `GET /bookings/{id}/extend-options` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |
| Set the kiosk ordering override on a booking `PATCH /bookings/{id}/kiosk-ordering` | ✓ | ✓ | ✓ | | | | ✓ | | The venue it belongs to |
| Toggle booking lock status `PATCH /bookings/{id}/lock` | ✓ | ✓ | ✓ | | | | ✓ | | The venue it belongs to |
| Preview the price of moving a booking `POST /bookings/{id}/reprice-preview` | ✓ | ✓ | ✓ | | | | ✓ | | The venue it belongs to |
| Start a booking's session `POST /bookings/{id}/start` | ✓ | | ✓ | ✓ | | | ✓ | ✓ | The venue it belongs to |
| Replace all table assignments for a booking `POST /bookings/{id}/tables` | ✓ | ✓ | ✓ | | | | ✓ | | The venue it belongs to |

## Sessions

| Endpoint | Manager | Sales | Host | Game Host | Finance | Viewer roles | Admin roles | Machine key | Where |
| - | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | - |
| List session tables `GET /session-tables` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |
| List sessions `GET /sessions` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |
| Get the session on a pool table `GET /sessions/table/{id}` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |
| Get a session `GET /sessions/{id}` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |

## Session players

| Endpoint | Manager | Sales | Host | Game Host | Finance | Viewer roles | Admin roles | Machine key | Where |
| - | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | - |
| List session players `GET /session-players` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The organisation, brand or venue asked for |
| Add a guest to a session `POST /session-players/guest` | | | | ✓ | | | ✓ | ✓ | The venue it belongs to |
| Delete a session player `DELETE /session-players/{id}` | ✓ | | ✓ | ✓ | | | ✓ | ✓ | The venue it belongs to |
| Get a session player `GET /session-players/{id}` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |
| Update a session player `PATCH /session-players/{id}` | ✓ | | ✓ | ✓ | | | ✓ | ✓ | The venue it belongs to |

## Games

| Endpoint | Manager | Sales | Host | Game Host | Finance | Viewer roles | Admin roles | Machine key | Where |
| - | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | - |
| List the games on a booking's tables `GET /bookings/{id}/table-games` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |
| Create a game `POST /games` | ✓ | | ✓ | | | | ✓ | ✓ | The venue it belongs to |
| Create a game with its teams and players `POST /games/with-teams` | ✓ | | ✓ | | | | ✓ | ✓ | The venue it belongs to |
| Update a game `PATCH /games/{id}` | ✓ | | ✓ | | | | ✓ | ✓ | The venue it belongs to |
| End a game `POST /games/{id}/end` | ✓ | | ✓ | | | | ✓ | ✓ | The venue it belongs to |
| Start a game `POST /games/{id}/start` | ✓ | | ✓ | | | | ✓ | ✓ | The venue it belongs to |
| List venue game types `GET /venue-game-types` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The organisation, brand or venue asked for |
| Get a venue game type `GET /venue-game-types/{id}` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |

## Game shots

| Endpoint | Manager | Sales | Host | Game Host | Finance | Viewer roles | Admin roles | Machine key | Where |
| - | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | - |
| List game shots `GET /game-shots` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The organisation, brand or venue asked for |
| Create a game shot `POST /game-shots` | | | | | | | ✓ | ✓ | The venue it belongs to |
| Delete a game shot `DELETE /game-shots/{id}` | | | | | | | ✓ | ✓ | The venue it belongs to |
| Get a game shot `GET /game-shots/{id}` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |
| Update a game shot `PATCH /game-shots/{id}` | | | | | | | ✓ | ✓ | The venue it belongs to |
| List a team player's game shots `GET /team-players/{id}/shots` | | | | | | | | ✓ | Staff roles do not apply |
| Get a user's latest rating `GET /users/{id}/latest-rating` | | | | | | | | ✓ | Staff roles do not apply |
| List a user's game shots `GET /users/{id}/shots` | | | | | | | | ✓ | Staff roles do not apply |

## Stats

| Endpoint | Manager | Sales | Host | Game Host | Finance | Viewer roles | Admin roles | Machine key | Where |
| - | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | - |
| List game type stat mappings `GET /game-type-stat-mappings` | | | | | | | | ✓ | Staff roles do not apply |
| Get a game type stat mapping `GET /game-type-stat-mappings/{id}` | | | | | | | | ✓ | Staff roles do not apply |
| List stat types `GET /stat-types` | | | | | | | | ✓ | Staff roles do not apply |
| Get a stat type `GET /stat-types/{id}` | | | | | | | | ✓ | Staff roles do not apply |
| List team player stats `GET /team-player-stats` | | | | | | | | ✓ | Staff roles do not apply |
| Create or replace a team player stat `POST /team-player-stats` | | | | | | | | ✓ | Staff roles do not apply |
| Delete a team player stat `DELETE /team-player-stats/{id}` | | | | | | | | ✓ | Staff roles do not apply |
| Get a team player stat `GET /team-player-stats/{id}` | | | | | | | | ✓ | Staff roles do not apply |
| Update a team player stat `PATCH /team-player-stats/{id}` | | | | | | | | ✓ | Staff roles do not apply |
| List user stats `GET /user-stats` | | | | | | | | ✓ | Staff roles do not apply |
| Create a user stat `POST /user-stats` | | | | | | | | ✓ | Staff roles do not apply |
| Delete a user stat `DELETE /user-stats/{id}` | | | | | | | | ✓ | Staff roles do not apply |
| Get a user stat `GET /user-stats/{id}` | | | | | | | | ✓ | Staff roles do not apply |
| Update a user stat `PATCH /user-stats/{id}` | | | | | | | | ✓ | Staff roles do not apply |

## Pool tables

| Endpoint | Manager | Sales | Host | Game Host | Finance | Viewer roles | Admin roles | Machine key | Where |
| - | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | - |
| List pool tables `GET /pool-tables` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The organisation, brand or venue asked for |
| Get a pool table `GET /pool-tables/{id}` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |

## Floor plan

| Endpoint | Manager | Sales | Host | Game Host | Finance | Viewer roles | Admin roles | Machine key | Where |
| - | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | - |
| List a venue's floor plan items `GET /floor-plan-items` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |
| Get a floor plan item `GET /floor-plan-items/{id}` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | The venue it belongs to |

## Achievements

| Endpoint | Manager | Sales | Host | Game Host | Finance | Viewer roles | Admin roles | Machine key | Where |
| - | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | - |
| List a user's achievements `GET /users/{id}/achievements` | | | | | | | | ✓ | Staff roles do not apply |


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