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

# Retrieve bookings

> Retrieve all bookings of resources. <h3>OAuth</h3>Required scopes: <code>resources.readonly</code> or <code>resources</code>



## OpenAPI

````yaml /assets/openapi.json get /resources/bookings/v1
openapi: 3.0.2
info:
  title: Spacebring
  version: 1.0.0
  termsOfService: https://www.spacebring.com/terms
servers:
  - url: https://api.spacebring.com
security: []
paths:
  /resources/bookings/v1:
    get:
      tags:
        - Resources
      summary: Retrieve bookings
      description: >-
        Retrieve all bookings of resources. <h3>OAuth</h3>Required scopes:
        <code>resources.readonly</code> or <code>resources</code>
      operationId: getBookings
      parameters:
        - in: query
          name: resourceRef
          description: The id of the resource. Required if `locationRef` is not passed.
          schema:
            type: string
            format: uuid
        - in: query
          name: locationRef
          description: The id of the location. Required if `resourceRef` is not passed.
          schema:
            type: string
            format: uuid
        - in: query
          name: membershipRefOwner
          description: The id of the membership owner.
          schema:
            type: string
            format: uuid
        - in: query
          name: endDate
          description: The date filter of items.
          schema:
            type: object
            properties:
              lte:
                format: date-time
                type: string
                description: >-
                  Get bookings with less or equal end date. Example:
                  endDate[lte]=2021-05-21T10:00:00Z
              gte:
                format: date-time
                type: string
                description: >-
                  Get bookings with greater or equal end date. Example:
                  endDate[gte]=2021-05-21T10:00:00Z
              lt:
                format: date-time
                type: string
                description: >-
                  Get bookings with less end date. Example:
                  endDate[lt]=2021-05-21T10:00:00Z
              gt:
                format: date-time
                type: string
                description: >-
                  Get bookings with greater end date. Example:
                  endDate[gt]=2021-05-21T10:00:00Z
        - in: query
          name: startDate
          description: The date filter of items.
          schema:
            type: object
            properties:
              lte:
                format: date-time
                type: string
                description: >-
                  Get bookings with less or equal start date. Example:
                  startDate[lte]=2021-05-21T10:00:00Z
              gte:
                format: date-time
                type: string
                description: >-
                  Get bookings with greater or equal start date. Example:
                  startDate[gte]=2021-05-21T10:00:00Z
              lt:
                format: date-time
                type: string
                description: >-
                  Get bookings with less start date. Example:
                  startDate[lt]=2021-05-21T10:00:00Z
              gt:
                format: date-time
                type: string
                description: >-
                  Get bookings with greater start date. Example:
                  startDate[gt]=2021-05-21T10:00:00Z
        - in: query
          name: limit
          schema:
            type: integer
            format: int64
            minimum: 1
            maximum: 100
            default: 25
          description: The number of items to return
        - in: query
          name: order
          description: >-
            The order of filtered items. Format - `field:order`. Possible field
            values are `createDate`, `endDate`, `startDate`, `id`. Order values
            - `asc`, `desc`.
          schema:
            type: string
            default: endDate:asc
        - in: query
          name: nextPageToken
          schema:
            $ref: '#/components/schemas/nextPageToken'
          description: Token to retrieve the next page of results.
        - in: query
          name: types
          description: >-
            The types of resources to retrieve bookings for. Pass them as comma
            separated values.
          schema:
            type: string
            enum:
              - hotDesk
              - dedicatedDesk
              - office
              - parkingLot
              - room
        - in: header
          name: spacebring-network-id
          schema:
            type: string
            format: uuid
          required: false
          description: >-
            The id of the network. Required when using bearer token
            authentication
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  bookings:
                    type: array
                    items:
                      $ref: '#/components/schemas/booking'
                  nextPageToken:
                    $ref: '#/components/schemas/nextPageToken'
                  searchQueryNext:
                    $ref: '#/components/schemas/searchQueryNext'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - BasicAuth: []
        - OAuth2:
            - resources.readonly
            - resources
components:
  schemas:
    nextPageToken:
      type: string
      description: >-
        Opaque cursor token for retrieving the next page of results. Pass this
        value as the `nextPageToken` query parameter in your next request.
    booking:
      type: object
      properties:
        attendees:
          type: array
          items:
            type: object
            properties:
              membershipRef:
                type: string
                format: uuid
              user:
                $ref: '#/components/schemas/user'
        createDate:
          $ref: '#/components/schemas/dateSchema'
        deleteDate:
          $ref: '#/components/schemas/dateSchema'
        endDate:
          $ref: '#/components/schemas/dateSchema'
        id:
          type: string
          format: uuid
        memo:
          type: string
        membershipRefOwner:
          type: string
          format: uuid
        payment:
          $ref: '#/components/schemas/payment'
        resourceRef:
          type: string
          format: uuid
        seats:
          type: integer
        startDate:
          $ref: '#/components/schemas/dateSchema'
        title:
          type: string
        updateDate:
          $ref: '#/components/schemas/dateSchema'
        userOwner:
          $ref: '#/components/schemas/user'
    searchQueryNext:
      type: string
      description: >-
        Pre-built query string for the next page of results. Contains all active
        filter parameters combined with the next page token, ready to append to
        the endpoint URL.
    responseError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
    user:
      type: object
      properties:
        about:
          type: string
        email:
          type: string
        id:
          type: string
          format: uuid
        name:
          type: string
        phoneNumber:
          type: string
        photoUrl:
          type: string
        surname:
          type: string
    dateSchema:
      format: date-time
      type: string
      description: The date and time in ISO 8601 format, e.g. 2021-05-21T10:00:00Z
    payment:
      type: object
      properties:
        amount:
          type: number
          description: The amount of the payment
        currencyCode:
          type: string
          description: The currency code of the payment
        invoiceItemRef:
          type: string
          description: The reference ID of the invoice item
        status:
          type: string
          enum:
            - succeeded
            - pending
            - processing
            - canceled
            - failed
        tax:
          type: object
          properties:
            inclusive:
              type: boolean
            rate:
              type: number
        transactionRef:
          type: string
          description: The reference ID of the transaction
        type:
          type: string
          enum:
            - credits
            - dayPasses
            - external
            - flow
            - fondy
            - freedompay
            - invoice
            - kakaopay
            - mercadopago
            - paypal
            - paystack
            - plata
            - stripe
            - tap
            - wayforpay
  securitySchemes:
    BasicAuth:
      type: http
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#basic-authentication)
        for how to authorize your requests
      scheme: basic
    OAuth2:
      type: oauth2
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#oauth2)
        for how to authorize your requests
      flows:
        authorizationCode:
          authorizationUrl: https://api.spacebring.com/oauth2/authorize
          tokenUrl: https://api.spacebring.com/oauth2/token
          refreshUrl: https://api.spacebring.com/oauth2/token
          scopes:
            benefits.readonly: Read benefits and applications
            benefits: Read and write benefits and applications
            community.readonly: Read community companies and memberships
            community: Read and write community companies and memberships
            events.readonly: Read events and tickets
            events: Read and write events and tickets
            feed.readonly: Read feed posts
            feed: Read and write feed posts
            invoices.readonly: Read invoices
            invoices: Read and write invoices
            locations.readonly: Read locations
            locations: Read and write locations
            plans.readonly: Read plans
            plans: Read and write plans
            resources.readonly: Read resources and bookings
            resources: Read and write resources and bookings
            subscriptions.readonly: Read subscriptions
            subscriptions: Read and write subscriptions
            shop.readonly: Read products and orders
            shop: Read and write products and orders
            support.readonly: Read support tickets
            support: Read and write support tickets
            transactions.readonly: Read transactions
            transactions: Read and write transactions
            visitors.readonly: Read visitors
            visitors: Read and write visitors

````