OWASP / OWASP/Nest

Document API Error Codes and Responses

Open
#3,394 1 comment 0 reactions 0 assignees View on GitHub
bug enhancement
Dominant language
Python
Stars
451
Forks
702
Avg merge
22h 59m
Merged PRs (30d)
91

Description

**Is your feature request related to a problem? Please describe.**
Currently, API error responses are returned by different endpoints, but there is **no centralized documentation** describing the possible error codes, their meanings, and when clients can expect them.

Because error responses are undocumented:
- API consumers have to infer behavior from trial and error
- Frontend and SDK developers cannot reliably handle errors
- New contributors struggle to understand expected failure cases

This makes integrations harder and increases ambiguity for API users.

---

**Describe the solution you'd like**
Create a dedicated markdown document that clearly documents all API error responses in a single place.

The document should include:
- A list of common error codes (e.g. `UNAUTHORIZED`, `RATE_LIMIT_EXCEEDED`, `NOT_FOUND`)
- HTTP status codes associated with each error
- A short description explaining when each error occurs
- Example JSON error responses where applicable

This documentation should reflect existing API behavior and not introduce new error handling logic.

---

**Describe alternatives you've considered**
- Relying on scattered inline documentation or code comments: difficult for API consumers to discover.
- Documenting errors only inside OpenAPI specs: less readable for humans and harder to maintain for high-level understanding.
- Letting clients infer errors dynamically: unreliable and unfriendly for developers.

A centralized markdown document provides the best balance of clarity and maintainability.

---

**Are you going to work on implementing this?**

- [x] Yes
- [ ] No

---

**Additional context**
This issue focuses purely on **documentation and standardization of existing error responses** and does not change API behavior.

Having a single source of truth for error codes will also make future work such as SDK generation, frontend error handling, and API versioning easier and more consistent.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.