Page Introduction

Foundational API rules

Fundamentals defines baseline API behavior, canonical route usage, lifecycle order, and ownership/auth constraints.

  • Use this as policy baseline for frontend API clients.
  • Treat canonical routes as implementation default.
  • Use legacy aliases only for controlled migration fallback.

Documentation

Fundamentals (Canonical)

The core principles below are extracted from `WORKSHOP-API-CANONICAL.md` and govern the Workshop documentation model.

Scope and base paths

Workshop API uses `/api/ws` as the primary base path, with one core-shared endpoint under `/api/core` as part of the workshop flow.

Canonical Policy

Only canonical routes should be used for new integrations. Alias/legacy routes are temporary fallback for backward compatibility.

Ownership flow (3 steps)

Ownership flow is defined as `/shop/add` -> `/shop/add/confirm` -> `/shop/add/confirm-ownership` with explicit validation and TTL rules.

Auth Contract

Primary auth is bearer token. `sign-up` and `sign-in` additionally require `x-api-key` based on canonical rules.

Booking status model

Status engine uses 6 statuses with allowed transitions and terminal immutability: `COMPLETED`, `DECLINED`, `CANCELLED`.

Category rules

A workshop must always keep at least one primary category. Removal is blocked when a category is used by services.

Service records window

Default records window is 60 days, with `load_more=true` in +30 day increments and export in `csv`/`xlsx`.

Integration Order

Follow canonical sequence: Auth -> Ownership -> Categories -> Workshop data -> Services/Media/Certificates -> Bookings/Ratings -> Records/Core -> Realtime.