2k3software / API demo
Concept project · fictitious data

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.

StatuscodeWhen
400invalid_jsonThe body is not valid JSON.
401missing_keyThe Authorization header is missing.
401invalid_keyThe key does not exist or has expired.
404booking_not_foundThe booking does not exist in your sandbox.
405method_not_allowedWrong method for this path (see Allow).
409slot_unavailableThere is already a booking at that time.
409booking_cancelledThe booking is cancelled.
409sandbox_fullThis key has reached 200 bookings.
413payload_too_largeBody larger than 8 KB.
415unsupported_media_typeMissing Content-Type: application/json.
422validation_failedInvalid fields: see errors.
422idempotency_key_reusedIdempotency-Key reused with a different body.
429rate_limitedToo many requests: wait for Retry-After.

OpenAPI specification (JSON)