Skip to content

All resources

repositories

16 endpoints

get /bugs/{id}/repositories

List a bug's attached repositories

Requires authentication

Parameters

NameInTypeRequiredDescription
idpathintegeryesBug 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

NameInTypeRequiredDescription
idpathintegeryesBug id

Request body: handler.PutBugRepositoriesRequest

NameTypeRequiredDescription
repositoryIdsinteger[]no
targetBranchesmap<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

NameInTypeRequiredDescription
idpathintegeryesBug id
repoIdpathintegeryesRepository id

Request body: handler.UpdateBugRepoRequest

NameTypeRequiredDescription
prStatusstringno

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

NameInTypeRequiredDescription
idpathintegeryesOrganization 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

NameInTypeRequiredDescription
idpathintegeryesOrganization id

Request body: handler.CreateGenericRequest

NameTypeRequiredDescription
cloneUrlstringno
credentialhandler.CreateGenericCredentialno
defaultBranchstringno
hoststringno
indexedBranchstringno
isPrimarybooleanno
namestringno
ownerstringno
providerstringno"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

NameInTypeRequiredDescription
idpathintegeryesProject id

Responses

  • 200 OK · object
  • 403 Forbidden · apimodel.ErrorEnvelope

get /projects/{id}/repositories

List a project's repositories

Requires authentication

Parameters

NameInTypeRequiredDescription
idpathintegeryesProject 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

NameInTypeRequiredDescription
idpathintegeryesProject id

Request body: handler.CreateGenericRequest

NameTypeRequiredDescription
cloneUrlstringno
credentialhandler.CreateGenericCredentialno
defaultBranchstringno
hoststringno
indexedBranchstringno
isPrimarybooleanno
namestringno
ownerstringno
providerstringno"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

NameInTypeRequiredDescription
idpathintegeryesProject id

Request body: handler.CreateGenericRequest

NameTypeRequiredDescription
cloneUrlstringno
credentialhandler.CreateGenericCredentialno
defaultBranchstringno
hoststringno
indexedBranchstringno
isPrimarybooleanno
namestringno
ownerstringno
providerstringno"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

NameInTypeRequiredDescription
idpathintegeryesProject 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

NameInTypeRequiredDescription
idpathintegeryesProject id

Request body: handler.PutProjectPreferencesRequest

NameTypeRequiredDescription
defaultRepositoryIdsinteger[]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

NameInTypeRequiredDescription
idpathintegeryesProject 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

NameInTypeRequiredDescription
idpathintegeryesRepository id

Request body: handler.UpdateRepoRequest

NameTypeRequiredDescription
indexedBranchstringno
isPrimarybooleanno

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

NameInTypeRequiredDescription
idpathintegeryesRepository 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

NameInTypeRequiredDescription
idpathintegeryesRepository 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

NameInTypeRequiredDescription
idpathintegeryesRepository id

Responses

  • 200 OK · object
  • 403 Forbidden · apimodel.ErrorEnvelope
  • 404 Not Found · apimodel.ErrorEnvelope