Skip to content
API reference354de6f · docs(api): github

GitHub

Cubes are created from GitHub repositories. These endpoints show which repositories you can use. They only read.

Endpoints

A key can't connect or disconnect GitHub. Someone connects it once in the dashboard, on the GitHub tab. After that, the API can list the connections, the repositories you gave Cubecen access to, and the folders inside them.

Creating a cube from a connected repository takes three calls. List the connections and note the id of the one you want. List its repositories to find the repository. Then create the cube with github_installation_id and the repository's owner and name. Listing connections works with any key. The other endpoints here need a Full key, because they serve the creation of cubes.

List GitHub installations

GET/v1/organizations/{org}/integrations/github/installations
Read-only key

Returns the GitHub installations connected to the organization. An installation is the Cubecen GitHub App installed on a GitHub account: a person or a GitHub organization. A cube is made from a repository that one of these installations can reach.

The answer holds all of them in data, the oldest connection first. It is not paged. Use an item's id where a path asks for an installation, as listGitHubInstallationRepositories and getRepositoryFolders do.

Two things can need attention. When approval_pending is true, the GitHub account has not approved every permission that the App asks for now, and approve_url is the page on github.com where an owner approves them. When access is lost, the person who connected the installation can no longer use it. It allows no repository, and new cubes, builds and previews from it are refused until an owner connects it again in the Cubecen dashboard. Cubes that are running keep running.

Connecting and disconnecting GitHub is done in the Cubecen dashboard, not with an API key.

Path parameters

NameTypeDescription
orgrequiredstring

The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with 403, and so is a slug that matches no organization. An ID that matches no organization at all is 404.

Responses

StatusDescription
200

The connected installations.

GitHubInstallationList object1 field
dataarray of objectrequired

The installations, the oldest connection first.

data items18 fields
idstringrequired

The connection's ID. Paths and parameters that name an installation take this one, not installation_id.

organization_idstringrequired

The ID of the organization the installation is connected to.

installation_idintegerrequired

The installation's number on GitHub.

account_idintegerrequired

The ID of the GitHub account that the App is installed on.

account_loginstringrequired

The login of that GitHub account.

account_typestringrequired

User for a person's account, Organization for a GitHub organization.

One of: User, Organization

connected_bystringrequired

The ID of the user who connected the installation, or who last refreshed it. The repositories of the connection are those that this person can reach on GitHub.

verified_atstringrequired

When the connection was made, or last refreshed.

repositories_synced_atstring | nullrequired

When the list of repositories was last taken from GitHub. null for a connection made before repository lists existed: it can use every repository of the installation until it is refreshed.

repository_selectionstringrequired

all when the organization can use every repository in the connection's list, including those that a refresh adds. selected when it can use only the repositories that an owner picked.

One of: all, selected

repository_countinteger | nullrequired

How many repositories the organization can use through the connection. null when the connection has no list.

created_atstringrequired

When the connection was created.

updated_atstringrequired

When the connection was last changed.

approval_pendingbooleanrequired

true when the GitHub account has not approved every permission that the App asks for now.

approve_urlstring | nullrequired

The page on github.com where an owner of the account reviews and approves the permissions. null while nothing is waiting for approval.

accessstringrequired

Whether the person in connected_by can still use the connection. verified: their access was recorded and still holds. unverified: it was connected before their GitHub account was recorded, so only their membership of the organization is checked. lost: they can no longer use it, and it allows no repository. It is checked about every hour.

One of: verified, unverified, lost

access_lost_reasonstring | nullrequired

Why the access was lost, when access is lost: left_organization (the person left the organization) or github_access (they lost the access that the connection rests on, on GitHub). null otherwise.

access_checked_atstring | nullrequired

When the access was last checked. null before the first check.

401

The API key is missing, unknown, expired or revoked.

403

The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's.

404

Nothing was found at this address. An organization ID that matches no organization is 404, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is 403, not 404.

429

The key made too many requests. Wait for the number of seconds in Retry-After, then retry.

500

Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the error.requestId.

503

The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.

Example

Shell
curl -sS "https://api.cubecen.com/v1/organizations/<org>/integrations/github/installations" \
  -H "Authorization: Bearer $CUBECEN_API_KEY"
Response
{
  "data": [
    {
      "id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
      "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
      "installation_id": 12345678,
      "account_id": 87654321,
      "account_login": "acme",
      "account_type": "Organization",
      "connected_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
      "verified_at": "2026-09-14T08:25:41Z",
      "repositories_synced_at": "2026-10-25T08:00:12Z",
      "repository_selection": "all",
      "repository_count": 22,
      "created_at": "2026-09-14T08:25:41Z",
      "updated_at": "2026-10-25T08:00:12Z",
      "approval_pending": false,
      "approve_url": null,
      "access": "verified",
      "access_lost_reason": null,
      "access_checked_at": "2026-10-25T09:00:07Z"
    }
  ]
}

List the repositories of an installation

GET/v1/organizations/{org}/integrations/github/installations/{installation-id}/repositories
Full key

Returns one page of the repositories that the organization can use through one GitHub installation. Use it to find the repository to make a cube from. It needs a key with full access, because it serves the creation of cubes.

Name the installation by its id, as listGitHubInstallations gives it. The list holds only the repositories that the organization may use through that installation. A repository that is missing was not chosen for this organization, or the person who connected the installation cannot reach it on GitHub. An owner of the organization can choose repositories and refresh the connection in the Cubecen dashboard.

page counts from 1. total_count is the number of repositories in the whole list, and next_page is the number of the next page, or null on the last page. To search the repositories of all the installations by name, use listGitHubRepositories.

Path parameters

NameTypeDescription
orgrequiredstring

The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with 403, and so is a slug that matches no organization. An ID that matches no organization at all is 404.

installation-idrequiredstring

The id of a GitHub installation, as listGitHubInstallations returns it. It is not the installation_id number that GitHub uses.

Query parameters

NameTypeDescription
pageinteger

The page to return, from 1 to 1000. The default is 1.

per_pageinteger

How many repositories a page holds, from 1 to 100. The default is 30.

Responses

StatusDescription
200

One page of the installation's repositories.

GitHubRepositoryPage object3 fields
dataarray of objectrequired

The repositories on this page.

data items7 fields
idintegerrequired

The repository's ID on GitHub.

ownerstringrequired

The GitHub account that owns the repository.

namestringrequired

The repository's name.

full_namestringrequired

The repository's name with its owner, as owner/name.

privatebooleanrequired

true for a private repository.

default_branchstringrequired

The repository's default branch.

archivedbooleanrequired

true when the repository is archived on GitHub.

total_countintegerrequired

How many repositories the whole list holds.

next_pageinteger | nullrequired

The number of the next page. null on the last page.

400

The request is not valid. error.field names the field to blame, when there is one.

401

The API key is missing, unknown, expired or revoked.

403

The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's.

404

Nothing was found at this address. An organization ID that matches no organization is 404, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is 403, not 404.

422

The request is well formed but cannot be carried out. error.code says why.

429

The key made too many requests. Wait for the number of seconds in Retry-After, then retry.

500

Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the error.requestId.

502

A service Cubecen relies on, such as GitHub, did not answer. Retry the same request with backoff.

503

The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.

Example

Shell
curl -sS "https://api.cubecen.com/v1/organizations/<org>/integrations/github/installations/<installation-id>/repositories" \
  -H "Authorization: Bearer $CUBECEN_API_KEY"
Response
{
  "data": [
    {
      "id": 123456789,
      "owner": "acme",
      "name": "storefront",
      "full_name": "acme/storefront",
      "private": true,
      "default_branch": "main",
      "archived": false
    },
    {
      "id": 234567890,
      "owner": "acme",
      "name": "docs",
      "full_name": "acme/docs",
      "private": false,
      "default_branch": "main",
      "archived": false
    }
  ],
  "total_count": 22,
  "next_page": 2
}

List the repositories of all installations

GET/v1/organizations/{org}/integrations/github/repositories
Full key

Returns the repositories that the organization can use through all its GitHub installations, in one list sorted by full name. Use q to search by name. It needs a key with full access, because it serves the creation of cubes.

Each item says which installation it comes through: installation_id is the id of the installation, as listGitHubInstallations gives it (not GitHub's own number), and account_login is its GitHub account.

The answer holds up to limit repositories in data. When there are more, next_cursor is set: send it back as cursor, with the same q, to get the next page. On the last page next_cursor is null.

Path parameters

NameTypeDescription
orgrequiredstring

The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with 403, and so is a slug that matches no organization. An ID that matches no organization at all is 404.

Query parameters

NameTypeDescription
qstring

Keeps the repositories whose full name, owner/name, contains this text, ignoring case. At most 200 bytes: a character outside plain ASCII takes more than one.

limitinteger

The most repositories to return in a page, from 1 to 100. The default is 30.

cursorstring

Where the next page starts: an opaque value. Send the next_cursor of the previous page as it is, with the same q. Leave it out to get the first page. A value that does not belong to this list is refused with 400.

Responses

StatusDescription
200

One page of repositories.

OrganizationRepositoryPage object2 fields
dataarray of objectrequired

The repositories on this page.

data items9 fields
idintegerrequired

The repository's ID on GitHub.

ownerstringrequired

The GitHub account that owns the repository.

namestringrequired

The repository's name.

full_namestringrequired

The repository's name with its owner, as owner/name.

privatebooleanrequired

true for a private repository.

default_branchstringrequired

The repository's default branch.

archivedbooleanrequired

true when the repository is archived on GitHub.

installation_idstringrequired

The id of the installation the repository comes through, as listGitHubInstallations gives it. It is not GitHub's own number.

account_loginstringrequired

The login of the GitHub account that the installation is on.

next_cursorstring | nullrequired

Send it as cursor to get the next page. null on the last page.

400

The request is not valid. error.field names the field to blame, when there is one.

401

The API key is missing, unknown, expired or revoked.

403

The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's.

404

Nothing was found at this address. An organization ID that matches no organization is 404, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is 403, not 404.

422

The request is well formed but cannot be carried out. error.code says why.

429

The key made too many requests. Wait for the number of seconds in Retry-After, then retry.

500

Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the error.requestId.

502

A service Cubecen relies on, such as GitHub, did not answer. Retry the same request with backoff.

503

The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.

Example

Shell
curl -sS "https://api.cubecen.com/v1/organizations/<org>/integrations/github/repositories" \
  -H "Authorization: Bearer $CUBECEN_API_KEY"
Response
{
  "data": [
    {
      "id": 123456789,
      "owner": "acme",
      "name": "docs",
      "full_name": "acme/docs",
      "private": false,
      "default_branch": "main",
      "archived": false,
      "installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
      "account_login": "acme"
    },
    {
      "id": 234567890,
      "owner": "acme",
      "name": "storefront",
      "full_name": "acme/storefront",
      "private": true,
      "default_branch": "main",
      "archived": false,
      "installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
      "account_login": "acme"
    }
  ],
  "next_cursor": "Zk3vQx9TnWl2RbYc7uHs5dPgAe8MjXo1iNtV4yLq"
}

Look up a public repository

GET/v1/organizations/{org}/integrations/github/public-repository
Full key

Reads a link to a public GitHub repository, and says what a cube made from it would build. No GitHub installation is needed: any public repository can be read. It needs a key with full access, because it serves the creation of cubes.

The link is https://github.com/owner/repo, or https://github.com/owner/repo/tree/branch/folder to name a branch and a folder. The answer holds the repository and its default branch, the branch and the folder that the link names (the default branch and . when it names none), and commit_sha: the commit that a build of that branch would use now.

Lookups are limited to about 30 a minute for the key's owner. A repository that is private, that does not exist or that has moved is refused with 422.

Path parameters

NameTypeDescription
orgrequiredstring

The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with 403, and so is a slug that matches no organization. An ID that matches no organization at all is 404.

Query parameters

NameTypeDescription
urlrequiredstring

The link to a public GitHub repository, as described above. At most 2048 characters. This is the only parameter.

Responses

StatusDescription
200

What a cube made from the link would build.

PublicRepository object7 fields
ownerstringrequired

The GitHub account that owns the repository.

namestringrequired

The repository's name.

urlstringrequired

The address to clone the repository from: https://github.com/owner/name.git.

default_branchstringrequired

The repository's default branch.

branchstringrequired

The branch the link names, or else the default branch.

app_rootstringrequired

The folder the link names, or . for the root of the repository.

commit_shastringrequired

The commit that a build of branch would use now, as 40 hexadecimal characters.

400

The request is not valid. error.field names the field to blame, when there is one.

401

The API key is missing, unknown, expired or revoked.

403

The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's.

404

Nothing was found at this address. An organization ID that matches no organization is 404, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is 403, not 404.

422

The request is well formed but cannot be carried out. error.code says why.

429

The key made too many requests. Wait for the number of seconds in Retry-After, then retry.

500

Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the error.requestId.

502

A service Cubecen relies on, such as GitHub, did not answer. Retry the same request with backoff.

503

The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.

Example

Shell
curl -sS "https://api.cubecen.com/v1/organizations/<org>/integrations/github/public-repository?url=<url>" \
  -H "Authorization: Bearer $CUBECEN_API_KEY"
Response
{
  "owner": "octocat",
  "name": "Hello-World",
  "url": "https://github.com/octocat/Hello-World.git",
  "default_branch": "master",
  "branch": "master",
  "app_root": ".",
  "commit_sha": "7fd1a60b01f91b314f59955a4e4d4e80d8edf11d"
}

List the folders of a repository

GET/v1/organizations/{org}/integrations/github/repository-tree
Full key

Lists the folders of a repository at a branch, tag or commit, so that you can choose the app_root of a cube. It needs a key with full access, because it serves the creation of cubes.

Name the repository in one of two ways, and not both. For a repository of a GitHub installation, send installation_id (the id of the installation) and repository (owner/name). For a public repository, send its link as url.

Each folder has a path, where . is the root of the repository, and markers: the files in it that builders use to recognize what to build, such as a Dockerfile, package.json or go.mod. A folder with markers is likely to hold a cube. pnpm-workspace.yaml marks the root of a monorepo. The folders .git and node_modules are never listed.

ref picks the branch, tag or commit to read. Without it, the branch of a public link is read, or else the default branch of the repository. The answer names the commit it read. A repository with more than 2000 folders is cut short, and truncated is true: the root comes first, then the folders with markers and their parents, then the shallowest folders.

Lookups are limited to about 30 a minute for the key's owner.

Path parameters

NameTypeDescription
orgrequiredstring

The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with 403, and so is a slug that matches no organization. An ID that matches no organization at all is 404.

Query parameters

NameTypeDescription
installation_idstring

For a repository of a GitHub installation: the id of the installation, as listGitHubInstallations gives it. Send it with repository, and without url.

repositorystring

For a repository of a GitHub installation: its name as owner/name, at most 140 characters. Send it with installation_id.

urlstring

For a public repository: its link, https://github.com/owner/repo, which can name a branch and a folder with /tree/branch/folder. At most 2048 characters. Send it without installation_id and repository.

refstring

The branch, tag or commit SHA to read, at most 255 characters. Leave it out for the branch of the link, or else the default branch.

Responses

StatusDescription
200

The folders of the repository at the commit that was read.

RepositoryTree object5 fields
repositorystringrequired

The repository, as owner/name, spelled as GitHub spells it.

refstringrequired

The branch, tag or commit that was read.

commit_shastringrequired

The exact commit that was read, as 40 hexadecimal characters.

directoriesarray of objectrequired

The folders, sorted by path, with the root, ., first.

directories items2 fields
pathstringrequired

The folder's path from the root of the repository, or . for the root.

markersarray of stringrequired

The files in this folder that builders use to recognize what to build, such as Dockerfile, package.json or go.mod. pnpm-workspace.yaml marks the root of a monorepo. Empty when there are none.

truncatedbooleanrequired

true when some folders were left out: the repository has more than 2000, or GitHub cut the list short.

400

The request is not valid. error.field names the field to blame, when there is one.

401

The API key is missing, unknown, expired or revoked.

403

The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's.

404

Nothing was found at this address. An organization ID that matches no organization is 404, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is 403, not 404.

422

The request is well formed but cannot be carried out. error.code says why.

429

The key made too many requests. Wait for the number of seconds in Retry-After, then retry.

500

Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the error.requestId.

502

A service Cubecen relies on, such as GitHub, did not answer. Retry the same request with backoff.

503

The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.

Example

Shell
curl -sS "https://api.cubecen.com/v1/organizations/<org>/integrations/github/repository-tree" \
  -H "Authorization: Bearer $CUBECEN_API_KEY"
Response
{
  "repository": "acme/storefront",
  "ref": "main",
  "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
  "directories": [
    {
      "path": ".",
      "markers": [
        "package.json",
        "pnpm-workspace.yaml"
      ]
    },
    {
      "path": "apps",
      "markers": []
    },
    {
      "path": "apps/api",
      "markers": [
        "Dockerfile",
        "package.json"
      ]
    },
    {
      "path": "apps/web",
      "markers": [
        "package.json"
      ]
    }
  ],
  "truncated": false
}