REST API on AWS
StreamHub's public API serves stream metadata, chat, subscriptions, and clips to web and mobile clients. Consistent resource naming, cursor pagination, and structured errors let third-party integrations ship without breaking every release.
Resource design principles
REST conventions for StreamHub
- Nouns, not verbs:
/streams/{id}not/getStream?id=123. - Plural collections:
/streams,/users/{id}/followers. - Nested resources sparingly:
/streams/{id}/clips— max two levels deep. - Actions as sub-resources:
POST /streams/{id}/followfor non-CRUD operations. - HTTP methods map to semantics: GET read, POST create, PUT replace, PATCH update, DELETE remove.
# StreamHub resource map (subset)
/streams:
GET: list streams (paginated)
POST: create stream (authenticated streamer)
/streams/{stream_id}:
GET: stream metadata
PATCH: update title, category
/streams/{stream_id}/clips:
GET: list clips
POST: create clip from timestamp
/users/{user_id}/subscriptions:
GET: list followed streamers
POST: follow streamer
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 4 sections
- Pagination
- Versioning
- Error contract
- OpenAPI specification
Test yourself
Answer these before moving on — recall is what makes it stick.