Skip to content

CircleCI API

by circleci.com

Open documentation ↗

Overview

Automate the software development process using continuous integration and continuous delivery

CircleCI is a continuous integration API from circleci.com. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 22 endpoints.

At a glance

Authentication
API key
HTTPS
Yes
CORS
Unknown
Base URL
https://circleci.com/api/v1
Version
v1
Endpoints
22
Spec updated
2021-06-21

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://circleci.com/api/v1/me" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
const response = await fetch("https://circleci.com/api/v1/me", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://circleci.com/api/v1/me",
    headers={
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/meProvides information about the signed in user.
GET/project/{username}/{project}Build summary for each of the last 30 builds for a single git repo.
POST/project/{username}/{project}Triggers a new build, returns a summary of the build.
DELETE/project/{username}/{project}/build-cacheClears the cache for a project.
GET/project/{username}/{project}/checkout-keyLists checkout keys.
POST/project/{username}/{project}/checkout-keyCreates a new checkout key.
GET/project/{username}/{project}/checkout-key/{fingerprint}Get a checkout key.
DELETE/project/{username}/{project}/checkout-key/{fingerprint}Delete a checkout key.
GET/project/{username}/{project}/envvarLists the environment variables for :project
POST/project/{username}/{project}/envvarCreates a new environment variable
GET/project/{username}/{project}/envvar/{name}Gets the hidden value of environment variable :name
DELETE/project/{username}/{project}/envvar/{name}Deletes the environment variable named ':name'
POST/project/{username}/{project}/ssh-keyCreate an ssh key used to access external systems that require SSH key-based authentication
POST/project/{username}/{project}/tree/{branch}Triggers a new build, returns a summary of the build.
GET/project/{username}/{project}/{build_num}Full details for a single build. The response includes all of the fields from the build summary.
GET/project/{username}/{project}/{build_num}/artifactsList the artifacts produced by a given build.
POST/project/{username}/{project}/{build_num}/cancelCancels the build, returns a summary of the build.
POST/project/{username}/{project}/{build_num}/retryRetries the build, returns a summary of the new build.
GET/project/{username}/{project}/{build_num}/testsProvides test metadata for a build
GET/projectsList of all the projects you're following on CircleCI, with build information organized by branch.
GET/recent-buildsBuild summary for each of the last 30 recent builds, ordered by build_num.
POST/user/heroku-keyAdds your Heroku API key to CircleCI, takes apikey as form param name.

Questions

Does the CircleCI API need an API key?

Yes. The CircleCI API uses API key authentication; the documentation explains how to get credentials.

Does the CircleCI API support HTTPS?

Yes, the CircleCI API is served over HTTPS.

How many endpoints does the CircleCI API have?

Its OpenAPI description lists 22 endpoints in version v1. All of them are shown on this page.

What are alternatives to the CircleCI API?

Other Continuous Integration APIs include Azure DevOps Health, Travis CI, Bitrise, Buddy, EC2.shop API.

Compare alternatives →

Listed from public-apis (MIT), public-apis database (MIT), APIs.guru (CC0).