Booking API
A REST API to book, reschedule and cancel appointments at a fictitious studio. Built to show how we build APIs: access keys, rate limits, proper validation and documentation you can try right here.
- REST and JSONOpenAPI 3.1, RFC 9457 errors
- One sandbox per keyIsolated and deleted after 24 h
- Abuse protectionLimits per key and per IP
- TypeScript, Hono and ZodCloudflare Workers and SQLite
1. Get a key
Each key opens a sandbox of your own, with 3 services and 3 sample bookings. Nobody else sees it, and everything is deleted after 24 hours. Do not enter real personal data: names with emails or phone numbers are rejected.
The key is kept only in this browser tab.
2. Try it
Open an operation, adjust the fields and press Send request. Requests go to the real API; the response appears below, together with the same request in curl. Try booking the same time twice, or a Sunday.
Loading the documentation…
Errors
All errors use application/problem+json, with a stable code, a human-readable message and, for validation, the list of fields with problems.
| Status | code | When |
|---|---|---|
| 400 | invalid_json | The body is not valid JSON. |
| 401 | missing_key | The Authorization header is missing. |
| 401 | invalid_key | The key does not exist or has expired. |
| 404 | booking_not_found | The booking does not exist in your sandbox. |
| 405 | method_not_allowed | Wrong method for this path (see Allow). |
| 409 | slot_unavailable | There is already a booking at that time. |
| 409 | booking_cancelled | The booking is cancelled. |
| 409 | sandbox_full | This key has reached 200 bookings. |
| 413 | payload_too_large | Body larger than 8 KB. |
| 415 | unsupported_media_type | Missing Content-Type: application/json. |
| 422 | validation_failed | Invalid fields: see errors. |
| 422 | idempotency_key_reused | Idempotency-Key reused with a different body. |
| 429 | rate_limited | Too many requests: wait for Retry-After. |