REST API Best Practices and Anti-Patterns/Do not return 200 for every outcome

Use HTTP status codes meaningfully.

Section: Anti-patterns

Do not return 200 for every outcome

text
text
Avoid: HTTP 200 with { "success": false } for validation failures
Explanation

Meaningful status codes help caches, clients, SDKs, observability tools, and humans interpret results correctly.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Anti-patterns
Verbs in CRUD endpoints
Avoid route names that duplicate the HTTP method.
OpenIn sheettextsame section
Do not expose raw database internals
Keep API models stable and intentional.
OpenIn sheettextsame section
Do not ship breaking changes silently
Version or phase in incompatible changes.
OpenIn sheettextsame section
Avoid deeply nested routes
Keep URLs maintainable.
OpenIn sheettextsame section
Keep response contracts consistent
Use the same top-level response structure across endpoints.
OpenIn sheettext1 tag match
Return a request ID
Make support and debugging easier.
OpenIn sheethttp1 tag match