List repositories for a repository connection
The repository connections API endpoint lets you list repositories available to a repository connection in your organization.
List repositories
Returns the repositories available to the specified repository connection, in provider order.
This endpoint is supported for GitHub, GitHub Limited Access, GitHub Restricted, GitHub Enterprise Server (GHES), Origin, and Entire connections. For Bitbucket Server, GitLab Self-Managed, and GHES Legacy connections, the endpoint returns 422 Unprocessable Entity.
For Entire connections, clone_url is the native entire:// URL and default_branch is an empty string. Select the repository in the Buildkite pipeline editor to associate it with the connection. Supplying its URL through the pipelines REST API does not establish that association.
curl -H "Authorization: Bearer $TOKEN" \
-X GET "https://api.buildkite.com/v2/organizations/{org.slug}/repository_connections/{repository_connection.id}/repositories"
[
{
"full_name": "acme/widgets",
"html_url": "https://github.com/acme/widgets",
"clone_url": "https://github.com/acme/widgets.git",
"default_branch": "main"
},
{
"full_name": "acme/gadgets",
"html_url": "https://github.com/acme/gadgets",
"clone_url": "https://github.com/acme/gadgets.git",
"default_branch": "trunk"
}
]
Repository data model
full_name |
Full name of the repository in owner/repo format |
|---|---|
html_url |
URL of the repository on the source control provider |
clone_url |
Clone URL for the repository. HTTPS for most providers, or the native entire:// URL for Entire. |
default_branch |
Default branch of the repository. An empty string for Entire. |
Query parameters
repository |
Optional. Filter results to the repository whose full_name matches this value (case-insensitive exact match). Returns an empty list if no repository matches. Returns 400 Bad Request if the value is not a string.
|
|---|
Required scope: read_organization_repository_connections
Required permission: organization administrator privileges (the change_organization permission)
Success response: 200 OK
Error responses:
-
400 Bad Request: malformed connection ID, or therepositoryparameter is not a string -
403 Forbidden: the token does not have theread_organization_repository_connectionsscope, or the authenticated user does not have thechange_organizationpermission -
404 Not Found: connection not found or belongs to another organization -
422 Unprocessable Entity: the connection type does not support repository listing -
503 Service Unavailable: the upstream source control provider is temporarily unavailable; may include aRetry-Afterresponse header indicating when to retry