GitHub REST API Endpoints with ids

I’m developing an API in which I need to store the information about users, organizations and repositories. Following the API Documentation the endpoints for getting an instance of these resources are respectively:

  • GET /users/{username}
  • GET /orgs/{org-name}
  • GET /repos/{owner-name}/{repo-name}

The problem is, since I need to store information about these types of resources, I need to store their id since the names are unstable (can be changed at any time). However, the documentation shows no endpoints for doing requests through the resource’s id.
Even though the documentation doesn’t show it, I’ve found the following endpoints that return exactly the same as the ones stated before:

  • GET /user/{userId}
  • GET /organizations/{orgId}
  • GET /repositories/{repoId}

So the first question is, given that these endpoints are extremely useful, why are they not documented?

For the second question, I need to make a HTTP Request to the REST API to check the membership of a user in a organization. For that we use GET /orgs/{org-name}/memberships/{username}. Using the method from before, I discovered /organizations/{orgId}/memberships/{username} works. However, I don’t seem to find any endpoint that uses the userId instead of the username. I would like to know if someone either knows if there is the endpoint for it, or the reason for it not existing. As of right now, since that’s the only endpoint I found, for each request in my app, I need to get the user’s username by making a request to user/{userId} which makes my app pretty inefficient.