Travis CI API Docs

Setting

An individual repository setting. These are settings on a repository that can be adjusted by the user. There are currently five different kinds of settings a user can modify:

  • builds_only_with_travis_yml (boolean)
  • build_pushes (boolean)
  • build_pull_requests (boolean)
  • maximum_number_of_builds (integer)
  • auto_cancel_pushes (boolean)
  • auto_cancel_pull_requests (boolean)
  • share_encrypted_env_with_forks (boolean)
  • share_ssh_keys_with_forks (boolean)
  • job_log_time_based_limit (boolean)
  • job_log_access_based_limit (boolean)

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

Attributes

Standard Representation

Included when the resource is the main response of a request, or is eager loaded.

NameTypeDescription
nameStringThe setting's name.
valueBoolean or integerThe setting's value.

Minimal Representation

Included when the resource is returned as part of another resource.

NameTypeDescription
nameStringThe setting's name.
valueBoolean or integerThe setting's value.

Actions

Find

This returns a single setting. It is possible to use the repository id or slug in the request.

GET
/repo/{provider}/{repository.id}/setting/{setting.name}
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
setting.nameStringThe setting's name.
Query ParameterTypeDescription
include[String]List of attributes to eager load.
GET
/repo/{provider}/{repository.slug}/setting/{setting.name}
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
setting.nameStringThe setting's name.
Query ParameterTypeDescription
include[String]List of attributes to eager load.
GET
/repo/{repository.id}/setting/{setting.name}
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
setting.nameStringThe setting's name.
Query ParameterTypeDescription
include[String]List of attributes to eager load.
GET
/repo/{repository.slug}/setting/{setting.name}
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
setting.nameStringThe setting's name.
Query ParameterTypeDescription
include[String]List of attributes to eager load.

Update

This updates a single setting. It is possible to use the repository id or slug in the request.

Use namespaced params in the request body to pass the new setting:

curl -X PATCH \
  -H "Content-Type: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token xxxxxxxxxxxx" \
  -d '{ "setting.value": true }' \
  https://api.travis-ci.com/repo/1234/setting/{setting.name}
PATCH
/repo/{provider}/{repository.id}/setting/{setting.name}
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
setting.nameStringThe setting's name.
Accepted ParameterTypeDescription
setting.valueBoolean or integerThe setting's value.
PATCH
/repo/{provider}/{repository.slug}/setting/{setting.name}
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
setting.nameStringThe setting's name.
Accepted ParameterTypeDescription
setting.valueBoolean or integerThe setting's value.
PATCH
/repo/{repository.id}/setting/{setting.name}
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
setting.nameStringThe setting's name.
Accepted ParameterTypeDescription
setting.valueBoolean or integerThe setting's value.
PATCH
/repo/{repository.slug}/setting/{setting.name}
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
setting.nameStringThe setting's name.
Accepted ParameterTypeDescription
setting.valueBoolean or integerThe setting's value.