The various talks I have watched and tutorials I scanned on REST seem to stress something called 'discoverability'. To my limited understanding, the term seems to mean that a client should be able to go to http://URL - and automatically get a list of things it can do.

What I am having trouble understanding - is that 'software clients' are not human beings. They are just programs that do not have the intuitive knowledge to understand what exactly to do with the links provided. Only people can go to a website and make sense of the text and links presented and act on it.

So what is the point of discoverability, when the client code that accesses such discoverable URLs cannot actually do anything with it, unless the human developer of the client actually experiments with the resources presented? This looks like the exact same thing as defining the set of available functions in a Documentation manual, just from a different direction and actually involving more work for the developer. Why is this second approach of pre-defining what can be done in a document external to the actual REST resources, considered inferior?

4 Answers 4


The need for discoverability may not be relevant, but the links that allow discoverability serve more purposes. The most important of these, to my mind, is that providing full URI's in the responses to the client, means that no client will ever need to "compose" an URI. That means that no client will ever need knowledge about how the URI's are structured. And that in turn allows the server developers to change the URI scheme whenever it suits them as they do not need to consider older clients still relying on an old way of structuring URI's.

  • Yes, I think I can make sense of that... but can you also please point me to a link with a concrete code example? A 'versus' change between how a resource embedded with discoverable URLs provide a better insurance for the future?
    – Aditya M P
    Oct 20, 2012 at 14:26
  • Sorry, no links. Just common sense and years of having to maintain code in server apps to keep it backwards compatible with older clients. Whenever you have a client/server type situation, you need servers backwards compatible with old clients as you can NOT change an old client once it has been deployed. This holds even if you control both web client and server code and always deliver them as a whole: you can do without the headaches during development so a web client team can develop as independently as possible from the back end team. Oct 20, 2012 at 17:11
  • Hi Marjan, just wanted to say that, I keep coming back to this answer b/c of the vote activity on it, and about a year and half after you answered, I fully understood what you meant, without needing "links" :D thank you for being patient and this great answer :-)
    – Aditya M P
    Jun 2, 2017 at 1:13
  • Glad it was useful to you @AdityaMP Jun 2, 2017 at 10:23

"Clients" may not be advanced enough to make use of it, but the users of clients can. A client can be something as simple as a web browser, after all. The discoverability is all about enabling people to learn and use the API.

For example, Jenkins (the CI server) has a REST-like interface. Go to any page, postfix the URL with "/api", and you get a page describing everything you can do. It makes learning the API trivial. For example, http://ci.jruby.org takes you to the jenkins server for jruby, and http://ci.jruby.org/api takes you to the api for that specific page.


NOTE: I'm no expert on the subject, but I went through a similar process of trying to reconcile the different nuances of people's interpretations of "REST" a few years ago, and this is the takeaway I got from looking into it at the time.

To my understanding, this stems from Roy Fielding's Hypermedia as the Engine of Application State aka "HATEOAS", which then becomes an enabler of the idea of a "semantic web".

So...basically, and again as I understand it, you make your RESTful application basically self describing such that the consumer does not have to have prior knowledge of a formal contract to consume your content / functionality. They are able to engage from some defaulted root endpoint and then walk contextually relevant links that your app provides as the consumer interacts. The consumer, of course, can be a person or a systemic agent.

If you are just using "REST" for pretty urls mapped to CRUD operations that a consumer must have prior knowledge of and calls according to a well known contract, Roy Fielding would deem it not truly RESTful.

That's not to say that a REST flavored RPC service set up can't be useful / an improvement over a more elaborate RPC model and suitable for limited / controlled usage, but the hardliners will look down their noses at it and consider it to be degenerate / not really REST.


I had the pleasure a while ago to work with an API that had documentation that was very, very hard to understand.

Once I managed to get an actual reply from the server, it was possible to compare the documentation with the server reply and use that to decipher the documentation (and yes, deciphering it was the right term). The problem was that if a request was sent to the server that wasn't exactly correct according to the spec, you would just get an error, and with the unreadable documentation, figuring out how to send the correct requests was close to impossible. There were also different versions of the API documentation which didn't agree with each other and probably didn't agree with the API itself; that didn't help.

If there had been one command that I could send to the server, returning a list of all possible commands and how exactly to send them, that would have been extremely helpful. Discoverability is not just for clients, it's also useful for software developers.

  • In this case, if the developer had written a good doc the discoverability would not be necessary. So it's one or the other?
    – VinGarcia
    Nov 10, 2020 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.