Discovery in REST API

Discovery in a REST API refers to the ability for clients to discover the available resources and their associated endpoints without prior knowledge of the API structure.

This can be done through a variety of means such as a documentation page, a dedicated endpoint for discovery, or through conventions in the API’s URL structure.

An example of this is the use of a root endpoint, such as “GET /”, that returns a list of all available resources and their corresponding endpoints for the client to use.

Additionally, some APIs use Hypermedia as the Engine of Application State (HATEOAS) to provide information about the available resources in the form of links within the API responses, that the client can use to navigate the API and discover new resources.