# Getting started

## Intended use

The YOGO API is available as an add-on to all customers on the **Studio**
and **Studio+App** plans. Clients without an appropriate plan receive a
`403 Forbidden` response even with a valid API key.

You can use it to extract data into your own systems, or to integrate with
third-party services. Examples include:

- Exporting customer data to your CRM or email marketing platform
- Analyzing booking and attendance data in your BI tools
- Showing your schedule, courses and events on your own website
- Looking up a customer's memberships and passes from another system
- Managing teacher schedules by assigning teachers to classes from an external scheduler


## Base URL

The API is available at:

```
https://api.yogobooking.com
```

All endpoints in the API reference (see the sidebar) should be prefixed
with this base URL. For example:

```
GET https://api.yogobooking.com/customers
```

## Quick start

1. Get an API key from your YOGO admin module (Settings → API keys).
2. Authenticate every request with the [`X-API-KEY` header](/guides/authentication).
3. List endpoints use [cursor-based pagination](/guides/pagination).
4. Be aware of the [rate limits](/guides/rate-limiting) — 100 requests per minute
per client.


A minimal first call:

```bash
curl https://api.yogobooking.com/customers \
  -H "X-API-KEY: your_api_key_here"
```

## What's in the API

Every resource can be listed (`GET /resource`) and retrieved by id
(`GET /resource/{id}`); the one write operation is replacing a class's
teachers. One naming convention is worth learning up front: `…-types`
endpoints are the **products a studio offers** — the catalog — while their
unsuffixed counterparts are **what a customer actually has**.

| The studio's catalog | What a customer has |
|  --- | --- |
| `/membership-types` — recurring membership products, with their payment options | `/memberships` — a customer's membership: status, next payment, cancellation dates |
| `/class-pass-types` — punch cards and time-based passes | `/class-passes` — a customer's pass: classes left, validity window |
| `/class-series-types` — courses, including their scheduled classes | `/class-series` — a customer's course enrollment and its rebooking credit |


Around the catalog:

- `/customers` — the studio's customers
- `/teachers` — users with the teacher role
- `/classes` — the scheduled classes, and `/bookings` — who is booked on them
- `/events` — one-off events and workshops, and `/event-registrations` — who is registered
- `/orders` — purchases and invoices
- `/write-logs` — an audit log of every write your API keys have made


## Date and time inputs

Endpoints that take a `from`/`to` date range (`/bookings`, `/classes`,
`/events`, `/write-logs`) accept three input shapes:

| Format | Example | Interpretation |
|  --- | --- | --- |
| Keyword | `today`, `yesterday`, `tomorrow` | Calendar day in the studio timezone. `from` rounds to start-of-day; `to` to end-of-day. |
| Keyword offset | `+14d`, `-7d`, `+1w`, `-2w`, `+1m`, `-3m` | Calendar offset from today. Bounded to roughly ±2 years; for ranges further out use an explicit ISO date. |
| Date-only | `2026-05-15` | Calendar day in the studio timezone, rounded to start- or end-of-day. |
| Full ISO datetime | `2026-05-15T10:00:00+02:00`, `2026-05-15T08:00:00Z` | Used as-is when an offset is present; interpreted in the studio timezone otherwise. |


A typical "show me classes for the next two weeks" request:

```bash
curl 'https://api.yogobooking.com/classes?from=today&to=%2B14d' \
  -H "X-API-KEY: your_api_key_here"
```

(Note `%2B` is the URL-encoded `+`. In a JSON body, scripted call, or
client SDK you can pass `+14d` literally.)

Offsets are calendar-aware — `+1m` is "the same day-of-month next month",
not 30 days.