Cry

Coveralls API

Authorization

The Coveralls API is authenticated using Personal Access Tokens, which can be found on your Coveralls Account page.

The “Authorization” header is used to send this token, in the format “token XXX” where XXX is replaced with your token, or by including the “access_token” query parameter.

Repos (V1)

Add a new repo to Coveralls

Endpoint

POST /api/repos

Parameters

Name Description Type
repo[service] required Git provider. Options include: github, bitbucket, gitlab, stash, manual String
repo[name] required Name of the repo. E.g. with Github, this is username/reponame. String
repo[comment_on_pull_requests] Whether comments should be posted on pull requests (defaults to true) Boolean
repo[send_build_status] Whether build status should be sent to the git provider (defaults to true) Boolean
repo[commit_status_fail_threshold] Minimum coverage that must be present on a build for the build to pass (default is null, meaning any decrease is a failure) Float or null
repo[commit_status_fail_change_threshold] If coverage decreases, the maximum allowed amount of decrease that will be allowed for the build to pass (default is null, meaning that any decrease is a failure) Float or null

Request

Route

POST /api/repos

Headers

Accept: application/json
Content-Type: application/json
Authorization: token RGVsaXZlciUyMGJldHRlciUyMGNvZGUu

Body

{
  "repo": {
    "service": "github",
    "name": "username/reponame",
    "comment_on_pull_requests": false,
    "send_build_status": true,
    "commit_status_fail_threshold": 75.5,
    "commit_status_fail_change_threshold": null
  }
}

Response

Simulated Response

Response Fields

Name Description Type
repo[name] Name of the repo String
repo[comment_on_pull_requests] Whether comments will be posted on pull requests Boolean
repo[send_build_status] Whether build status will be sent to the git provider Boolean
repo[commit_status_fail_threshold] Minimum coverage that must be present on a build for the build to pass (null means that any decrease is a failure) Float or null
repo[commit_status_fail_change_threshold] If coverage decreases, the maximum allowed amount of decrease that will be allowed for the build to pass (null means that any decrease is a failure) Float or null
repo[created_at] Timestamp of the creation of this Repo Timestamp
repo[updated_at] Timestamp of the last modification to this Repo Timestamp

Status

201

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "repo": {
    "service": "github",
    "name": "username/reponame",
    "comment_on_pull_requests": false,
    "send_build_status": true,
    "commit_status_fail_threshold": 75.5,
    "commit_status_fail_change_threshold": null,
    "created_at": "2000-01-01T08:00:00Z",
    "updated_at": "2000-01-01T08:00:00Z"
  }
}

Get repo info from Coveralls

Endpoint

GET /api/repos/:service/:repo_user/:repo_name

Request

Route

GET /api/repos/github/GithubUser2/repo-1

Headers

Accept: application/json
Content-Type: application/json
Authorization: token RGVsaXZlciUyMGJldHRlciUyMGNvZGUu

Response

Simulated Response

Response Fields

Name Description Type
name Name of the repo String
comment_on_pull_requests Whether comments will be posted on pull requests Boolean
send_build_status Whether build status will be sent to the git provider Boolean
commit_status_fail_threshold Minimum coverage that must be present on a build for the build to pass (null means that any decrease is a failure) Float or null
commit_status_fail_change_threshold If coverage decreases, the maximum allowed amount of decrease that will be allowed for the build to pass (null means that any decrease is a failure) Float or null
created_at Timestamp of the creation of this Repo Timestamp
updated_at Timestamp of the last modification to this Repo Timestamp
token Repo Token (only available if you have access) String

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "service": "github",
  "name": "GithubUser2/repo-1",
  "comment_on_pull_requests": true,
  "send_build_status": true,
  "commit_status_fail_threshold": 75.5,
  "commit_status_fail_change_threshold": null,
  "created_at": "2000-01-01T08:00:00Z",
  "updated_at": "2000-01-01T08:00:00Z",
  "id": 2,
  "has_badge": false,
  "token": "heiNGAuzaYFuVBBZ53ujChNbPH8cRznDo"
}

Update a repo on Coveralls

Endpoint

PUT /api/repos/:service/:user_name/:repo_name

Parameters

Name Description Type
service required Git provider. Options include: github, bitbucket, gitlab, stash, manual String
user_name required Username of the repo. E.g. with Github, this is username/reponame. String
repo_name required Repo name. E.g. with Github, this is username/reponame. String
repo[comment_on_pull_requests] Whether comments should be posted on pull requests (defaults to true) Boolean
repo[send_build_status] Whether build status should be sent to the git provider (defaults to true) Boolean
repo[commit_status_fail_threshold] Minimum coverage that must be present on a build for the build to pass (default is null, meaning any decrease is a failure) Float or null
repo[commit_status_fail_change_threshold] If coverage decreases, the maximum allowed amount of decrease that will be allowed for the build to pass (default is null, meaning that any decrease is a failure) Float or null

Request

Route

PUT /api/repos/github/GithubUser3/repo-2

Headers

Accept: application/json
Content-Type: application/json
Authorization: token RGVsaXZlciUyMGJldHRlciUyMGNvZGUu

Body

{
  "repo": {
    "comment_on_pull_requests": false,
    "commit_status_fail_threshold": 75.5,
    "commit_status_fail_change_threshold": null
  }
}

Response

Simulated Response

Response Fields

Name Description Type
repo[name] Name of the repo String
repo[comment_on_pull_requests] Whether comments will be posted on pull requests Boolean
repo[use_status] Whether build status will be sent to the git provider Boolean
repo[commit_status_fail_threshold] Minimum coverage that must be present on a build for the build to pass (null means that any decrease is a failure) Float or null
repo[commit_status_fail_change_threshold] If coverage decreases, the maximum allowed amount of decrease that will be allowed for the build to pass (null means that any decrease is a failure) Float or null
repo[created_at] Timestamp of the creation of this Repo Timestamp
repo[updated_at] Timestamp of the last modification to this Repo Timestamp

Status

200

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "repo": {
    "service": "github",
    "name": "GithubUser3/repo-2",
    "comment_on_pull_requests": false,
    "send_build_status": null,
    "commit_status_fail_threshold": 75.5,
    "commit_status_fail_change_threshold": null,
    "created_at": "2000-01-01T08:00:00Z",
    "updated_at": "2000-01-01T08:00:00Z"
  }
}