<aside>
This section is part of the 5-hour System Design course by Mukul Raina
Section 9: API Design

The API layer is the contract between clients and the system. Every action a rider or driver takes in the app translates to an API call. Requesting a ride is a POST. Checking ETA is a GET. Cancelling is a DELETE. Accepting a dispatch is a WebSocket event. The API design determines how clients interact with the services we built in Section 4 and the data flows we traced in Section 5.
In an interview, API design is not about listing every endpoint. It is about showing that you understand the interaction model: which operations are REST request-response, which are real-time push over WebSocket, how authentication works at the edge, how rate limiting protects backend services, and why cursor pagination is the right choice for real-time datasets.
What We’ll Cover:
This section connects backward to Section 4 (Architecture), where the API Gateway and WebSocket Gateway were defined, and Section 8 (Database Design), where the schemas these APIs read from and write to were specified.
<aside>
Mukul Raina | youtube.com/@mukulraina | slides.mukulraina.com | LinkedIn
</aside>
Core Rider Endpoints
The rider interacts with the system through five primary endpoints. Each maps to a functional requirement from Section 2.
POST /v1/rides Request a new ride
GET /v1/rides/{id} Get ride status and details
GET /v1/rides/{id}/eta Get current ETA for an active ride
DELETE /v1/rides/{id} Cancel a ride
POST /v1/rides/{id}/rating Rate the driver after trip completion
GET /v1/rides/history Paginated trip history