GitHub APIs
Get GitHub Branches
Retrieve all branches from a specific GitHub repository.
GET
This endpoint returns a list of all branches in a specified GitHub repository, including branch names, protection status, and default branch information.Documentation Index
Fetch the complete documentation index at: https://docs.blackbox.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
To use this API, you need a BLACKBOX API Key. Follow these steps to get your API key:- Click on your Profile Image in the top right corner at cloud.blackbox.ai
- Click on “BLACKBOX API Token” from the dropdown menu
- Copy the existing token or click “Generate” if you don’t have one yet
bb_xxxxxxxxxxxxxxxxxxxxxx
Headers
API Key of the form
Bearer <api_key>.Example: Bearer bb_b41b647ffbfed27f61656049d3eaeef3d903cc503345d9eb80080d98bc0Query Parameters
The GitHub username or organization name that owns the repository.Example:
example-user or example-orgThe repository name from which to retrieve branches.Example:
example-repoResponse
The endpoint returns an array of branch objects.The name of the branch.
Whether the branch is protected from force pushes and deletion.
Whether this is the default branch of the repository (typically
main or master).Error Codes
| Status Code | Error | Description |
|---|---|---|
| 200 | Success | Branches retrieved successfully |
| 400 | Bad Request | Missing required parameters: owner and repo |
| 401 | Unauthorized | Invalid or missing API key |
| 404 | Not Found | GitHub token not found, expired, or repository not found |
| 502 | Bad Gateway | GitHub API error occurred |
| 500 | Internal Server Error | Database or server error occurred |