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

# Check resource availability

> Check whether a resource can be booked for a slot before creating the booking. The same rules as booking creation apply: capacity, the location and resource schedule, duration limits and the booking window. When the slot is unavailable, the response carries the code the booking would fail with. <h3>OAuth</h3>Required scopes: <code>resources.readonly</code> or <code>resources</code>



## OpenAPI

````yaml /assets/openapi.json post /resources/v1/{resourceId}/availability
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/v1/{resourceId}/availability:
    post:
      tags:
        - Resources
      summary: Check resource availability
      description: >-
        Check whether a resource can be booked for a slot before creating the
        booking. The same rules as booking creation apply: capacity, the
        location and resource schedule, duration limits and the booking window.
        When the slot is unavailable, the response carries the code the booking
        would fail with. <h3>OAuth</h3>Required scopes:
        <code>resources.readonly</code> or <code>resources</code>
      operationId: getResourceAvailability
      parameters:
        - in: path
          name: resourceId
          required: true
          description: The id of the resource.
          schema:
            type: string
            format: uuid
        - 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
      requestBody:
        $ref: '#/components/requestBodies/getResourceAvailability'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getResourceAvailability'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - BasicAuth: []
        - OAuth2:
            - resources.readonly
            - resources
components:
  requestBodies:
    getResourceAvailability:
      content:
        application/json:
          schema:
            type: object
            properties:
              endDate:
                type: string
                format: date-time
                description: The end of the slot to check, in ISO 8601.
              entire:
                description: >-
                  Set to true to check the entire resource instead of individual
                  seats. Supported for office resources.
                type: boolean
              quantity:
                description: >-
                  The number of seats to check. Required for seat-based
                  resources such as hot desks, unless entire is true.
                type: integer
                minimum: 1
                maximum: 9007199254740991
              recurrence:
                description: >-
                  RRULE lines describing a repeating slot, e.g.
                  `RRULE:FREQ=WEEKLY;COUNT=10`. The DTSTART line is derived from
                  startDate. The slot is unavailable as soon as any occurrence
                  is.
                type: array
                items:
                  type: string
              startDate:
                type: string
                format: date-time
                description: The start of the slot to check, in ISO 8601.
            required:
              - endDate
              - startDate
      required: true
  schemas:
    getResourceAvailability:
      type: object
      properties:
        available:
          type: boolean
          description: Whether the resource can be booked for the requested slot.
        reason:
          description: >-
            The first rule the slot breaks. Present only when available is
            false.
          type: object
          properties:
            code:
              type: string
              description: >-
                The error code the booking would fail with, e.g.
                `bookingConflict` or `bookingScheduleConflict`.
            message:
              type: string
              description: The human-readable explanation of why the slot is unavailable.
          required:
            - code
            - message
          additionalProperties: false
      required:
        - available
      additionalProperties: false
    responseError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
  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 contracts, credit notes, discounts and invoices
            invoices: Read and write contract, credit notes, discounts and 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

````