Skip to main content

Find all Organization Projects via the CircleCI API

How to list CircleCI projects for an organization with the API, including follow-state and VCS limits.

Overview

To collect project names for an organization, call API v1.1 with a personal API token. The usual endpoint is GET https://circleci.com/api/v1.1/projects. It returns the projects the token owner follows. Filter that list to the organization you want.

There is no public API v2 endpoint that returns every project in an organization.

Authenticate

Send it as the Circle-Token header. Project tokens are scoped to one project and do not return a user's project list.

List followed projects

Example request:

curl https://circleci.com/api/v1.1/projects -H "Circle-Token: $CIRCLE_TOKEN"

The response is a JSON array. Typical fields include vcs_url, username, reponame, vcs_type, and followed.

API reference: Get All Followed Projects in the API v1.1 docs.

Filter to one organization

Each item's username field is the VCS organization (or user) that owns the repo. The same org appears in vcs_url (for example https://github.com/my-org/my-repo).

Keep rows where username matches the organization.

Example with jq:

curl -s https://circleci.com/api/v1.1/projects -H "Circle-Token: $CIRCLE_TOKEN" | jq --arg org "my-org" '.[] | select(.username == $org) | {reponame, vcs_url, vcs_type}'

Replace my-org with the GitHub or Bitbucket organization name.

The CircleCI CLI lists the same followed set: circleci project list

User profile map (API v1.1 only)

  • GET https://circleci.com/api/v1.1/me also includes a projects object. Keys are VCS URLs. Values are project records. Filter keys that contain the organization.

  • GET https://circleci.com/api/v2/me is a different resource. It returns the authenticated user (name, login, id, avatar_url). It does not include projects.

Nuances

  • Followed vs all projects. v1.1 /projects and the projects map on v1.1 /me only include projects the authenticated user follows. Unfollowed projects in the same organization do not appear. Following a project in the CircleCI UI, or POST /api/v1.1/project/:vcs-type/:username/:project/follow, adds it to later responses.

  • No public list-every-org-project API. API v2 can fetch one project when you already have a project slug (GET /api/v2/project/{project-slug}). It does not enumerate all projects for an org.

  • GitHub OAuth and Bitbucket Cloud. v1.1 project lists match the older slug shape vcs/org/repo (github or gh, bitbucket or bb). username and reponame are the org and repo names.

  • GitHub App, GitLab, and Bitbucket Data Center. Those projects often use opaque CircleCI slugs (circleci/{org-id}/{project-id}). They often do not appear in API v1.1 project lists. Use the Projects page in the CircleCI web app, or GET /api/v2/project/{project-slug} when you already know the slug.

  • Payload size. /projects includes recent branch and job summaries. Large follow lists make a large response. Request a single project when you only need one.

  • CircleCI Server. This article is for CircleCI Cloud (circleci.com). Self-hosted Server uses your installation hostname. Server admins can list all projects on the installation with /api/v1/admin/projects

Additional information

Did this answer your question?