Travis CI API Docs

Env vars

A list of environment variables.

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

Attributes

NameTypeDescription
env_vars[Env var]List of env_vars.

Actions

For Repository

This returns a list of environment variables for an individual repository. It is possible to use the repository id or slug in the request.

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

Example:GET /repo/891/env_vars

GET
/repo/{repository.slug}/env_vars
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Query ParameterTypeDescription
include[String]List of attributes to eager load.

Example:GET /repo/rails%2Frails/env_vars

Create

This creates an environment variable for an individual repository. It is possible to use the repository id or slug in the request.

Use namespaced params in the request body to pass the new environment variables:

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token xxxxxxxxxxxx" \
  -d '{ "env_var.name": "FOO", "env_var.value": "bar", "env_var.public": false }' \
  https://api.travis-ci.com/repo/1234/env_vars
POST
/repo/{provider}/{repository.id}/env_vars
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
Accepted ParameterTypeDescription
env_var.nameStringThe environment variable name, e.g. FOO.
env_var.valueStringThe environment variable's value, e.g. bar.
env_var.publicBooleanWhether this environment variable should be publicly visible or not.
env_var.branchUnknownThe env_var's branch.
POST
/repo/{provider}/{repository.slug}/env_vars
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Accepted ParameterTypeDescription
env_var.nameStringThe environment variable name, e.g. FOO.
env_var.valueStringThe environment variable's value, e.g. bar.
env_var.publicBooleanWhether this environment variable should be publicly visible or not.
env_var.branchUnknownThe env_var's branch.
POST
/repo/{repository.id}/env_vars
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
Accepted ParameterTypeDescription
env_var.nameStringThe environment variable name, e.g. FOO.
env_var.valueStringThe environment variable's value, e.g. bar.
env_var.publicBooleanWhether this environment variable should be publicly visible or not.
env_var.branchUnknownThe env_var's branch.

Example:POST /repo/891/env_vars

POST
/repo/{repository.slug}/env_vars
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Accepted ParameterTypeDescription
env_var.nameStringThe environment variable name, e.g. FOO.
env_var.valueStringThe environment variable's value, e.g. bar.
env_var.publicBooleanWhether this environment variable should be publicly visible or not.
env_var.branchUnknownThe env_var's branch.

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