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

# GET /v1/scheduling/resources

> List the rentable resources of the tenant: courts, rooms, kennels or hotel rooms, booked by time blocks or by nights.

A **resource** is something a customer rents rather than a service a professional delivers: a court, a meeting room, a kennel, a hotel room. Every resource is booked in one of two units, given by `booking_unit`:

* `block`: by time blocks on a day (a court from 19:00 to 20:30). Query its free blocks with [GET resources/availability](https://docs.keebai.com/dev/endpoints/scheduling-resource-availability.md).
* `night`: by stays from a check-in day to a check-out day (a kennel from Thursday to Saturday is two nights). Quote it with [GET resources/stays/availability](https://docs.keebai.com/dev/endpoints/scheduling-resource-stays-availability.md) and see its free nights with [GET resources/:id/occupancy](https://docs.keebai.com/dev/endpoints/scheduling-resource-occupancy.md).

Both units book through [POST booking/resource-bookings](https://docs.keebai.com/dev/endpoints/scheduling-resource-booking-create.md).

Only **active** resources are listed. There is no status filter.

## Endpoint

```
GET https://api.keebai.com/v1/scheduling/resources
```

## Required scope

`scheduling:services:read`

## Query params

Every param is optional.

```json theme={"system"}
{
  "branch_id": "665f00000000000000000b01",
  "booking_unit": "night",
  "booking_mode": "shared",
  "category": "Hotel canino",
  "search": "suite",
  "skip": 0,
  "limit": 50
}
```

* `branch_id`: only the resources of that branch.
* `booking_unit`: `block` or `night`.
* `booking_mode`: `exclusive` (one booking at a time) or `shared` (several bookings share the capacity).
* `category`: exact category name.
* `search`: free text over the name.
* `skip` and `limit`: pagination. `limit` defaults to 50 and is capped at 200.

## Example request

```bash curl theme={"system"}
curl -G https://api.keebai.com/v1/scheduling/resources \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  --data-urlencode "branch_id=665f00000000000000000b01" \
  --data-urlencode "booking_unit=night"
```

```js JavaScript theme={"system"}
const url = new URL("https://api.keebai.com/v1/scheduling/resources");
url.searchParams.set("branch_id", branchId);
url.searchParams.set("booking_unit", "night");

const { items } = await (
  await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` },
  })
).json();
```

## Response

### 200 OK

```json theme={"system"}
{
  "items": [
    {
      "id": "665f00000000000000000a01",
      "branch_id": "665f00000000000000000b01",
      "branch_name": "Sucursal Centro",
      "name": "Suite canina · Mediana",
      "description": "Para perros de hasta 20 kg.",
      "category": "Hotel canino",
      "image_url": "https://cdn.example.com/suite-mediana.jpg",
      "booking_unit": "night",
      "booking_mode": "shared",
      "capacity": 10,
      "min_party": 1,
      "max_party_per_booking": 2,
      "durations_minutes": [1440],
      "pricing": {
        "mode": "per_block",
        "currency": "CLP",
        "by_duration": [{ "minutes": 1440, "amount": 20000 }]
      },
      "stay": { "min_nights": 1, "max_nights": 30 },
      "status": "active"
    },
    {
      "id": "665f00000000000000000a03",
      "branch_id": "665f00000000000000000b02",
      "branch_name": "Sucursal Norte",
      "name": "Cancha 2",
      "booking_unit": "block",
      "booking_mode": "exclusive",
      "capacity": 1,
      "min_party": 1,
      "max_party_per_booking": 1,
      "durations_minutes": [60, 90],
      "pricing": {
        "mode": "per_block",
        "currency": "CLP",
        "by_duration": [
          { "minutes": 60, "amount": 18000 },
          { "minutes": 90, "amount": 24000 }
        ]
      },
      "stay": null,
      "status": "active"
    }
  ],
  "total": 2,
  "skip": 0,
  "limit": 50
}
```

* `pricing.by_duration`: in a `block` resource, one price per offered duration. In a `night` resource there is exactly one tier and its `amount` is the price of **one night**. Its `minutes` carries no meaning.
* `pricing.mode`: `per_block` charges the amount once. `per_person` multiplies it by the party size.
* `stay`: minimum and maximum nights of a `night` resource. `null` for `block`.
* `capacity`: in a `shared` resource, how many people (summing the party size of every booking) fit at once, or each night. An `exclusive` resource takes one booking at a time.

### 401 Unauthorized · 403 Forbidden

Same semantics as the rest of the public API.


## OpenAPI

````yaml GET /v1/scheduling/resources
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/scheduling/resources:
    get:
      tags:
        - scheduling-resources
      summary: List rentable resources
      description: >-
        Active resources of the tenant. `booking_unit` says whether a resource
        is booked by time blocks (`block`) or by nights (`night`). In a night
        resource the amount of its only pricing tier is the price of one night.
      operationId: PublicResourcesController_list
      parameters:
        - name: branch_id
          required: false
          in: query
          description: Only the resources of this branch.
          schema:
            type: string
        - name: booking_unit
          required: false
          in: query
          description: '`block` (booked by time blocks) or `night` (stays).'
          schema:
            type: string
            enum:
              - block
              - night
        - name: booking_mode
          required: false
          in: query
          schema:
            type: string
            enum:
              - exclusive
              - shared
        - name: category
          required: false
          in: query
          description: Exact category name.
          schema:
            type: string
        - name: search
          required: false
          in: query
          description: Free-text search over name.
          schema:
            type: string
        - name: skip
          required: false
          in: query
          schema:
            type: number
            default: 0
            minimum: 0
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 200
            default: 50
            type: number
      responses:
        '200':
          description: ''
      security:
        - PAT: []
components:
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````

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