Skip to content

GitHub Repositories API ​

A project links one or more GitHub repositories, so its issues can link branches. The repository and branch lists come from GitHub through your GitHub connection: connect GitHub in your profile settings first. See GitHub integration.

Permissions ​

ActionRequired PermissionScope
List a project's repositories, list a linked repository's branchesProject accessIn accessible projects
Link or unlink a repositoryProjects: Update (Own/All)Not with a project token
List your GitHub repositories and their branchesSigned inYour own GitHub connection

Endpoints ​

MethodEndpointDescription
GET/api/projects/{projectId}/github-reposList the repositories linked to a project
POST/api/projects/{projectId}/github-reposLink a repository to a project
DELETE/api/projects/{projectId}/github-repos/{repoId}Unlink a repository
GET/api/projects/{projectId}/github-repos/{repoId}/branchesList a linked repository's branches
GET/api/github/repositoriesList the repositories your GitHub connection can see
GET/api/github/repositories/{owner}/{repo}/branchesList a repository's branches

The Linked Repository Object ​

FieldTypeDescription
idintegerLink ID, the {repoId} in the paths above
project_idintegerThe project
repo_full_namestringowner/name
repo_urlstringRepository URL
default_branchstringDefault branch
ownerstringOwner part of the name
repo_namestringName part
branch_links_countintegerBranch links on this repository

List Linked Repositories ​

GET /api/projects/{projectId}/github-repos

bash
curl https://{tenant}.kendo.dev/api/projects/1/github-repos \
  -H "Authorization: Bearer your-token"
json
[
  {
    "id": 4,
    "project_id": 1,
    "repo_full_name": "acme/web",
    "repo_url": "https://github.com/acme/web",
    "default_branch": "main",
    "owner": "acme",
    "repo_name": "web",
    "branch_links_count": 12
  }
]

POST /api/projects/{projectId}/github-repos

FieldTypeRequiredDescription
repo_full_namestringYesowner/name, not yet linked to this project
repo_urlstringYesA URL
default_branchstringYesMax 255 characters
bash
curl -X POST https://{tenant}.kendo.dev/api/projects/1/github-repos \
  -H "Authorization: Bearer your-token" \
  -H "Content-Type: application/json" \
  -d '{"repo_full_name": "acme/web", "repo_url": "https://github.com/acme/web", "default_branch": "main"}'

Returns the link with 201 Created. When the repository's owner has installed the kendo GitHub App and the installation is not yet claimed by a workspace, linking claims it for yours, and only after kendo has verified that you own or administer that GitHub account. A failed check returns 403.

DELETE /api/projects/{projectId}/github-repos/{repoId}

Removes the link and every branch link on it. Returns 204 No Content.

bash
curl -X DELETE https://{tenant}.kendo.dev/api/projects/1/github-repos/4 \
  -H "Authorization: Bearer your-token"

List Branches ​

GET /api/projects/{projectId}/github-repos/{repoId}/branches

GET /api/github/repositories/{owner}/{repo}/branches

Both return the branch names GitHub reports for the repository, read through your GitHub connection.

json
[{"name": "main"}, {"name": "KD-0042-fix-login"}]

List Your GitHub Repositories ​

GET /api/github/repositories

Returns the repositories your GitHub connection can see. When the workspace has the GitHub App installed on one or more accounts, only repositories owned by those accounts are returned.

json
[
  {
    "id": 123456,
    "full_name": "acme/web",
    "name": "web",
    "owner": "acme",
    "html_url": "https://github.com/acme/web",
    "description": "Marketing site",
    "private": true,
    "default_branch": "main"
  }
]

Error Responses ​

StatusCause
401You have not connected GitHub (Github not connected) — on the repository and branch lists
403The caller lacks the permission above, uses a project token on link or unlink, or the GitHub App ownership check failed
422The repository is already linked to this project, or a field is missing or malformed

See Also ​