Travis CI API Docs

Env var

An individual environment variable.

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
idStringThe environment variable id.
nameStringThe environment variable name, e.g. FOO.
valueStringThe environment variable's value, e.g. bar.
publicBooleanWhether this environment variable should be publicly visible or not.
branchUnknownThe env_var's branch.

Minimal Representation

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

NameTypeDescription
idStringThe environment variable id.
nameStringThe environment variable name, e.g. FOO.
publicBooleanWhether this environment variable should be publicly visible or not.
branchUnknownThe env_var's branch.

Actions

Find

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

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

Update

This updates a single environment variable. 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 variable:

curl -X PATCH \
  -H "Content-Type: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token xxxxxxxxxxxx" \
  -d '{ "env_var.value": "bar", "env_var.public": false }' \
  https://api.travis-ci.com/repo/1234/env_var/{env_var.id}
PATCH
/repo/{provider}/{repository.id}/env_var/{env_var.id}
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
env_var.idStringThe environment variable id.
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.
PATCH
/repo/{provider}/{repository.slug}/env_var/{env_var.id}
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
env_var.idStringThe environment variable id.
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.
PATCH
/repo/{repository.id}/env_var/{env_var.id}
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
env_var.idStringThe environment variable id.
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.
PATCH
/repo/{repository.slug}/env_var/{env_var.id}
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
env_var.idStringThe environment variable id.
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.

Delete

This deletes a single environment variable. It is possible to use the repository id or slug in the request.

DELETE
/repo/{provider}/{repository.id}/env_var/{env_var.id}
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
env_var.idStringThe environment variable id.
DELETE
/repo/{provider}/{repository.slug}/env_var/{env_var.id}
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
env_var.idStringThe environment variable id.
DELETE
/repo/{repository.id}/env_var/{env_var.id}
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
env_var.idStringThe environment variable id.
DELETE
/repo/{repository.slug}/env_var/{env_var.id}
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
env_var.idStringThe environment variable id.