Travis CI API Docs

Key pair

Users may add a public/private RSA key pair to a repository.
This can be used within builds, for example to access third-party services or deploy code to production.
Please note this feature is only available on the travis-ci.com domain.

Attributes

Standard Representation

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

NameTypeDescription
descriptionStringA text description.
public_keyStringThe public key.
fingerprintStringThe fingerprint.

Minimal Representation

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

NameTypeDescription
descriptionStringA text description.
public_keyStringThe public key.
fingerprintStringThe fingerprint.

Actions

Find

Return the current key pair, if it exists.

GET
/repo/{provider}/{repository.id}/key_pair
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}/key_pair
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}/key_pair
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
Query ParameterTypeDescription
include[String]List of attributes to eager load.

Example:GET /repo/891/key_pair

GET
/repo/{repository.slug}/key_pair
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/key_pair

Create

Creates a new key pair.

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token xxxxxxxxxxxx" \
  -d '{ "key_pair.description": "FooBar", "key_pair.value": "xxxxx"}' \
  https://api.travis-ci.com/repo/1234/key_pair
POST
/repo/{provider}/{repository.id}/key_pair
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
Accepted ParameterTypeDescription
key_pair.descriptionStringA text description.
key_pair.valueStringThe private key.
POST
/repo/{provider}/{repository.slug}/key_pair
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Accepted ParameterTypeDescription
key_pair.descriptionStringA text description.
key_pair.valueStringThe private key.
POST
/repo/{repository.id}/key_pair
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
Accepted ParameterTypeDescription
key_pair.descriptionStringA text description.
key_pair.valueStringThe private key.

Example:POST /repo/891/key_pair

POST
/repo/{repository.slug}/key_pair
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Accepted ParameterTypeDescription
key_pair.descriptionStringA text description.
key_pair.valueStringThe private key.

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

Update

Update the key pair.

curl -X PATCH \
  -H "Content-Type: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token xxxxxxxxxxxx" \
  -d '{ "key_pair.description": "FooBarBaz" }' \
  https://api.travis-ci.com/repo/1234/key_pair
PATCH
/repo/{provider}/{repository.id}/key_pair
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
Accepted ParameterTypeDescription
key_pair.descriptionStringA text description.
key_pair.valueStringThe private key.
PATCH
/repo/{provider}/{repository.slug}/key_pair
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Accepted ParameterTypeDescription
key_pair.descriptionStringA text description.
key_pair.valueStringThe private key.
PATCH
/repo/{repository.id}/key_pair
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
Accepted ParameterTypeDescription
key_pair.descriptionStringA text description.
key_pair.valueStringThe private key.

Example:PATCH /repo/891/key_pair

PATCH
/repo/{repository.slug}/key_pair
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
Accepted ParameterTypeDescription
key_pair.descriptionStringA text description.
key_pair.valueStringThe private key.

Example:PATCH /repo/rails%2Frails/key_pair

Delete

Delete the key pair.

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

Example:DELETE /repo/891/key_pair

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

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