[ADP-305] /api/ in Relative URI Path
Guidance
- SHOULD NOT include
/api/
in the relative URL path (excluding the domain).
To maintain a clean and intuitive URL structure, it is recommended that the URL paths for APIs SHOULD NOT include the segment /api/
. This approach adheres to the principle of simplicity and ensures that the URLs are user-friendly and easy to understand.
It's acceptable to use an api
subdomain.(e.g., https://api.my.dev
)
Exception: If your web server cannot provide web pages and APIs on different domains, you may include /api/
in the path to differentiate.
Examples
Recommended
https://api.example.com/users
https://api.example.com/orders
https://api.example.com/products
Not Recommended
https://example.com/api/users
https://example.com/api/orders
https://example.com/api/products