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

# Get all bookings (with filtering)

> Retrieves a list of all bookings in the system, primarily for administrative purposes.
Supports filtering by `event_id` using a query parameter. If no parameters are provided, it returns all bookings.
This is a protected endpoint. Access is restricted to users with `admin` or `manager` roles.




## OpenAPI

````yaml api-reference/openapi.json get /api/bookings
openapi: 3.0.0
info:
  title: Tandem IT API
  version: 1.0.0
  description: API for tandem it backend
servers:
  - url: https://tandem.hlofiys.xyz
    description: Production server
security: []
tags:
  - name: Documentation
    description: API documentation endpoint
paths:
  /api/bookings:
    get:
      tags:
        - 'Admin: Bookings'
      summary: Get all bookings (with filtering)
      description: >
        Retrieves a list of all bookings in the system, primarily for
        administrative purposes.

        Supports filtering by `event_id` using a query parameter. If no
        parameters are provided, it returns all bookings.

        This is a protected endpoint. Access is restricted to users with `admin`
        or `manager` roles.
      operationId: getAdminBookings
      parameters:
        - name: event_id
          in: query
          description: Filter bookings by a specific event ID.
          required: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: A successful response returning a list of bookings.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Booking'
        '401':
          description: >-
            Unauthorized. Authentication credentials were not provided or are
            invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden. The authenticated user is not an administrator
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found. Event with the specified ID was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error. An unexpected error occurred on the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    Booking:
      type: object
      required:
        - booking_id
        - user_id
        - event_id
        - seat_id
        - is_paid
        - created_at
        - updated_at
      properties:
        booking_id:
          type: integer
          format: int64
        user_id:
          type: string
          format: uuid
        event_id:
          type: integer
          format: int64
        seat_id:
          type: integer
          format: int64
        is_paid:
          type: boolean
          description: >-
            Indicates whether the booking has been paid for. `false` for initial
            reservation
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````