{
  "openapi": "3.1.0",
  "info": {
    "title": "Repp API",
    "version": "2.0.0",
    "description": "Repp's REST API: the public index of trainers, open classes and spaces, and your account's calendar, requests, spaces and bookings. Version 2 adds actions (posting a request, offering on a class, answering a space request, stars, the \"looking for work\" switch), for a key made as \"read and actions\". No action pays, charges or books; only declining a space request refunds the trainer, by the site's own rules."
  },
  "externalDocs": {
    "description": "Repp API Reference",
    "url": "https://docs.dev.repp.co.il/"
  },
  "servers": [
    {
      "url": "https://api.dev.repp.co.il"
    }
  ],
  "tags": [
    {
      "name": "General"
    },
    {
      "name": "Trainers"
    },
    {
      "name": "Open classes"
    },
    {
      "name": "Spaces"
    },
    {
      "name": "Calendar"
    },
    {
      "name": "Requests"
    },
    {
      "name": "Bookings"
    },
    {
      "name": "Ratings"
    }
  ],
  "paths": {
    "/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Status",
        "description": "Confirms your key is valid and tells you whose it is: the account's business and its trainer profile.",
        "tags": [
          "General"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                },
                "example": {
                  "business": {
                    "id": "7c1f6a52-3b8e-4d1a-9f0e-2a6b8c4d5e10",
                    "name": "סטודיו נועה"
                  },
                  "trainer": null
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1": {
      "get": {
        "operationId": "getApiIndex",
        "summary": "API root",
        "description": "The API's name and version, and where its documentation and OpenAPI file are.",
        "tags": [
          "General"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiIndex"
                },
                "example": {
                  "name": "Repp API",
                  "version": "2",
                  "docs": "https://docs.repp.co.il/",
                  "openapi": "https://api.repp.co.il/v1/openapi.json"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/catalog": {
      "get": {
        "operationId": "getCatalog",
        "summary": "Catalog",
        "description": "The fixed lists - training styles, regions and days of the week - with their Hebrew names.",
        "tags": [
          "General"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalog"
                },
                "example": {
                  "styles": [
                    {
                      "key": "pilates",
                      "label": "פילאטיס"
                    },
                    {
                      "key": "yoga",
                      "label": "יוגה ומיינדפולנס"
                    }
                  ],
                  "regions": [
                    {
                      "key": "gush_dan",
                      "label": "גוש דן"
                    },
                    {
                      "key": "sharon",
                      "label": "השרון ופתח תקווה"
                    }
                  ],
                  "days": [
                    {
                      "key": 0,
                      "label": "א׳"
                    },
                    {
                      "key": 1,
                      "label": "ב׳"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/waiting": {
      "get": {
        "operationId": "getWaiting",
        "summary": "What waits for me",
        "description": "What waits for the account's own action, as the site's calendar page (\"יומן\") lists it: offers to choose from, space requests to answer, classes to rate.",
        "tags": [
          "General"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Waiting"
                },
                "example": {
                  "business": {
                    "choose_offers": [
                      {
                        "class_id": "a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b",
                        "style": "yoga",
                        "date": "2026-12-01",
                        "time": "18:00",
                        "offers_waiting": 2
                      }
                    ],
                    "send_again": [],
                    "bookings_to_answer": [
                      {
                        "booking_id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
                        "space": {
                          "id": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
                          "name": "מתחם הקומה השנייה"
                        },
                        "trainer_name": "יוסי לוי",
                        "date": "2026-12-02",
                        "start_time": "11:00",
                        "end_time": "13:00",
                        "weekly": true
                      }
                    ],
                    "classes_to_rate": [
                      {
                        "class_id": "a7b8c9d0-e1f2-4a3b-8c4d-5e6f7a8b9c0d",
                        "style": "pilates",
                        "date": "2026-11-27"
                      }
                    ]
                  },
                  "trainer": null
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me/looking-for-work": {
      "put": {
        "operationId": "setLookingForWork",
        "summary": "Looking for work",
        "description": "Turns the trainer's \"looking for work\" switch on or off. On, the trainer is first in the index as \"available now\" and gets word of classes that fit. Needs a key made as \"read and actions\" on the site; a read-only key gets 403 read_only_key. Send an Idempotency-Key header: the same key sent again does nothing and answers the first result. No action pays, charges or books; only declining a space request refunds the trainer, by the site's own rules.",
        "tags": [
          "General"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string up to 200 characters (a UUID is good). The same key sent again with this API key does nothing and answers the first result.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "on": {
                    "description": "`true` to turn it on, `false` to turn it off.",
                    "type": "boolean"
                  }
                },
                "required": [
                  "on"
                ]
              },
              "example": {
                "on": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookingForWork"
                },
                "example": {
                  "looking_for_work": true,
                  "since": "2026-11-29T08:15:00+00:00"
                }
              }
            }
          },
          "400": {
            "description": "bad_body: The request body is not a JSON object (or a field in it is missing or malformed). The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "read_only_key: The key only reads. Actions need a key made with \"read and actions\" (or an app signed in with the scope repp.write). not_a_trainer: The endpoint is for trainers and the key's account has no trainer profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_conflict: The Idempotency-Key was already used by this key for a different action. action_refused: The site's own rules refused the action; `reason` says which (for example class_not_available, already_offered, booking_not_available).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_actions: The key ran 200 actions in the last 24 hours. Reads still work. too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trainers": {
      "get": {
        "operationId": "listTrainers",
        "summary": "Trainers",
        "description": "The trainers in the public index: available now first, then verified, then those who switched on most recently, then the newest profiles.",
        "tags": [
          "Trainers"
        ],
        "security": [],
        "parameters": [
          {
            "name": "style",
            "in": "query",
            "required": false,
            "description": "Only this style.",
            "schema": {
              "type": "string",
              "enum": [
                "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"
              ]
            },
            "example": "yoga"
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Only this region.",
            "schema": {
              "type": "string",
              "enum": [
                "gush_dan",
                "shfela",
                "sharon",
                "haifa",
                "jerusalem",
                "north",
                "south",
                "judea_samaria"
              ]
            },
            "example": "gush_dan"
          },
          {
            "name": "available",
            "in": "query",
            "required": false,
            "description": "Only trainers whose \"looking for work\" switch is on.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1 to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 60
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "How many to skip from the start (for the next page), up to 5000.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 5000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainerPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b",
                      "name": "דנה כהן",
                      "photo_url": "https://example.supabase.co/storage/v1/object/public/avatars/3f2b9c1e/photo.webp",
                      "styles": [
                        "yoga",
                        "pilates"
                      ],
                      "regions": [
                        "gush_dan"
                      ],
                      "rating": {
                        "average": 4.8,
                        "count": 12
                      },
                      "verified": true,
                      "available_now": true
                    }
                  ],
                  "more": false
                }
              }
            }
          },
          "400": {
            "description": "bad_parameter: A parameter is not one the endpoint accepts. The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trainers/{id}": {
      "get": {
        "operationId": "getTrainer",
        "summary": "One trainer",
        "description": "One trainer from the public index. `404` when the trainer is not (or no longer) in it.",
        "tags": [
          "Trainers"
        ],
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The trainer's id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trainer"
                },
                "example": {
                  "id": "3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b",
                  "name": "דנה כהן",
                  "photo_url": "https://example.supabase.co/storage/v1/object/public/avatars/3f2b9c1e/photo.webp",
                  "styles": [
                    "yoga",
                    "pilates"
                  ],
                  "regions": [
                    "gush_dan"
                  ],
                  "rating": {
                    "average": 4.8,
                    "count": 12
                  },
                  "verified": true,
                  "available_now": true
                }
              }
            }
          },
          "404": {
            "description": "not_found: No such endpoint, or no such item for this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/open-classes": {
      "get": {
        "operationId": "listOpenClasses",
        "summary": "Open classes",
        "description": "Classes still looking for a trainer and open to everyone who fits, soonest first.",
        "tags": [
          "Open classes"
        ],
        "security": [],
        "parameters": [
          {
            "name": "style",
            "in": "query",
            "required": false,
            "description": "Only this style.",
            "schema": {
              "type": "string",
              "enum": [
                "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"
              ]
            },
            "example": "yoga"
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Only this region.",
            "schema": {
              "type": "string",
              "enum": [
                "gush_dan",
                "shfela",
                "sharon",
                "haifa",
                "jerusalem",
                "north",
                "south",
                "judea_samaria"
              ]
            },
            "example": "gush_dan"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1 to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 60
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "How many to skip from the start (for the next page), up to 5000.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 5000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenClassPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b",
                      "style": "yoga",
                      "date": "2026-12-01",
                      "time": "18:00",
                      "starts_at": "2026-12-01T16:00:00+00:00",
                      "duration_minutes": 60,
                      "pay": 180,
                      "region": "gush_dan",
                      "city": "רמת גן",
                      "business": {
                        "id": "7c1f6a52-3b8e-4d1a-9f0e-2a6b8c4d5e10",
                        "name": "סטודיו נועה",
                        "photo_url": null
                      }
                    }
                  ],
                  "more": true
                }
              }
            }
          },
          "400": {
            "description": "bad_parameter: A parameter is not one the endpoint accepts. The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/open-classes/{id}": {
      "get": {
        "operationId": "getOpenClass",
        "summary": "One open class",
        "description": "One class still looking for a trainer. `404` once it has its trainer, was cancelled or has begun.",
        "tags": [
          "Open classes"
        ],
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The class's id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenClass"
                },
                "example": {
                  "id": "a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b",
                  "style": "yoga",
                  "date": "2026-12-01",
                  "time": "18:00",
                  "starts_at": "2026-12-01T16:00:00+00:00",
                  "duration_minutes": 60,
                  "pay": 180,
                  "region": "gush_dan",
                  "city": "רמת גן",
                  "business": {
                    "id": "7c1f6a52-3b8e-4d1a-9f0e-2a6b8c4d5e10",
                    "name": "סטודיו נועה",
                    "photo_url": null
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found: No such endpoint, or no such item for this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/open-classes/{id}/offer": {
      "post": {
        "operationId": "offerOnClass",
        "summary": "Offer on a class",
        "description": "Offers you, the key's trainer, for an open class. The business then chooses among the offers on the site, and you are told if you were chosen. Needs a key made as \"read and actions\" on the site; a read-only key gets 403 read_only_key. Send an Idempotency-Key header: the same key sent again does nothing and answers the first result. No action pays, charges or books; only declining a space request refunds the trainer, by the site's own rules.",
        "tags": [
          "Open classes"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The class's id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string up to 200 characters (a UUID is good). The same key sent again with this API key does nothing and answers the first result.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OfferPlaced"
                },
                "example": {
                  "offer_id": "f6a7b8c9-d0e1-4f2a-8b3c-4d5e6f7a8b9c",
                  "class_id": "a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b",
                  "status": "pending",
                  "offered_at": "2026-11-29T08:02:00+00:00"
                }
              }
            }
          },
          "400": {
            "description": "bad_body: The request body is not a JSON object (or a field in it is missing or malformed). The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "read_only_key: The key only reads. Actions need a key made with \"read and actions\" (or an app signed in with the scope repp.write). not_a_trainer: The endpoint is for trainers and the key's account has no trainer profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found: No such endpoint, or no such item for this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_conflict: The Idempotency-Key was already used by this key for a different action. action_refused: The site's own rules refused the action; `reason` says which (for example class_not_available, already_offered, booking_not_available).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_actions: The key ran 200 actions in the last 24 hours. Reads still work. too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "withdrawOffer",
        "summary": "Take an offer back",
        "description": "Takes back your offer on a class while the business has not chosen anyone. It costs nothing, as on the site. Needs a key made as \"read and actions\" on the site; a read-only key gets 403 read_only_key. Send an Idempotency-Key header: the same key sent again does nothing and answers the first result. No action pays, charges or books; only declining a space request refunds the trainer, by the site's own rules.",
        "tags": [
          "Open classes"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The class's id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string up to 200 characters (a UUID is good). The same key sent again with this API key does nothing and answers the first result.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OfferWithdrawn"
                },
                "example": {
                  "offer_id": "f6a7b8c9-d0e1-4f2a-8b3c-4d5e6f7a8b9c",
                  "class_id": "a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b",
                  "status": "withdrawn"
                }
              }
            }
          },
          "400": {
            "description": "bad_body: The request body is not a JSON object (or a field in it is missing or malformed). The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "read_only_key: The key only reads. Actions need a key made with \"read and actions\" (or an app signed in with the scope repp.write). not_a_trainer: The endpoint is for trainers and the key's account has no trainer profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found: No such endpoint, or no such item for this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_conflict: The Idempotency-Key was already used by this key for a different action. action_refused: The site's own rules refused the action; `reason` says which (for example class_not_available, already_offered, booking_not_available).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_actions: The key ran 200 actions in the last 24 hours. Reads still work. too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces": {
      "get": {
        "operationId": "listSpaces",
        "summary": "Spaces",
        "description": "Spaces for rent by the hour, newest first.",
        "tags": [
          "Spaces"
        ],
        "security": [],
        "parameters": [
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Only this region.",
            "schema": {
              "type": "string",
              "enum": [
                "gush_dan",
                "shfela",
                "sharon",
                "haifa",
                "jerusalem",
                "north",
                "south",
                "judea_samaria"
              ]
            },
            "example": "gush_dan"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1 to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 60
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "How many to skip from the start (for the next page), up to 5000.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 5000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpacePage"
                },
                "example": {
                  "items": [
                    {
                      "id": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
                      "name": "מתחם הקומה השנייה",
                      "photo_url": null,
                      "region": "gush_dan",
                      "city": "רמת גן",
                      "price_per_hour": 90,
                      "capacity": 12,
                      "days": [
                        0,
                        1,
                        2,
                        3,
                        4
                      ],
                      "open_from": "11:00",
                      "open_to": "16:00",
                      "business": {
                        "id": "7c1f6a52-3b8e-4d1a-9f0e-2a6b8c4d5e10",
                        "name": "סטודיו נועה",
                        "photo_url": null
                      }
                    }
                  ],
                  "more": false
                }
              }
            }
          },
          "400": {
            "description": "bad_parameter: A parameter is not one the endpoint accepts. The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}": {
      "get": {
        "operationId": "getSpace",
        "summary": "One space",
        "description": "One space for rent. `404` once it is no longer rented out.",
        "tags": [
          "Spaces"
        ],
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The space's id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Space"
                },
                "example": {
                  "id": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
                  "name": "מתחם הקומה השנייה",
                  "photo_url": null,
                  "region": "gush_dan",
                  "city": "רמת גן",
                  "price_per_hour": 90,
                  "capacity": 12,
                  "days": [
                    0,
                    1,
                    2,
                    3,
                    4
                  ],
                  "open_from": "11:00",
                  "open_to": "16:00",
                  "business": {
                    "id": "7c1f6a52-3b8e-4d1a-9f0e-2a6b8c4d5e10",
                    "name": "סטודיו נועה",
                    "photo_url": null
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found: No such endpoint, or no such item for this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/free-spaces": {
      "get": {
        "operationId": "listFreeSpaces",
        "summary": "Free hours",
        "description": "The spaces with an hour still free on a day (at an hour, when you give one), each with its free hours.",
        "tags": [
          "Spaces"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "The day, from today to a year ahead.",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2026-12-02"
          },
          {
            "name": "hour",
            "in": "query",
            "required": false,
            "description": "Only spaces free at this hour, 0 to 23 (11 = 11:00-12:00).",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 23
            },
            "example": "11"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeSpaces"
                },
                "example": {
                  "items": [
                    {
                      "space": {
                        "id": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
                        "name": "מתחם הקומה השנייה",
                        "photo_url": null,
                        "region": "gush_dan",
                        "city": "רמת גן",
                        "price_per_hour": 90,
                        "capacity": 12,
                        "days": [
                          0,
                          1,
                          2,
                          3,
                          4
                        ],
                        "open_from": "11:00",
                        "open_to": "16:00",
                        "business": {
                          "id": "7c1f6a52-3b8e-4d1a-9f0e-2a6b8c4d5e10",
                          "name": "סטודיו נועה",
                          "photo_url": null
                        }
                      },
                      "free_hours": [
                        11,
                        12,
                        14,
                        15
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "bad_parameter: A parameter is not one the endpoint accepts. The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/my-spaces": {
      "get": {
        "operationId": "listMySpaces",
        "summary": "My spaces",
        "description": "The business's own spaces, paused ones too, with their address, hours and how they are booked.",
        "tags": [
          "Spaces"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MySpaces"
                },
                "example": {
                  "items": [
                    {
                      "id": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
                      "name": "מתחם הקומה השנייה",
                      "active": true,
                      "price_per_hour": 90,
                      "capacity": 12,
                      "days": [
                        0,
                        1,
                        2,
                        3,
                        4
                      ],
                      "open_from": "11:00",
                      "open_to": "16:00",
                      "region": "gush_dan",
                      "address": "ביאליק 20, רמת גן",
                      "booking_mode": "approval",
                      "cancel_policy": "regular"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "not_a_business: The endpoint is for businesses and the key's account has none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/calendar": {
      "get": {
        "operationId": "getCalendar",
        "summary": "Calendar",
        "description": "What is in the account's calendar, as the site's own calendar shows it.",
        "tags": [
          "Calendar"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "side",
            "in": "query",
            "required": true,
            "description": "Which side of the account: `business` or `trainer`.",
            "schema": {
              "type": "string",
              "enum": [
                "business",
                "trainer"
              ]
            },
            "example": "business"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "First day, inclusive. Default: today in Israel.",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2026-12-01"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Last day, inclusive. Default: 30 days after `from`.",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2026-12-31"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarEvents"
                },
                "example": {
                  "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
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "bad_parameter: A parameter is not one the endpoint accepts. The message names it. bad_range: `to` is before `from`, or the range is longer than 124 days.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests": {
      "get": {
        "operationId": "listRequests",
        "summary": "Requests",
        "description": "The business's \"need a substitute\" requests from 30 days ago on, soonest first, each with where it stands.",
        "tags": [
          "Requests"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Requests"
                },
                "example": {
                  "items": [
                    {
                      "id": "a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b",
                      "style": "yoga",
                      "date": "2026-12-01",
                      "time": "18:00",
                      "starts_at": "2026-12-01T16:00:00+00:00",
                      "duration_minutes": 60,
                      "pay": 180,
                      "region": "gush_dan",
                      "address": "ביאליק 20, רמת גן",
                      "status": "open",
                      "close_mode": "choose",
                      "cancel_policy": "regular",
                      "offers_waiting": 2,
                      "trainer": null,
                      "invitation": null,
                      "created_at": "2026-11-26T08:12:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "not_a_business: The endpoint is for businesses and the key's account has none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postRequest",
        "summary": "Post a request",
        "description": "Posts a \"need a substitute\" request for the business: trainers who fit are told, offer on it, and the business chooses among them on the site. Needs a key made as \"read and actions\" on the site; a read-only key gets 403 read_only_key. Send an Idempotency-Key header: the same key sent again does nothing and answers the first result. No action pays, charges or books; only declining a space request refunds the trainer, by the site's own rules.",
        "tags": [
          "Requests"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string up to 200 characters (a UUID is good). The same key sent again with this API key does nothing and answers the first result.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "style": {
                    "description": "The class's style: a key of the catalog.",
                    "type": "string",
                    "enum": [
                      "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"
                    ]
                  },
                  "date": {
                    "description": "The day, in Israel.",
                    "type": "string",
                    "format": "date"
                  },
                  "time": {
                    "description": "The start, HH:MM in Israel, 24 hours, on a quarter hour (:00, :15, :30 or :45).",
                    "type": "string",
                    "pattern": "^([01]\\d|2[0-3]):(00|15|30|45)$"
                  },
                  "duration_minutes": {
                    "description": "Length in minutes, one of 30, 45, 60, 75, 90, 120.",
                    "type": "integer",
                    "enum": [
                      30,
                      45,
                      60,
                      75,
                      90,
                      120
                    ],
                    "minimum": 30,
                    "maximum": 120
                  },
                  "pay": {
                    "description": "What the business pays the trainer, in whole shekels, 1 to 5000.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5000
                  },
                  "notes": {
                    "description": "A note for the trainer, up to 300 characters.",
                    "type": "string",
                    "maxLength": 300
                  },
                  "cancel_policy": {
                    "description": "Free cancellation until: `flexible` 2 hours before, `regular` 6 hours before, `strict` 24 hours before.",
                    "type": "string",
                    "enum": [
                      "flexible",
                      "regular",
                      "strict"
                    ],
                    "default": "regular"
                  },
                  "invite_trainer_id": {
                    "description": "Offer it to this trainer first (an id from the index).",
                    "type": "string",
                    "format": "uuid"
                  },
                  "invite_hours": {
                    "description": "How long the invited trainer has to answer: 1, 3 or 12 hours. Needed with `invite_trainer_id`.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12
                  }
                },
                "required": [
                  "style",
                  "date",
                  "time",
                  "duration_minutes",
                  "pay"
                ]
              },
              "example": {
                "style": "yoga",
                "date": "2026-12-03",
                "time": "18:00",
                "duration_minutes": 60,
                "pay": 180,
                "notes": "מזרנים בארון ליד הכניסה",
                "cancel_policy": "regular"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Request"
                },
                "example": {
                  "id": "e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b",
                  "style": "yoga",
                  "date": "2026-12-03",
                  "time": "18:00",
                  "starts_at": "2026-12-03T16:00:00+00:00",
                  "duration_minutes": 60,
                  "pay": 180,
                  "region": "gush_dan",
                  "address": "ביאליק 20, רמת גן",
                  "status": "open",
                  "close_mode": "choose",
                  "cancel_policy": "regular",
                  "offers_waiting": 0,
                  "trainer": null,
                  "invitation": null,
                  "created_at": "2026-11-29T07:40:00+00:00"
                }
              }
            }
          },
          "400": {
            "description": "bad_body: The request body is not a JSON object (or a field in it is missing or malformed). The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "read_only_key: The key only reads. Actions need a key made with \"read and actions\" (or an app signed in with the scope repp.write). not_a_business: The endpoint is for businesses and the key's account has none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_conflict: The Idempotency-Key was already used by this key for a different action. no_place: The business has no saved place yet: it is set once on the site (\"העסק שלי\"). action_refused: The site's own rules refused the action; `reason` says which (for example class_not_available, already_offered, booking_not_available).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_actions: The key ran 200 actions in the last 24 hours. Reads still work. too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{id}": {
      "get": {
        "operationId": "getRequest",
        "summary": "One request",
        "description": "One of the business's requests, with the trainers who offered: name, blue check and rating.",
        "tags": [
          "Requests"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The request's id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestDetail"
                },
                "example": {
                  "id": "a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b",
                  "style": "yoga",
                  "date": "2026-12-01",
                  "time": "18:00",
                  "starts_at": "2026-12-01T16:00:00+00:00",
                  "duration_minutes": 60,
                  "pay": 180,
                  "region": "gush_dan",
                  "address": "ביאליק 20, רמת גן",
                  "status": "open",
                  "close_mode": "choose",
                  "cancel_policy": "regular",
                  "offers_waiting": 2,
                  "trainer": null,
                  "invitation": null,
                  "created_at": "2026-11-26T08:12:00+00:00",
                  "offers": [
                    {
                      "trainer": {
                        "id": "3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b",
                        "name": "דנה כהן",
                        "verified": true,
                        "rating": {
                          "average": 4.8,
                          "count": 12
                        }
                      },
                      "status": "pending",
                      "offered_at": "2026-11-26T09:30:00+00:00"
                    },
                    {
                      "trainer": {
                        "id": "d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a",
                        "name": "עומר ברק",
                        "verified": false,
                        "rating": null
                      },
                      "status": "pending",
                      "offered_at": "2026-11-26T10:05:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "not_a_business: The endpoint is for businesses and the key's account has none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found: No such endpoint, or no such item for this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bookings": {
      "get": {
        "operationId": "listBookings",
        "summary": "Bookings",
        "description": "The account's space bookings from 30 days ago on, soonest first: a business's spaces' bookings, or the trainer's own.",
        "tags": [
          "Bookings"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "side",
            "in": "query",
            "required": true,
            "description": "Which side of the account: `business` or `trainer`.",
            "schema": {
              "type": "string",
              "enum": [
                "business",
                "trainer"
              ]
            },
            "example": "business"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bookings"
                },
                "example": {
                  "items": [
                    {
                      "id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
                      "space": {
                        "id": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
                        "name": "מתחם הקומה השנייה"
                      },
                      "business_name": "סטודיו נועה",
                      "trainer_name": "יוסי לוי",
                      "date": "2026-12-02",
                      "start_time": "11:00",
                      "end_time": "13:00",
                      "weekly": true,
                      "status": "pending",
                      "amount": 180,
                      "created_at": "2026-11-28T19:20:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "bad_parameter: A parameter is not one the endpoint accepts. The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "not_a_business: The endpoint is for businesses and the key's account has none. not_a_trainer: The endpoint is for trainers and the key's account has no trainer profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bookings/{id}/decision": {
      "post": {
        "operationId": "decideBooking",
        "summary": "Answer a space request",
        "description": "Approves or declines a trainer's request to book one of the business's spaces. It charges nothing; a decline returns the trainer's payment by the site's own rules. Needs a key made as \"read and actions\" on the site; a read-only key gets 403 read_only_key. Send an Idempotency-Key header: the same key sent again does nothing and answers the first result. No action pays, charges or books; only declining a space request refunds the trainer, by the site's own rules.",
        "tags": [
          "Bookings"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The booking's id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string up to 200 characters (a UUID is good). The same key sent again with this API key does nothing and answers the first result.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "approve": {
                    "description": "`true` to approve, `false` to decline.",
                    "type": "boolean"
                  }
                },
                "required": [
                  "approve"
                ]
              },
              "example": {
                "approve": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingDecision"
                },
                "example": {
                  "booking_id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
                  "status": "confirmed"
                }
              }
            }
          },
          "400": {
            "description": "bad_body: The request body is not a JSON object (or a field in it is missing or malformed). The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "read_only_key: The key only reads. Actions need a key made with \"read and actions\" (or an app signed in with the scope repp.write). not_a_business: The endpoint is for businesses and the key's account has none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found: No such endpoint, or no such item for this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_conflict: The Idempotency-Key was already used by this key for a different action. action_refused: The site's own rules refused the action; `reason` says which (for example class_not_available, already_offered, booking_not_available).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_actions: The key ran 200 actions in the last 24 hours. Reads still work. too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ratings": {
      "post": {
        "operationId": "rateDeal",
        "summary": "Rate",
        "description": "Gives stars, 1 to 5, to a class or a space booking that is over: a business rates its trainer, a trainer the business. Needs a key made as \"read and actions\" on the site; a read-only key gets 403 read_only_key. Send an Idempotency-Key header: the same key sent again does nothing and answers the first result. No action pays, charges or books; only declining a space request refunds the trainer, by the site's own rules.",
        "tags": [
          "Ratings"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string up to 200 characters (a UUID is good). The same key sent again with this API key does nothing and answers the first result.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "class_id": {
                    "description": "The class to rate. Leave out when rating a booking.",
                    "type": "string",
                    "format": "uuid"
                  },
                  "booking_id": {
                    "description": "The space booking to rate. Leave out when rating a class.",
                    "type": "string",
                    "format": "uuid"
                  },
                  "stars": {
                    "description": "1 to 5.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5
                  }
                },
                "required": [
                  "stars"
                ]
              },
              "example": {
                "class_id": "a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b",
                "stars": 5
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RatingGiven"
                },
                "example": {
                  "class_id": "a4e5f6b7-c8d9-4e0f-8a1b-2c3d4e5f6a7b",
                  "booking_id": null,
                  "stars": 5
                }
              }
            }
          },
          "400": {
            "description": "bad_body: The request body is not a JSON object (or a field in it is missing or malformed). The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing_key: The endpoint needs a key and no Authorization header came. bad_key: The key is not one of ours, was revoked, or its account was closed or blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "read_only_key: The key only reads. Actions need a key made with \"read and actions\" (or an app signed in with the scope repp.write).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_conflict: The Idempotency-Key was already used by this key for a different action. action_refused: The site's own rules refused the action; `reason` says which (for example class_not_available, already_offered, booking_not_available).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_actions: The key ran 200 actions in the last 24 hours. Reads still work. too_many_requests: Over the rate limit. Wait the seconds in `Retry-After` (60) and go on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: Something failed on our side. Try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A personal key, made on the account page of the site (\"מפתחות API\"). Sent as Authorization: Bearer repp_... A key reads; it runs actions only when it was made as \"read and actions\" (\"קריאה ופעולות\"). The key an AI app gets by signing in works for the MCP server only, never here."
      }
    },
    "schemas": {
      "Style": {
        "description": "A training style: one of the keys in Catalog.",
        "type": "string",
        "enum": [
          "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"
        ]
      },
      "Region": {
        "description": "A region of Israel: one of the keys in Catalog.",
        "type": "string",
        "enum": [
          "gush_dan",
          "shfela",
          "sharon",
          "haifa",
          "jerusalem",
          "north",
          "south",
          "judea_samaria"
        ]
      },
      "Rating": {
        "description": "The rating, or null while nobody has rated yet.",
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "average": {
                "type": "number",
                "description": "The average stars, 1 to 5, to two decimals."
              },
              "count": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "How many ratings."
              }
            },
            "required": [
              "average",
              "count"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Business": {
        "description": "A business, as the public index shows it.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "name": {
            "type": "string",
            "description": "The business's name."
          },
          "photo_url": {
            "description": "The business's photo, or null.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "photo_url"
        ],
        "additionalProperties": false
      },
      "Trainer": {
        "description": "A trainer in the public index. Never a phone number or the trainer's free-text about.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "name": {
            "type": "string",
            "description": "The trainer's name."
          },
          "photo_url": {
            "description": "The trainer's photo, or null.",
            "type": [
              "string",
              "null"
            ]
          },
          "styles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Style"
            },
            "description": "The styles the trainer teaches."
          },
          "regions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Region"
            },
            "description": "The regions the trainer works in."
          },
          "rating": {
            "$ref": "#/components/schemas/Rating"
          },
          "verified": {
            "type": "boolean",
            "description": "We checked the trainer's instructor certificate (the blue check)."
          },
          "available_now": {
            "type": "boolean",
            "description": "The trainer's \"looking for work\" switch is on."
          }
        },
        "required": [
          "id",
          "name",
          "photo_url",
          "styles",
          "regions",
          "rating",
          "verified",
          "available_now"
        ],
        "additionalProperties": false
      },
      "OpenClass": {
        "description": "A class still looking for a trainer, open to everyone who fits. No street address.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "style": {
            "$ref": "#/components/schemas/Style"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "A date in Israel, YYYY-MM-DD."
          },
          "time": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "description": "A time of day in Israel, HH:MM, 24 hours."
          },
          "starts_at": {
            "type": "string",
            "description": "An exact moment, ISO 8601 with its offset."
          },
          "duration_minutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Length of the class in minutes."
          },
          "pay": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What the business pays the trainer, in whole shekels."
          },
          "region": {
            "$ref": "#/components/schemas/Region"
          },
          "city": {
            "description": "The town, from our list of towns, or null.",
            "type": [
              "string",
              "null"
            ]
          },
          "business": {
            "$ref": "#/components/schemas/Business"
          }
        },
        "required": [
          "id",
          "style",
          "date",
          "time",
          "starts_at",
          "duration_minutes",
          "pay",
          "region",
          "city",
          "business"
        ],
        "additionalProperties": false
      },
      "Space": {
        "description": "A space for rent by the hour.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "name": {
            "type": "string",
            "description": "The space's name."
          },
          "photo_url": {
            "description": "The space's photo, or null.",
            "type": [
              "string",
              "null"
            ]
          },
          "region": {
            "$ref": "#/components/schemas/Region"
          },
          "city": {
            "description": "The town, from our list of towns, or null.",
            "type": [
              "string",
              "null"
            ]
          },
          "price_per_hour": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Rent for one hour, in whole shekels."
          },
          "capacity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many people fit in it."
          },
          "days": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            },
            "description": "The weekdays it can be rented, 0 = Sunday."
          },
          "open_from": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "description": "Opening time."
          },
          "open_to": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "description": "Closing time."
          },
          "business": {
            "$ref": "#/components/schemas/Business"
          }
        },
        "required": [
          "id",
          "name",
          "photo_url",
          "region",
          "city",
          "price_per_hour",
          "capacity",
          "days",
          "open_from",
          "open_to",
          "business"
        ],
        "additionalProperties": false
      },
      "TrainerPage": {
        "description": "One page of a list.",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Trainer"
            },
            "description": "The items of this page."
          },
          "more": {
            "type": "boolean",
            "description": "There is another page: ask again with a larger offset."
          }
        },
        "required": [
          "items",
          "more"
        ],
        "additionalProperties": false
      },
      "OpenClassPage": {
        "description": "One page of a list.",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OpenClass"
            },
            "description": "The items of this page."
          },
          "more": {
            "type": "boolean",
            "description": "There is another page: ask again with a larger offset."
          }
        },
        "required": [
          "items",
          "more"
        ],
        "additionalProperties": false
      },
      "SpacePage": {
        "description": "One page of a list.",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Space"
            },
            "description": "The items of this page."
          },
          "more": {
            "type": "boolean",
            "description": "There is another page: ask again with a larger offset."
          }
        },
        "required": [
          "items",
          "more"
        ],
        "additionalProperties": false
      },
      "Catalog": {
        "description": "The fixed lists: styles, regions and days.",
        "type": "object",
        "properties": {
          "styles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "The key, as it is sent in parameters."
                },
                "label": {
                  "type": "string",
                  "description": "The name in Hebrew."
                }
              },
              "required": [
                "key",
                "label"
              ],
              "additionalProperties": false
            },
            "description": "Training styles."
          },
          "regions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "The key, as it is sent in parameters."
                },
                "label": {
                  "type": "string",
                  "description": "The name in Hebrew."
                }
              },
              "required": [
                "key",
                "label"
              ],
              "additionalProperties": false
            },
            "description": "Regions."
          },
          "days": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Day number, 0 = Sunday."
                },
                "label": {
                  "type": "string",
                  "description": "The name in Hebrew."
                }
              },
              "required": [
                "key",
                "label"
              ],
              "additionalProperties": false
            },
            "description": "Days of the week."
          }
        },
        "required": [
          "styles",
          "regions",
          "days"
        ],
        "additionalProperties": false
      },
      "Me": {
        "description": "Whose key this is.",
        "type": "object",
        "properties": {
          "business": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Identifier."
                  },
                  "name": {
                    "type": "string",
                    "description": "The business's name."
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The account's business, or null."
          },
          "trainer": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Identifier."
                  },
                  "name": {
                    "type": "string",
                    "description": "The trainer's full name."
                  },
                  "listed": {
                    "type": "boolean",
                    "description": "The profile is complete and shown in the index."
                  },
                  "looking_for_work": {
                    "type": "boolean",
                    "description": "The \"looking for work\" switch is on."
                  },
                  "verified": {
                    "type": "boolean",
                    "description": "Has the blue check."
                  }
                },
                "required": [
                  "id",
                  "name",
                  "listed",
                  "looking_for_work",
                  "verified"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The account's trainer profile, or null."
          }
        },
        "required": [
          "business",
          "trainer"
        ],
        "additionalProperties": false
      },
      "CalendarEvent": {
        "description": "Something in the calendar.",
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "class",
              "booking"
            ],
            "description": "class: a class. booking: a space booking."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "filled",
              "offered",
              "pending",
              "confirmed"
            ],
            "description": "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."
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "A date in Israel, YYYY-MM-DD."
          },
          "start_time": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "description": "A time of day in Israel, HH:MM, 24 hours."
          },
          "end_time": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "description": "End time. Past midnight it is a time of the next day; ends_at is exact."
          },
          "starts_at": {
            "type": "string",
            "description": "An exact moment, ISO 8601 with its offset."
          },
          "ends_at": {
            "type": "string",
            "description": "An exact moment, ISO 8601 with its offset."
          },
          "style": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Style"
              },
              {
                "type": "null"
              }
            ],
            "description": "The class's style, or null for a booking."
          },
          "space": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Identifier."
                  },
                  "name": {
                    "type": "string",
                    "description": "The space's name."
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The space, or null for a class."
          },
          "business_name": {
            "type": "string",
            "description": "The business's name."
          },
          "other_name": {
            "description": "The other side: the trainer (for a business) or the business (for a trainer), or null while there is none.",
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": "string",
            "description": "The address."
          },
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The deal's amount, in whole shekels."
          },
          "weekly": {
            "type": "boolean",
            "description": "Part of a weekly booking."
          }
        },
        "required": [
          "kind",
          "id",
          "state",
          "date",
          "start_time",
          "end_time",
          "starts_at",
          "ends_at",
          "style",
          "space",
          "business_name",
          "other_name",
          "address",
          "amount",
          "weekly"
        ],
        "additionalProperties": false
      },
      "CalendarEvents": {
        "description": "The calendar in the range you asked for.",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarEvent"
            },
            "description": "In order of time."
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "Request": {
        "description": "One of the business's \"need a substitute\" requests.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "style": {
            "$ref": "#/components/schemas/Style"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "A date in Israel, YYYY-MM-DD."
          },
          "time": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "description": "A time of day in Israel, HH:MM, 24 hours."
          },
          "starts_at": {
            "type": "string",
            "description": "An exact moment, ISO 8601 with its offset."
          },
          "duration_minutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Length of the class in minutes."
          },
          "pay": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What the business pays the trainer."
          },
          "region": {
            "$ref": "#/components/schemas/Region"
          },
          "address": {
            "type": "string",
            "description": "The address."
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "filled",
              "missed"
            ],
            "description": "open: looking for a trainer. filled: a trainer was chosen and paid. missed: it began and no trainer was found."
          },
          "close_mode": {
            "type": "string",
            "enum": [
              "choose",
              "first"
            ],
            "description": "choose: the business chooses among offers. first: the first trainer to accept takes it."
          },
          "cancel_policy": {
            "type": "string",
            "enum": [
              "flexible",
              "regular",
              "strict"
            ],
            "description": "Free cancellation until: flexible 2 hours before, regular 6 hours before, strict 24 hours before."
          },
          "offers_waiting": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many offers wait for a choice."
          },
          "trainer": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Identifier."
                  },
                  "name": {
                    "type": "string",
                    "description": "The trainer's name."
                  },
                  "verified": {
                    "type": "boolean",
                    "description": "Has the blue check."
                  }
                },
                "required": [
                  "id",
                  "name",
                  "verified"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The chosen trainer, or null."
          },
          "invitation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "trainer_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Identifier."
                  },
                  "trainer_name": {
                    "description": "The invited trainer's name.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "waiting",
                      "accepted",
                      "declined",
                      "expired"
                    ],
                    "description": "waiting: no answer yet. accepted, declined. expired: the window ran out."
                  },
                  "until": {
                    "type": "string",
                    "description": "When the invitation runs out."
                  }
                },
                "required": [
                  "trainer_id",
                  "trainer_name",
                  "state",
                  "until"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "A direct invitation to one trainer, or null when the request is open to everyone."
          },
          "created_at": {
            "type": "string",
            "description": "An exact moment, ISO 8601 with its offset."
          }
        },
        "required": [
          "id",
          "style",
          "date",
          "time",
          "starts_at",
          "duration_minutes",
          "pay",
          "region",
          "address",
          "status",
          "close_mode",
          "cancel_policy",
          "offers_waiting",
          "trainer",
          "invitation",
          "created_at"
        ],
        "additionalProperties": false
      },
      "Offer": {
        "description": "A trainer's offer on a request.",
        "type": "object",
        "properties": {
          "trainer": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                "description": "Identifier."
              },
              "name": {
                "type": "string",
                "description": "The trainer's name."
              },
              "verified": {
                "type": "boolean",
                "description": "Has the blue check."
              },
              "rating": {
                "$ref": "#/components/schemas/Rating"
              }
            },
            "required": [
              "id",
              "name",
              "verified",
              "rating"
            ],
            "additionalProperties": false,
            "description": "The trainer who offered. The API never sends a phone number."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "chosen"
            ],
            "description": "pending: waits for a choice. chosen: chosen."
          },
          "offered_at": {
            "type": "string",
            "description": "An exact moment, ISO 8601 with its offset."
          }
        },
        "required": [
          "trainer",
          "status",
          "offered_at"
        ],
        "additionalProperties": false
      },
      "RequestDetail": {
        "description": "One request with its offers.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "style": {
            "$ref": "#/components/schemas/Style"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "A date in Israel, YYYY-MM-DD."
          },
          "time": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "description": "A time of day in Israel, HH:MM, 24 hours."
          },
          "starts_at": {
            "type": "string",
            "description": "An exact moment, ISO 8601 with its offset."
          },
          "duration_minutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Length of the class in minutes."
          },
          "pay": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "What the business pays the trainer."
          },
          "region": {
            "$ref": "#/components/schemas/Region"
          },
          "address": {
            "type": "string",
            "description": "The address."
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "filled",
              "missed"
            ],
            "description": "open: looking for a trainer. filled: a trainer was chosen and paid. missed: it began and no trainer was found."
          },
          "close_mode": {
            "type": "string",
            "enum": [
              "choose",
              "first"
            ],
            "description": "choose: the business chooses among offers. first: the first trainer to accept takes it."
          },
          "cancel_policy": {
            "type": "string",
            "enum": [
              "flexible",
              "regular",
              "strict"
            ],
            "description": "Free cancellation until: flexible 2 hours before, regular 6 hours before, strict 24 hours before."
          },
          "offers_waiting": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many offers wait for a choice."
          },
          "trainer": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Identifier."
                  },
                  "name": {
                    "type": "string",
                    "description": "The trainer's name."
                  },
                  "verified": {
                    "type": "boolean",
                    "description": "Has the blue check."
                  }
                },
                "required": [
                  "id",
                  "name",
                  "verified"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The chosen trainer, or null."
          },
          "invitation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "trainer_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "Identifier."
                  },
                  "trainer_name": {
                    "description": "The invited trainer's name.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "waiting",
                      "accepted",
                      "declined",
                      "expired"
                    ],
                    "description": "waiting: no answer yet. accepted, declined. expired: the window ran out."
                  },
                  "until": {
                    "type": "string",
                    "description": "When the invitation runs out."
                  }
                },
                "required": [
                  "trainer_id",
                  "trainer_name",
                  "state",
                  "until"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "A direct invitation to one trainer, or null when the request is open to everyone."
          },
          "created_at": {
            "type": "string",
            "description": "An exact moment, ISO 8601 with its offset."
          },
          "offers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Offer"
            },
            "description": "The offers, oldest first."
          }
        },
        "required": [
          "id",
          "style",
          "date",
          "time",
          "starts_at",
          "duration_minutes",
          "pay",
          "region",
          "address",
          "status",
          "close_mode",
          "cancel_policy",
          "offers_waiting",
          "trainer",
          "invitation",
          "created_at",
          "offers"
        ],
        "additionalProperties": false
      },
      "Requests": {
        "description": "The business's requests.",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Request"
            },
            "description": "From 30 days ago on, soonest first."
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "OfferPlaced": {
        "description": "Your offer on an open class, as it now stands.",
        "type": "object",
        "properties": {
          "offer_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "class_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending"
            ],
            "description": "pending: waits for the business to choose."
          },
          "offered_at": {
            "type": "string",
            "description": "An exact moment, ISO 8601 with its offset."
          }
        },
        "required": [
          "offer_id",
          "class_id",
          "status",
          "offered_at"
        ],
        "additionalProperties": false
      },
      "OfferWithdrawn": {
        "description": "Your offer, taken back before anyone was chosen.",
        "type": "object",
        "properties": {
          "offer_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "class_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "status": {
            "type": "string",
            "enum": [
              "withdrawn"
            ],
            "description": "withdrawn: taken back."
          }
        },
        "required": [
          "offer_id",
          "class_id",
          "status"
        ],
        "additionalProperties": false
      },
      "BookingDecision": {
        "description": "Your answer to a space request.",
        "type": "object",
        "properties": {
          "booking_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "declined"
            ],
            "description": "confirmed: you approved it. declined: you declined it, and the trainer's money went back by the site's rules."
          }
        },
        "required": [
          "booking_id",
          "status"
        ],
        "additionalProperties": false
      },
      "RatingGiven": {
        "description": "The stars you gave a class or a booking that is over.",
        "type": "object",
        "properties": {
          "class_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                "description": "Identifier."
              },
              {
                "type": "null"
              }
            ],
            "description": "The class you rated, or null."
          },
          "booking_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                "description": "Identifier."
              },
              {
                "type": "null"
              }
            ],
            "description": "The booking you rated, or null."
          },
          "stars": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5,
            "description": "The stars you gave, 1 to 5."
          }
        },
        "required": [
          "class_id",
          "booking_id",
          "stars"
        ],
        "additionalProperties": false
      },
      "LookingForWork": {
        "description": "The trainer's \"looking for work\" switch.",
        "type": "object",
        "properties": {
          "looking_for_work": {
            "type": "boolean",
            "description": "The \"looking for work\" switch is on."
          },
          "since": {
            "anyOf": [
              {
                "type": "string",
                "description": "An exact moment, ISO 8601 with its offset."
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was switched on, or null while it is off."
          }
        },
        "required": [
          "looking_for_work",
          "since"
        ],
        "additionalProperties": false
      },
      "FreeSpace": {
        "description": "A space with hours still free on the day you asked for.",
        "type": "object",
        "properties": {
          "space": {
            "$ref": "#/components/schemas/Space"
          },
          "free_hours": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 23
            },
            "description": "The hours still free that day, each the start of one hour (11 = 11:00-12:00), in order."
          }
        },
        "required": [
          "space",
          "free_hours"
        ],
        "additionalProperties": false
      },
      "FreeSpaces": {
        "description": "Spaces with free hours on one day.",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FreeSpace"
            },
            "description": "The spaces with an hour still free that day."
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "Waiting": {
        "description": "What waits for the account's own action, as the site's \"יומן\" lists it.",
        "type": "object",
        "properties": {
          "business": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "choose_offers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "class_id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                          "description": "Identifier."
                        },
                        "style": {
                          "$ref": "#/components/schemas/Style"
                        },
                        "date": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                          "description": "A date in Israel, YYYY-MM-DD."
                        },
                        "time": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$",
                          "description": "A time of day in Israel, HH:MM, 24 hours."
                        },
                        "offers_waiting": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "How many offers wait for your choice."
                        }
                      },
                      "required": [
                        "class_id",
                        "style",
                        "date",
                        "time",
                        "offers_waiting"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Requests ahead with offers to choose from (choosing pays, so it is done on the site)."
                  },
                  "send_again": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "class_id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                          "description": "Identifier."
                        },
                        "style": {
                          "$ref": "#/components/schemas/Style"
                        },
                        "date": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                          "description": "A date in Israel, YYYY-MM-DD."
                        },
                        "time": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$",
                          "description": "A time of day in Israel, HH:MM, 24 hours."
                        }
                      },
                      "required": [
                        "class_id",
                        "style",
                        "date",
                        "time"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Requests whose invitation to one trainer was declined or ran out: open them to everyone or invite another, on the site."
                  },
                  "bookings_to_answer": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "booking_id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                          "description": "Identifier."
                        },
                        "space": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                              "description": "Identifier."
                            },
                            "name": {
                              "type": "string",
                              "description": "The space's name."
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false,
                          "description": "The space."
                        },
                        "trainer_name": {
                          "description": "The trainer who asked.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "date": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                          "description": "A date in Israel, YYYY-MM-DD."
                        },
                        "start_time": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$",
                          "description": "A time of day in Israel, HH:MM, 24 hours."
                        },
                        "end_time": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$",
                          "description": "A time of day in Israel, HH:MM, 24 hours."
                        },
                        "weekly": {
                          "type": "boolean",
                          "description": "A weekly booking."
                        }
                      },
                      "required": [
                        "booking_id",
                        "space",
                        "trainer_name",
                        "date",
                        "start_time",
                        "end_time",
                        "weekly"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Space requests waiting for your yes: answer with POST /v1/bookings/{id}/decision."
                  },
                  "classes_to_rate": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "class_id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                          "description": "Identifier."
                        },
                        "style": {
                          "$ref": "#/components/schemas/Style"
                        },
                        "date": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                          "description": "A date in Israel, YYYY-MM-DD."
                        }
                      },
                      "required": [
                        "class_id",
                        "style",
                        "date"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Classes of the last 7 days waiting for your stars: POST /v1/ratings."
                  }
                },
                "required": [
                  "choose_offers",
                  "send_again",
                  "bookings_to_answer",
                  "classes_to_rate"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "What waits for the business, or null when the account has none."
          },
          "trainer": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "classes_to_rate": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "class_id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                          "description": "Identifier."
                        },
                        "style": {
                          "$ref": "#/components/schemas/Style"
                        },
                        "date": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                          "description": "A date in Israel, YYYY-MM-DD."
                        }
                      },
                      "required": [
                        "class_id",
                        "style",
                        "date"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Classes of the last 7 days waiting for your stars: POST /v1/ratings."
                  },
                  "reports_to_answer": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "class_id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                          "description": "Identifier."
                        },
                        "reported_at": {
                          "type": "string",
                          "description": "An exact moment, ISO 8601 with its offset."
                        }
                      },
                      "required": [
                        "class_id",
                        "reported_at"
                      ],
                      "additionalProperties": false
                    },
                    "description": "A business reported you did not come: answer on the site."
                  },
                  "offers_waiting": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Your offers still waiting for a business's choice (nothing to do)."
                  },
                  "upcoming_classes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Classes ahead you were chosen for (nothing to do)."
                  }
                },
                "required": [
                  "classes_to_rate",
                  "reports_to_answer",
                  "offers_waiting",
                  "upcoming_classes"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "What waits for the trainer, or null when the account has no trainer profile."
          }
        },
        "required": [
          "business",
          "trainer"
        ],
        "additionalProperties": false
      },
      "MySpace": {
        "description": "One of the business's own spaces.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "name": {
            "type": "string",
            "description": "The space's name."
          },
          "active": {
            "type": "boolean",
            "description": "Open for rent. A paused space is not in the index."
          },
          "price_per_hour": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Rent for one hour, in whole shekels."
          },
          "capacity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many people fit in it."
          },
          "days": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            },
            "description": "The weekdays it can be rented, 0 = Sunday."
          },
          "open_from": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "description": "Opening time."
          },
          "open_to": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "description": "Closing time."
          },
          "region": {
            "$ref": "#/components/schemas/Region"
          },
          "address": {
            "type": "string",
            "description": "The address."
          },
          "booking_mode": {
            "type": "string",
            "enum": [
              "instant",
              "approval"
            ],
            "description": "instant: a booking is confirmed at once. approval: it waits for your yes."
          },
          "cancel_policy": {
            "type": "string",
            "enum": [
              "flexible",
              "regular",
              "strict"
            ],
            "description": "Free cancellation until: flexible 2 hours before, regular 6 hours before, strict 24 hours before."
          }
        },
        "required": [
          "id",
          "name",
          "active",
          "price_per_hour",
          "capacity",
          "days",
          "open_from",
          "open_to",
          "region",
          "address",
          "booking_mode",
          "cancel_policy"
        ],
        "additionalProperties": false
      },
      "MySpaces": {
        "description": "The business's spaces.",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MySpace"
            },
            "description": "Every space of the business, paused ones too, oldest first."
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "Booking": {
        "description": "A space booking.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Identifier."
          },
          "space": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                "description": "Identifier."
              },
              "name": {
                "type": "string",
                "description": "The space's name."
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false,
            "description": "The space."
          },
          "business_name": {
            "type": "string",
            "description": "The business whose space it is."
          },
          "trainer_name": {
            "description": "The trainer who booked (for a business), or null.",
            "type": [
              "string",
              "null"
            ]
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "A date in Israel, YYYY-MM-DD."
          },
          "start_time": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "description": "A time of day in Israel, HH:MM, 24 hours."
          },
          "end_time": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "description": "A time of day in Israel, HH:MM, 24 hours."
          },
          "weekly": {
            "type": "boolean",
            "description": "Part of a weekly booking: the same hour every week."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "confirmed",
              "declined",
              "cancelled"
            ],
            "description": "pending: waits for the business's yes. confirmed. declined: the business said no or it ran out. cancelled."
          },
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The rent for these hours, in whole shekels."
          },
          "created_at": {
            "type": "string",
            "description": "An exact moment, ISO 8601 with its offset."
          }
        },
        "required": [
          "id",
          "space",
          "business_name",
          "trainer_name",
          "date",
          "start_time",
          "end_time",
          "weekly",
          "status",
          "amount",
          "created_at"
        ],
        "additionalProperties": false
      },
      "Bookings": {
        "description": "The account's space bookings.",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Booking"
            },
            "description": "From 30 days ago on, soonest first."
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "Error": {
        "description": "Every error answer.",
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "A fixed code in English, for your code."
              },
              "reason": {
                "description": "For action_refused only: the site's own refusal, a fixed snake_case word (class_not_available, already_offered…).",
                "type": "string"
              },
              "message": {
                "type": "string",
                "description": "A short line in Hebrew, for people."
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "ApiIndex": {
        "description": "What is here.",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name."
          },
          "version": {
            "type": "string",
            "description": "The version."
          },
          "docs": {
            "type": "string",
            "description": "Where the documentation is."
          },
          "openapi": {
            "type": "string",
            "description": "Where the OpenAPI file is."
          }
        },
        "required": [
          "name",
          "version",
          "docs",
          "openapi"
        ],
        "additionalProperties": false
      }
    }
  }
}