๐Ÿ›๏ธ Web Dev

REST API Design โ€” Conventions Interviewers Expect You to Know

๐Ÿ“… Jul 5, 2026 โฑ 3 min read

Whether you're building an Express API or consuming one, these conventions are the shared language of web teams.

Resources are nouns; methods are verbs

GET    /api/students          # list (with filters)
GET    /api/students/42       # one
POST   /api/students          # create โ†’ 201 + the created object
PUT    /api/students/42       # replace
PATCH  /api/students/42       # partial update
DELETE /api/students/42       # remove โ†’ 204

# nested relations โ€” one level max
GET /api/students/42/marks

# โŒ never: /getStudents, /student_delete.php?id=42

Query params = filtering; path = identity

GET /api/students?dept=cse&sort=-cgpa&page=2&limit=20

Error responses โ€” pick a shape, keep it

// 400
{ "error": { "code": "VALIDATION", "message": "cgpa must be 0โ€“10", "field": "cgpa" } }

Consistent error shapes are what make frontends pleasant to write against โ€” inconsistent APIs are why frontend devs drink chai angrily.

Rapid-fire conventions

โ† All Articles