Lesson 4 of 15
37. Design a News Feed

37.3 What are the doors?

3 min read+10 XP

Step 3: API and data model (10 minutes)

POST /v1/posts { "text": "...", "media_ids": ["m_91"] } → 201 { "post_id": "p_123" } POST /v1/users/{id}/follow → 204 GET /v1/feed?cursor=...&limit=20 returns: { "items": [ { "post_id": "p_123", "author": {...}, "text": "...", "media": [...], "likes": 41, "created_at": "..." }, ... ], "next_cursor": "c_8f2..." , "new_posts_available": 3 }

Media is uploaded separately to object storage with presigned URLs (Chapter 11) and served through a CDN (Chapter 26); posts only reference media IDs.