Appearance
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
| Action | Required Permission | Scope |
|---|---|---|
| List a project's repositories, list a linked repository's branches | Project access | In accessible projects |
| Link or unlink a repository | Projects: Update (Own/All) | Not with a project token |
| List your GitHub repositories and their branches | Signed in | Your own GitHub connection |
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /api/projects/{projectId}/github-repos | List the repositories linked to a project |
POST | /api/projects/{projectId}/github-repos | Link a repository to a project |
DELETE | /api/projects/{projectId}/github-repos/{repoId} | Unlink a repository |
GET | /api/projects/{projectId}/github-repos/{repoId}/branches | List a linked repository's branches |
GET | /api/github/repositories | List the repositories your GitHub connection can see |
GET | /api/github/repositories/{owner}/{repo}/branches | List a repository's branches |
The Linked Repository Object
| Field | Type | Description |
|---|---|---|
id | integer | Link ID, the {repoId} in the paths above |
project_id | integer | The project |
repo_full_name | string | owner/name |
repo_url | string | Repository URL |
default_branch | string | Default branch |
owner | string | Owner part of the name |
repo_name | string | Name part |
branch_links_count | integer | Branch 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
}
]Link a Repository
POST /api/projects/{projectId}/github-repos
| Field | Type | Required | Description |
|---|---|---|---|
repo_full_name | string | Yes | owner/name, not yet linked to this project |
repo_url | string | Yes | A URL |
default_branch | string | Yes | Max 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.
Unlink a Repository
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
| Status | Cause |
|---|---|
401 | You have not connected GitHub (Github not connected) — on the repository and branch lists |
403 | The caller lacks the permission above, uses a project token on link or unlink, or the GitHub App ownership check failed |
422 | The repository is already linked to this project, or a field is missing or malformed |
See Also
- Branch Links API — Link branches to issues
- GitHub integration