Travis CI API Docs

Caches

A list of caches.

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

Attributes

NameTypeDescription
branchStringThe branch the cache belongs to.
matchStringThe string to match against the cache name.

Actions

Find

This returns all the caches for a repository.

It's possible to filter by branch or by regexp match of a string to the cache name.

curl \
  -H "Content-Type: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token xxxxxxxxxxxx" \
  https://api.travis-ci.com/repo/1234/caches?branch=master
curl \
  -H "Content-Type: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token xxxxxxxxxxxx" \
  https://api.travis-ci.com/repo/1234/caches?match=linux
GET
/repo/{provider}/{repository.id}/caches
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
Query ParameterTypeDescription
branch[String]Alias for caches.branch.
caches.branch[String]Filters caches by the branch the cache belongs to.
caches.match[String]Filters caches by the string to match against the cache name.
include[String]List of attributes to eager load.
match[String]Alias for caches.match.
GET
/repo/{provider}/{repository.slug}/caches
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Query ParameterTypeDescription
branch[String]Alias for caches.branch.
caches.branch[String]Filters caches by the branch the cache belongs to.
caches.match[String]Filters caches by the string to match against the cache name.
include[String]List of attributes to eager load.
match[String]Alias for caches.match.
GET
/repo/{repository.id}/caches
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
Query ParameterTypeDescription
branch[String]Alias for caches.branch.
caches.branch[String]Filters caches by the branch the cache belongs to.
caches.match[String]Filters caches by the string to match against the cache name.
include[String]List of attributes to eager load.
match[String]Alias for caches.match.

Example:GET /repo/891/caches

GET
/repo/{repository.slug}/caches
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Query ParameterTypeDescription
branch[String]Alias for caches.branch.
caches.branch[String]Filters caches by the branch the cache belongs to.
caches.match[String]Filters caches by the string to match against the cache name.
include[String]List of attributes to eager load.
match[String]Alias for caches.match.

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

Delete

This deletes all caches for a repository.

As with find it's possible to delete by branch or by regexp match of a string to the cache name.

curl -X DELETE \
  -H "Content-Type: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token xxxxxxxxxxxx" \
  https://api.travis-ci.com/repo/1234/caches?branch=master
DELETE
/repo/{provider}/{repository.id}/caches
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
DELETE
/repo/{provider}/{repository.slug}/caches
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
DELETE
/repo/{repository.id}/caches
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.

Example:DELETE /repo/891/caches

DELETE
/repo/{repository.slug}/caches
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.

Example:DELETE /repo/rails%2Frails/caches