Week 2 · Lesson 08

REST interface

Stable HTTP contracts so UI and scripts are interchangeable clients of the orchestrator.

Time · ½–1 day
Learn
  • Errors as contracts (status + body shape)
  • Idempotent reads; careful writes
  • API is not the agent — it starts runs and exposes state
Build
  1. CRUD posts, list/filter, get run timeline
  2. PATCH /api/posts/:id, approve / request-changes
  3. Consistent JSON error shape
Checkpoint

curl alone can create a post, start a run, approve — no UI required.

Four notes
  • What problem does this layer solve?
  • What is allowed to call it?
  • What must it never do?
  • How do I observe and test it?