Authentication
To authenticate against the Travis CI API, you need an API access token generated by the Travis CI command line client.
Tokens for open source projects, private projects and enterprise installations of Travis CI are not interchangeable.
API token for an open source project on travis-ci.org
Generate the token:
travis login travis token
Include the token in the
Authorization
header of each request tohttps://api.travis-ci.org
:curl -H "Travis-API-Version: 3" \ -H "Authorization: token xxxxxxxxxxxx" \ https://api.travis-ci.org/repos
API token for a private project on travis-ci.com
Generate the token:
travis login --pro travis token --pro
Include the token in the
Authorization
header of each request https://api.travis-ci.com:curl -H "Travis-API-Version: 3" \ -H "Authorization: token xxxxxxxxxxxx" \ https://api.travis-ci.com/repos