Travis CI API Docs

Requests

A list of requests.

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

Attributes

NameTypeDescription
requests[Request]List of requests.

Collection Items

Each entry in the requests array has the following attributes:

NameTypeDescription
idIntegerValue uniquely identifying the request.
stateStringThe state of a request (eg. whether it has been processed or not).
resultStringThe result of the request (eg. rejected or approved).
messageStringTravis-ci status message attached to the request.
pull_request_mergeableUnknownThe request's pull_request_mergeable.
repositoryRepositoryGitHub user or organization the request belongs to.
branch_nameStringName of the branch requested to be built.
commitCommitThe commit the request is associated with.
builds[Build]The request's builds.
ownerOwnerGitHub user or organization the request belongs to.
created_atStringWhen Travis CI created the request.
event_typeStringOrigin of request (push, pull request, api).
base_commitStringThe base commit the request is associated with.
head_commitStringThe head commit the request is associated with.
messagesUnknownThe request's messages.
configObjectBuild configuration (as parsed from .travis.yml).
raw_configsUnknownThe request's raw_configs.
yaml_configUnknownThe request's yaml_config.

Actions

Find

This will return a list of requests belonging to a repository.

GET
/repo/{provider}/{repository.id}/requests
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
Query ParameterTypeDescription
include[String]List of attributes to eager load.
limitIntegerHow many requests to include in the response. Used for pagination.
offsetIntegerHow many requests to skip before the first entry in the response. Used for pagination.
GET
/repo/{provider}/{repository.slug}/requests
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Query ParameterTypeDescription
include[String]List of attributes to eager load.
limitIntegerHow many requests to include in the response. Used for pagination.
offsetIntegerHow many requests to skip before the first entry in the response. Used for pagination.
GET
/repo/{repository.id}/requests
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
Query ParameterTypeDescription
include[String]List of attributes to eager load.
limitIntegerHow many requests to include in the response. Used for pagination.
offsetIntegerHow many requests to skip before the first entry in the response. Used for pagination.

Example:GET /repo/891/requests?limit=5

GET
/repo/{repository.slug}/requests
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Query ParameterTypeDescription
include[String]List of attributes to eager load.
limitIntegerHow many requests to include in the response. Used for pagination.
offsetIntegerHow many requests to skip before the first entry in the response. Used for pagination.

Example:GET /repo/rails%2Frails/requests?limit=5

Create

This will create a request for an individual repository, triggering a build to run on Travis CI.

Use namespaced params in JSON format in the request body to pass any accepted parameters. Any keys in the request's config will override keys existing in the .travis.yml.

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token xxxxxxxxxxxx" \
  -d '{ "request": {
        "message": "Override the commit message: this is an api request", "branch": "master" }}'\
  https://api.travis-ci.com/repo/1/requests

The response includes the following body:

{
  "@type":              "pending",
  "remaining_requests": 1,
  "repository":         {
    "@type":            "repository",
    "@href":            "/repo/1",
    "@representation":  "minimal",
    "id":               1,
    "name":             "test",
    "slug":             "owner/repo"
  },
  "request":            {
    "repository":       {
      "id":             1,
      "owner_name":     "owner",
      "name":           "repo"
    },
    "user":             {
      "id":             1
    },
    "id":               1,
    "message":          "Override the commit message: this is an api request",
    "branch":           "master",
    "config":           { }
  },
  "resource_type":      "request"
}
POST
/repo/{provider}/{repository.id}/requests
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
Accepted ParameterTypeDescription
request.merge_modeUnknownDocumentation missing.
request.configObjectBuild configuration (as parsed from .travis.yml).
request.configsUnknownDocumentation missing.
request.messageStringTravis-ci status message attached to the request.
request.branchStringBranch requested to be built.
request.shaUnknownDocumentation missing.
request.tokenObjectTravis token associated with webhook on GitHub (DEPRECATED).
POST
/repo/{provider}/{repository.slug}/requests
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Accepted ParameterTypeDescription
request.merge_modeUnknownDocumentation missing.
request.configObjectBuild configuration (as parsed from .travis.yml).
request.configsUnknownDocumentation missing.
request.messageStringTravis-ci status message attached to the request.
request.branchStringBranch requested to be built.
request.shaUnknownDocumentation missing.
request.tokenObjectTravis token associated with webhook on GitHub (DEPRECATED).
POST
/repo/{repository.id}/requests
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
Accepted ParameterTypeDescription
request.merge_modeUnknownDocumentation missing.
request.configObjectBuild configuration (as parsed from .travis.yml).
request.configsUnknownDocumentation missing.
request.messageStringTravis-ci status message attached to the request.
request.branchStringBranch requested to be built.
request.shaUnknownDocumentation missing.
request.tokenObjectTravis token associated with webhook on GitHub (DEPRECATED).

Example:POST /repo/891/requests

POST
/repo/{repository.slug}/requests
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Accepted ParameterTypeDescription
request.merge_modeUnknownDocumentation missing.
request.configObjectBuild configuration (as parsed from .travis.yml).
request.configsUnknownDocumentation missing.
request.messageStringTravis-ci status message attached to the request.
request.branchStringBranch requested to be built.
request.shaUnknownDocumentation missing.
request.tokenObjectTravis token associated with webhook on GitHub (DEPRECATED).

Example:POST /repo/rails%2Frails/requests