> Documentation index: https://docs.dev.repp.co.il/llms.txt - fetch it to find every page of these docs.

# Calendar

What is in the account's calendar, as the site's own calendar shows it.

- `GET https://api.dev.repp.co.il/v1/calendar`
- Needs a key: `Authorization: Bearer repp_…`.

For a business: its classes (with a trainer, and still looking) and its spaces' bookings (confirmed, and waiting for its yes). For a trainer: the classes it was chosen for, the open classes it offered on, and its bookings.

Nothing cancelled is listed, and a class still looking leaves the calendar once it has begun. The range is at most **124 days**, both ends counted.

## Query parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `side` **(required)** | one of: business, trainer | — | Which side of the account: `business` or `trainer`. |
| `from` | YYYY-MM-DD | — | First day, inclusive. Default: today in Israel. |
| `to` | YYYY-MM-DD | — | Last day, inclusive. Default: 30 days after `from`. |

## Request

**cURL**

```bash
curl "https://api.dev.repp.co.il/v1/calendar?side=business&from=2026-12-01&to=2026-12-31" \
  -H "Authorization: Bearer $REPP_API_KEY"
```

**JavaScript**

```js
const response = await fetch("https://api.dev.repp.co.il/v1/calendar?side=business&from=2026-12-01&to=2026-12-31", {
  headers: { Authorization: `Bearer ${process.env.REPP_API_KEY}` },
});
if (!response.ok) throw new Error((await response.json()).error.message);
const data = await response.json();
```

**TypeScript**

```ts
/** The calendar in the range you asked for. */
interface CalendarEvents {
  items: CalendarEvent[];
}

/** Something in the calendar. */
interface CalendarEvent {
  kind: "class" | "booking";
  id: string;
  state: "open" | "filled" | "offered" | "pending" | "confirmed";
  date: string;
  start_time: string;
  end_time: string;
  starts_at: string;
  ends_at: string;
  style: Style | null;
  space: {
    id: string;
    name: string;
  } | null;
  business_name: string;
  other_name: string | null;
  address: string;
  amount: number;
  weekly: boolean;
}

/** A training style: one of the keys in Catalog. */
type Style =
  | "pilates"
  | "barre"
  | "strength"
  | "crossfit"
  | "trx"
  | "calisthenics"
  | "cardio"
  | "hiit"
  | "spinning"
  | "running"
  | "aqua"
  | "yoga"
  | "mobility"
  | "meditation"
  | "personal"
  | "martial_arts"
  | "boxing"
  | "krav_maga"
  | "dance"
  | "zumba"
  | "kids"
  | "seniors"
  | "other";

interface ApiError {
  error: { code: string; message: string; reason?: string };
}

const response = await fetch("https://api.dev.repp.co.il/v1/calendar?side=business&from=2026-12-01&to=2026-12-31", {
  headers: { Authorization: `Bearer ${process.env.REPP_API_KEY}` },
});
if (!response.ok) throw new Error(((await response.json()) as ApiError).error.message);
const data = (await response.json()) as CalendarEvents;
```

**Python**

```python
import os

import requests

response = requests.get(
    "https://api.dev.repp.co.il/v1/calendar?side=business&from=2026-12-01&to=2026-12-31",
    headers={"Authorization": f"Bearer {os.environ['REPP_API_KEY']}"},
    timeout=30,
)
if not response.ok:
    raise RuntimeError(response.json()["error"]["message"])
data = response.json()
```

**PHP**

```php
<?php
$ch = curl_init("https://api.dev.repp.co.il/v1/calendar?side=business&from=2026-12-01&to=2026-12-31");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("REPP_API_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["error"]["message"]);
}
```

## Response (200)

```json
{
  "items": [
    {
      "kind": "class",
      "id": "a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b",
      "state": "filled",
      "date": "2026-12-01",
      "start_time": "18:00",
      "end_time": "19:00",
      "starts_at": "2026-12-01T16:00:00+00:00",
      "ends_at": "2026-12-01T17:00:00+00:00",
      "style": "yoga",
      "space": null,
      "business_name": "סטודיו נועה",
      "other_name": "דנה כהן",
      "address": "ביאליק 20, רמת גן",
      "amount": 180,
      "weekly": false
    },
    {
      "kind": "booking",
      "id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
      "state": "pending",
      "date": "2026-12-02",
      "start_time": "11:00",
      "end_time": "13:00",
      "starts_at": "2026-12-02T09:00:00+00:00",
      "ends_at": "2026-12-02T11:00:00+00:00",
      "style": null,
      "space": {
        "id": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
        "name": "מתחם הקומה השנייה"
      },
      "business_name": "סטודיו נועה",
      "other_name": "יוסי לוי",
      "address": "ביאליק 20, רמת גן",
      "amount": 180,
      "weekly": true
    }
  ]
}
```

## Response fields

| Field | Type | Description |
| --- | --- | --- |
| `items` | array of CalendarEvent | In order of time. |
| `items[].kind` | one of: class, booking | class: a class. booking: a space booking. |
| `items[].id` | string | Identifier. |
| `items[].state` | one of: open, filled, offered, pending, confirmed | open: still looking for a trainer. filled: has its trainer. offered: you offered and wait to be chosen. pending: waits for the business's yes. confirmed: confirmed. |
| `items[].date` | string | A date in Israel, YYYY-MM-DD. |
| `items[].start_time` | string | A time of day in Israel, HH:MM, 24 hours. |
| `items[].end_time` | string | End time. Past midnight it is a time of the next day; ends_at is exact. |
| `items[].starts_at` | string | An exact moment, ISO 8601 with its offset. |
| `items[].ends_at` | string | An exact moment, ISO 8601 with its offset. |
| `items[].style` | one of: pilates, barre, strength, crossfit, trx, calisthenics, cardio, hiit, spinning, running, aqua, yoga, mobility, meditation, personal, martial_arts, boxing, krav_maga, dance, zumba, kids, seniors, other, nullable | The class's style, or null for a booking. |
| `items[].space` | object, nullable | The space, or null for a class. |
| `items[].space.id` | string | Identifier. |
| `items[].space.name` | string | The space's name. |
| `items[].business_name` | string | The business's name. |
| `items[].other_name` | string, nullable | The other side: the trainer (for a business) or the business (for a trainer), or null while there is none. |
| `items[].address` | string | The address. |
| `items[].amount` | integer | The deal's amount, in whole shekels. |
| `items[].weekly` | boolean | Part of a weekly booking. |

## Errors

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | `bad_parameter` | A parameter is not one the endpoint accepts. The message names it. |
| 400 | `bad_range` | `to` is before `from`, or the range is longer than 124 days. |
| 401 | `missing_key` | The endpoint needs a key and no Authorization header came. |
| 401 | `bad_key` | The key is not one of ours, was revoked, or its account was closed or blocked. |
| 429 | `too_many_requests` | Over the rate limit. Wait the seconds in `Retry-After` (60) and go on. |
| 500 | `server_error` | Something failed on our side. Try again shortly. |
