So, the issue is the following: I need to access Travis CI API to get the build status for our organization repositories. The issue here is that using personal GitHub token to generate Travis API token is an overall bad practice, cause the user can leave the organization, or his access rights could be revoked for particular repositories.
The idea was to create a GitHub App, install it to the organization and let the app generate Travis CI tokens using its privileges, and grab the build status programmatically.
I created an app and tried to perform such a trick with the authentication, but it did not work for me.
Any ideas/suggestions are welcome.
As per the answer from the Travis support, it is currently not possible to create API tokens with anything except the personal GitHub token.
The best solution is to create the less-permissive GitHub token, ideally from the GitHub user-account that is used for automation.