> ## 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/availability/range

> Availability grouped day by day between two dates. Useful for powering a weekly or biweekly calendar.

Returns free slots for each day between `from` and `to` (both inclusive). Internally expands the range and queries each date in parallel. The range is capped at **14 days** to bound per-request cost.

## Endpoint

```
GET https://api.keebai.com/v1/scheduling/availability/range
```

## Required scope

`scheduling:availability:read`

## Query params

| Param            | Type     | Required | Description                                                          |
| ---------------- | -------- | -------- | -------------------------------------------------------------------- |
| `serviceId`      | `string` | Yes      | Service to book.                                                     |
| `from`           | `string` | Yes      | Start date (`YYYY-MM-DD`).                                           |
| `to`             | `string` | Yes      | End date (`YYYY-MM-DD`). Must be `>= from` and span at most 14 days. |
| `branchId`       | `string` | No       | Branch. If omitted, the tenant's first branch is used.               |
| `professionalId` | `string` | No       | Restrict the computation to a professional.                          |

## Example request

<CodeGroup>
  ```bash curl theme={null}
  curl -G https://api.keebai.com/v1/scheduling/availability/range \
    -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    --data-urlencode "serviceId=65b1c2d3e4f5a6b7c8d9e0f1" \
    --data-urlencode "branchId=65a1f2b3c4d5e6f7a8b9c0d1" \
    --data-urlencode "from=2026-05-02" \
    --data-urlencode "to=2026-05-08"
  ```

  ```python Python theme={null}
  import os, requests

  resp = requests.get(
      "https://api.keebai.com/v1/scheduling/availability/range",
      headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
      params={
          "serviceId": service_id,
          "branchId": branch_id,
          "from": "2026-05-02",
          "to": "2026-05-08",
      },
      timeout=15,
  )
  resp.raise_for_status()
  days = resp.json()["days"]
  ```
</CodeGroup>

## Response

### 200 OK

```json theme={null}
{
  "from": "2026-05-02",
  "to": "2026-05-08",
  "days": [
    {
      "date": "2026-05-02",
      "results": [
        {
          "id": "66c1...",
          "name": "María",
          "last_name": "Soto",
          "timeSlots": [{ "time": "09:00" }, { "time": "09:30" }]
        }
      ]
    },
    {
      "date": "2026-05-03",
      "results": []
    }
  ]
}
```

Each element of `days` has the same shape as the body of [`GET /availability`](/dev/endpoints/scheduling-availability).

If one of the dates fails individually (upstream timeout or error for that specific day), `results: []` is returned for that date and the rest of the range keeps resolving. The error is logged on Keebai's side.

### 409 Conflict

```json theme={null}
{
  "error": {
    "code": "INVALID_DATE_RANGE",
    "message": "El rango no puede exceder 14 días"
  }
}
```

Also returned if `to < from` or the dates are otherwise invalid.

### 401 Unauthorized · 403 Forbidden

Same semantics as the rest of the public API.

## Common patterns

### Weekly calendar with availability

Call once per visible week and cache the result by (service, branch, professional, week). When an appointment is created or cancelled, invalidate the matching cache entry.


## OpenAPI

````yaml GET /v1/scheduling/availability/range
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/availability/range:
    get:
      tags:
        - scheduling-availability
      summary: Disponibilidad por rango de fechas (máximo 14 días)
      description: Retorna los slots libres día a día entre `from` y `to` (inclusive).
      operationId: PublicAvailabilityController_byRange
      parameters:
        - name: serviceId
          required: true
          in: query
          description: Servicio (requerido)
          schema:
            type: string
        - name: from
          required: true
          in: query
          description: Fecha desde (YYYY-MM-DD)
          schema:
            type: string
        - name: to
          required: true
          in: query
          description: Fecha hasta (YYYY-MM-DD, máximo 14 días desde from)
          schema:
            type: string
        - name: branchId
          required: false
          in: query
          schema:
            type: string
        - name: professionalId
          required: false
          in: query
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAvailabilityRangeResponseDto'
      security:
        - PAT: []
components:
  schemas:
    PublicAvailabilityRangeResponseDto:
      type: object
      properties:
        from:
          type: string
          description: YYYY-MM-DD
        to:
          type: string
          description: YYYY-MM-DD
        days:
          type: array
          items:
            $ref: '#/components/schemas/PublicAvailabilityDayDto'
      required:
        - from
        - to
        - days
    PublicAvailabilityDayDto:
      type: object
      properties:
        date:
          type: string
          description: YYYY-MM-DD
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicAvailabilitySlotDto'
      required:
        - date
        - results
    PublicAvailabilitySlotDto:
      type: object
      properties:
        start:
          type: string
          description: Hora de inicio (HH:mm) o ISO 8601
        end:
          type: string
          description: Hora de fin (HH:mm) o ISO 8601
        professional_id:
          type: string
          description: Profesional que cubre el slot
        branch_id:
          type: string
      required:
        - start
  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`.

````