repositories
16 endpoints
get /bugs/{id}/repositories
List a bug's attached repositories
Requires authentication
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Bug id |
Responses
- 200 OK · object
- 403 Forbidden · apimodel.ErrorEnvelope
put /bugs/{id}/repositories
Replace a bug's repository set
Requires authentication
Atomically replaces the full set of repos attached to a bug. Every repo must be in the bug's org.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Bug id |
Request body: handler.PutBugRepositoriesRequest
| Name | Type | Required | Description |
|---|---|---|---|
| repositoryIds | integer[] | no | |
| targetBranches | map<string> | no |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
patch /bugs/{id}/repositories/{repoId}
Update a bug↔repository link
Requires authentication
Single-column update on the bug_repositories join row — today only prStatus (e.g. mark a branch-only push manually merged).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Bug id |
| repoId | path | integer | yes | Repository id |
Request body: handler.UpdateBugRepoRequest
| Name | Type | Required | Description |
|---|---|---|---|
| prStatus | string | no |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
get /orgs/{id}/repositories
List an org's repositories
Requires authentication
Every repo attached to the org, enriched with live fileCount / jobStatus / lastIndexedAt. Org admin only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Responses
- 200 OK · object
- 403 Forbidden · apimodel.ErrorEnvelope
post /orgs/{id}/repositories
Connect a generic-git repository to the org pool
Requires authentication
Org-admin-gated generic-git create. Same body as the project-scoped create; the row's org comes from the URL.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Request body: handler.CreateGenericRequest
| Name | Type | Required | Description |
|---|---|---|---|
| cloneUrl | string | no | |
| credential | handler.CreateGenericCredential | no | |
| defaultBranch | string | no | |
| host | string | no | |
| indexedBranch | string | no | |
| isPrimary | boolean | no | |
| name | string | no | |
| owner | string | no | |
| provider | string | no | "git_ssh" | "git_https" |
Responses
- 201 Created · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
get /projects/{id}/commit-activity
Get a project's commit-activity heatmap
Requires authentication
Merged daily commit counts across all connected repos for the trailing ~year, plus a syncing flag when a background refresh was kicked off.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Project id |
Responses
- 200 OK · object
- 403 Forbidden · apimodel.ErrorEnvelope
get /projects/{id}/repositories
List a project's repositories
Requires authentication
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Project id |
Responses
- 200 OK · object
- 403 Forbidden · apimodel.ErrorEnvelope
post /projects/{id}/repositories
Connect a generic-git repository to a project
Requires authentication
Persists an encrypted credential + repository row and runs a best-effort connection test. Project admin only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Project id |
Request body: handler.CreateGenericRequest
| Name | Type | Required | Description |
|---|---|---|---|
| cloneUrl | string | no | |
| credential | handler.CreateGenericCredential | no | |
| defaultBranch | string | no | |
| host | string | no | |
| indexedBranch | string | no | |
| isPrimary | boolean | no | |
| name | string | no | |
| owner | string | no | |
| provider | string | no | "git_ssh" | "git_https" |
Responses
- 201 Created · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
post /projects/{id}/repositories/test-connection
Test a generic-git connection
Requires authentication
Runs an ls-remote against the supplied credentials without persisting anything. Project admin only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Project id |
Request body: handler.CreateGenericRequest
| Name | Type | Required | Description |
|---|---|---|---|
| cloneUrl | string | no | |
| credential | handler.CreateGenericCredential | no | |
| defaultBranch | string | no | |
| host | string | no | |
| indexedBranch | string | no | |
| isPrimary | boolean | no | |
| name | string | no | |
| owner | string | no | |
| provider | string | no | "git_ssh" | "git_https" |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
get /projects/{id}/repository-preferences
List a project's repository preferences
Requires authentication
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Project id |
Responses
- 200 OK · object
- 403 Forbidden · apimodel.ErrorEnvelope
put /projects/{id}/repository-preferences
Replace a project's repository preferences
Requires authentication
Atomically replaces the project's default-for-bugs repo set. Project admin only; every repo must be in the project's org.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Project id |
Request body: handler.PutProjectPreferencesRequest
| Name | Type | Required | Description |
|---|---|---|---|
| defaultRepositoryIds | integer[] | no |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
get /projects/{id}/sshkey/preview
Preview a generated SSH deploy key
Requires authentication
Generates a throwaway keypair so the UI can show "this is what we'll generate". The private half is dropped immediately. Project admin only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Project id |
Responses
- 200 OK · object
- 403 Forbidden · apimodel.ErrorEnvelope
- 404 Not Found · apimodel.ErrorEnvelope
patch /repositories/{id}
Update a repository
Requires authentication
Mutates indexedBranch and/or isPrimary. Requires org admin. Returns the updated repository.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Repository id |
Request body: handler.UpdateRepoRequest
| Name | Type | Required | Description |
|---|---|---|---|
| indexedBranch | string | no | |
| isPrimary | boolean | no |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
- 404 Not Found · apimodel.ErrorEnvelope
delete /repositories/{id}
Delete a repository
Requires authentication
Removes a repo from the org (cascades to bug + preference links). Requires org admin.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Repository id |
Responses
- 200 OK · object
- 403 Forbidden · apimodel.ErrorEnvelope
- 404 Not Found · apimodel.ErrorEnvelope
get /repositories/{id}/branches
List a repository's branches
Requires authentication
Lists branches for a github_app repo. Other providers return an empty list plus a hint. Any org member.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Repository id |
Responses
- 200 OK · object
- 404 Not Found · apimodel.ErrorEnvelope
post /repositories/{id}/reindex
Reindex a repository
Requires authentication
Enqueues (or coalesces onto) an index job for the repo's indexed branch. Requires org admin.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Repository id |
Responses
- 200 OK · object
- 403 Forbidden · apimodel.ErrorEnvelope
- 404 Not Found · apimodel.ErrorEnvelope