Further usecase information -
I want to create a new page which displays a list of ALL the workflows for the document. I would like to link this page to the workflows section in document details and have this page be visible to all users who have access to the document itself (and not just those who are a part of the workflow). I have been investigating and trying out ways to achieve this and the easiest way so far is to have the REST API work the way described above.
I wanted to know where the code for these services is located, if anyone has a clue please let me know!