The current version of a GitHub Enterprise instance is returned in the response header of every API: X-GitHub-Enterprise-Version: 2.19.0 You can also read the current version by calling the meta endpoint.
X-GitHub-Enterprise-Version: 2.19.0