Skip to main content
GET
This endpoint returns all branches for a given GitHub repository, along with the repository’s default branch. Use the protected_only parameter to filter to branches with branch protection rules enabled.
This endpoint requires a Pro subscription and a connected GitHub account.

Authentication

To use this API, you need a BLACKBOX API Key. Follow these steps to get your API key:
  1. Go to app.blackbox.ai/agent-api and click Get an API Key (requires a Pro subscription)
  2. Once provisioning completes, you will be redirected to your Dashboard
  3. From the Dashboard, create an API key to use with all Agent API requests
Your API key will be in the format: sk-xxxxxxxxxxxxxxxxxxxxxx

Headers

string
required
API Key of the form Bearer <api_key>.Example: Bearer sk_b41b647ffbfed27f616560

Query Parameters

string
required
Repository owner (GitHub username or organization name).Example: owner=octocat
string
required
Repository name.Example: repo=my-app
boolean
default:"false"
When true, returns only branches with branch protection rules enabled.Default: falseExample: protected_only=true

Response Fields

array
Array of branch objects.
string
The repository’s default branch name (e.g. "main").
number
Total number of branches returned.

Error Codes