Travis CI API Docs

Branches

A list of branches.

If querying using the repository slug, it must be formatted using standard URL encoding, including any special characters.

Attributes

NameTypeDescription
branches[Branch]List of branches.

Collection Items

Each entry in the branches array has the following attributes:

NameTypeDescription
nameStringName of the git branch.
repositoryRepositoryGitHub user or organization the branch belongs to.
default_branchBooleanWhether or not this is the resposiotry's default branch.
exists_on_githubBooleanWhether or not the branch still exists on GitHub.
last_buildBuildLast build on the branch.
recent_builds[Build]Last 10 builds on the branch (when `include=branch.recent_builds` is used).

Actions

Find

This will return a list of branches a repository has on GitHub.

GET
/repo/{provider}/{repository.id}/branches
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
Query ParameterTypeDescription
branch.exists_on_github[Boolean]Filters branches by whether or not the branch still exists on GitHub.
branch.name[String]Filters branches by name of the git branch.
exists_on_github[Boolean]Alias for branch.exists_on_github.
include[String]List of attributes to eager load.
limitIntegerHow many branches to include in the response. Used for pagination.
name[String]Alias for branch.name.
offsetIntegerHow many branches to skip before the first entry in the response. Used for pagination.
sort_by[String]Attributes to sort branches by. Used for pagination.

Sortable by: name, last_build, exists_on_github, default_branch, append :desc to any attribute to reverse order.
The default value is default_branch,exists_on_github,last_build:desc.

GET
/repo/{provider}/{repository.slug}/branches
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Query ParameterTypeDescription
branch.exists_on_github[Boolean]Filters branches by whether or not the branch still exists on GitHub.
branch.name[String]Filters branches by name of the git branch.
exists_on_github[Boolean]Alias for branch.exists_on_github.
include[String]List of attributes to eager load.
limitIntegerHow many branches to include in the response. Used for pagination.
name[String]Alias for branch.name.
offsetIntegerHow many branches to skip before the first entry in the response. Used for pagination.
sort_by[String]Attributes to sort branches by. Used for pagination.

Sortable by: name, last_build, exists_on_github, default_branch, append :desc to any attribute to reverse order.
The default value is default_branch,exists_on_github,last_build:desc.

GET
/repo/{repository.id}/branches
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
Query ParameterTypeDescription
branch.exists_on_github[Boolean]Filters branches by whether or not the branch still exists on GitHub.
branch.name[String]Filters branches by name of the git branch.
exists_on_github[Boolean]Alias for branch.exists_on_github.
include[String]List of attributes to eager load.
limitIntegerHow many branches to include in the response. Used for pagination.
name[String]Alias for branch.name.
offsetIntegerHow many branches to skip before the first entry in the response. Used for pagination.
sort_by[String]Attributes to sort branches by. Used for pagination.

Example:GET /repo/891/branches?limit=5&exists_on_github=true

Sortable by: name, last_build, exists_on_github, default_branch, append :desc to any attribute to reverse order.
The default value is default_branch,exists_on_github,last_build:desc.

GET
/repo/{repository.slug}/branches
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Query ParameterTypeDescription
branch.exists_on_github[Boolean]Filters branches by whether or not the branch still exists on GitHub.
branch.name[String]Filters branches by name of the git branch.
exists_on_github[Boolean]Alias for branch.exists_on_github.
include[String]List of attributes to eager load.
limitIntegerHow many branches to include in the response. Used for pagination.
name[String]Alias for branch.name.
offsetIntegerHow many branches to skip before the first entry in the response. Used for pagination.
sort_by[String]Attributes to sort branches by. Used for pagination.

Example:GET /repo/rails%2Frails/branches?limit=5&exists_on_github=true

Sortable by: name, last_build, exists_on_github, default_branch, append :desc to any attribute to reverse order.
The default value is default_branch,exists_on_github,last_build:desc.