If you need to make a new REST API, please, don’t reinvent the wheel. Take JSON:API. This is a good enough standard for writing REST APIs, and using a standard gives a lot of benefits:
- Ready-to-use libraries for both client and server sides.
- Well-documented. Just point your users to there, and you have less stuff to write.
- Easy to achieve consistency in API of different endpoints.
- Well-thought design decisions made by smart people based on their pain and experience.
Also, consider using GraphQL. The choice between GraphQL and a REST API depends on if you want to have more control on the server or on the client side. GraphQL allows frontend team go faster and always easily request just the data they need. REST API allows to write a well-thought, fast, and optimized backend.