Travis CI API Docs

Cron

An individual cron. There can be only one cron per branch on a repository.

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

Attributes

Minimal Representation

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

NameTypeDescription
idIntegerValue uniquely identifying the cron.

Standard Representation

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

NameTypeDescription
idIntegerValue uniquely identifying the cron.
repositoryRepositoryGithub repository to which this cron belongs.
branchBranchGit branch of repository to which this cron belongs.
intervalStringInterval at which the cron will run (can be "daily", "weekly" or "monthly").
dont_run_if_recent_build_existsBooleanWhether a cron build should run if there has been a build on this branch in the last 24 hours.
last_runStringWhen the cron ran last.
next_runStringWhen the cron is scheduled to run next.
created_atStringWhen the cron was created.
activeUnknownThe cron's active.

Actions

Find

This returns a single cron.

GET
/cron/{cron.id}
Template VariableTypeDescription
cron.idIntegerValue uniquely identifying the cron.
Query ParameterTypeDescription
include[String]List of attributes to eager load.

Delete

This deletes a single cron.

DELETE
/cron/{cron.id}
Template VariableTypeDescription
cron.idIntegerValue uniquely identifying the cron.

For Branch

This returns the cron set for the specified branch for the specified repository. It is possible to use the repository id or slug in the request.

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

Example:GET /repo/891/branch/master/cron

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

Example:GET /repo/rails%2Frails/branch/master/cron

Create

This creates a cron on the specified branch for the specified repository. It is possible to use the repository id or slug in the request. Content-Type MUST be set in the header and an interval for the cron MUST be specified as a parameter.

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token xxxxxxxxxxxx" \
  -d '{ "cron.interval": "monthly" }' \
  https://api.travis-ci.com/repo/1234/branch/master/cron
POST
/repo/{provider}/{repository.id}/branch/{branch.name}/cron
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
branch.nameStringName of the git branch.
Accepted ParameterTypeDescription
cron.intervalStringInterval at which the cron will run (can be "daily", "weekly" or "monthly").
cron.dont_run_if_recent_build_existsBooleanWhether a cron build should run if there has been a build on this branch in the last 24 hours.
POST
/repo/{provider}/{repository.slug}/branch/{branch.name}/cron
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
branch.nameStringName of the git branch.
Accepted ParameterTypeDescription
cron.intervalStringInterval at which the cron will run (can be "daily", "weekly" or "monthly").
cron.dont_run_if_recent_build_existsBooleanWhether a cron build should run if there has been a build on this branch in the last 24 hours.
POST
/repo/{repository.id}/branch/{branch.name}/cron
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
branch.nameStringName of the git branch.
Accepted ParameterTypeDescription
cron.intervalStringInterval at which the cron will run (can be "daily", "weekly" or "monthly").
cron.dont_run_if_recent_build_existsBooleanWhether a cron build should run if there has been a build on this branch in the last 24 hours.

Example:POST /repo/891/branch/master/cron

POST
/repo/{repository.slug}/branch/{branch.name}/cron
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
branch.nameStringName of the git branch.
Accepted ParameterTypeDescription
cron.intervalStringInterval at which the cron will run (can be "daily", "weekly" or "monthly").
cron.dont_run_if_recent_build_existsBooleanWhether a cron build should run if there has been a build on this branch in the last 24 hours.

Example:POST /repo/rails%2Frails/branch/master/cron