There are several standards that you should follow when building a RESTful service:
Use HTTP methods (e.g. GET, POST, PUT, DELETE) appropriately:
GET should be used to retrieve data.
POST should be used to create new data.
PUT should be used to update existing data.
DELETE should be used to delete data.
Use HTTP status codes correctly:
2xx status codes (e.g. 200, 201) should be used to indicate success.
4xx status codes (e.g. 400, 401) should be used to indicate an error that occurred due to the client.
5xx status codes (e.g. 500, 501) should be used to indicate an error that occurred on the server.
2. Use a consistent and logical URL structure.
Use appropriate HTTP headers (e.g. Content-Type, Authorization).
Allow for flexible content negotiation (e.g. support different formats such as JSON and XML).
Follow the principles of REST (e.g. use hypermedia, cache resources, and design for visibility and reliability).
It’s also a good idea to design your RESTful service in a way that is easy for developers to use and understand and follows common conventions for building APIs.
https://stackoverflow.blog/2020/03/02/best-practices-for-rest-api-design/