What's my GitHub appliance's REST API endpoint?

According to "API Enterprise 2.5":

All API endpoints—except Management Console API endpoints—are prefixed with the following URL:

https://hostname/api/v3/

But you need to authenticate:

Authentication

Your Enterprise installation's API endpoints accept the same authentication methods as the GitHub.com API. Specifically, you can authenticate yourself with OAuth tokens (which can be created using the Authorizations API) or basic authentication.

Every Enterprise API endpoint is only accessible to GitHub Enterprise site administrators, with the exception of the Management Console API, which is only accessible via the Management Console password.


TLTR; These are the endpoints

+----+------------------------------------------+--------------------------------+
|    |                Enterprise                |             GitHub             |
+----+------------------------------------------+--------------------------------+
| v3 | https://[YOUR_HOST]/api/v3               | https://api.github.com         |
| v4 | https://[YOUR_HOST]/api/graphql          | https://api.github.com/graphql |
+----+------------------------------------------+--------------------------------+

Examples

Here you have some examples in case you want to try them. You'll need to create an ACCESS_TOKEN

Enterprise

curl -H "Authorization: bearer [ACCESS_TOKEN]" https://[YOUR_HOST]/api/v3/organizations
curl -H "authorization: bearer [ACCESS_TOKEN]" https://[YOUR_HOST]/api/graphql -d "{\"query\": \"query { viewer { login } }\"}" 

GitHub

curl -H "Authorization: bearer [ACCESS_TOKEN]" https://api.github.com/organizations
curl -H "authorization: bearer [ACCESS_TOKEN]" https://api.github.com/graphql -d "{\"query\": \"query { viewer { login } }\"}" 

If you are not using https, it's "http://github.mycompany.com/api/v3/".

Tags:

Github Api