I would like to know if there is an function in the Github API which would return the status of a pull request whether its accepted or rejected. Does such a function exist?
You can get a single PR and check its state
and merged
properties. If it's merged, then it's accepted. If it's closed and not merged it may be rejected.
In fact it may be not rejected but closed by a creator. I'm not sure if it's possible to check if it was closed by another user (rejected) or by it's creator (denied).