GitHub Connection Status
https://agent.blackbox.ai/api/v1/git/statusCheck whether your GitHub account is connected and verify that your stored token is valid.
This endpoint validates the stored GitHub token by calling the GitHub API and returns the connected account's profile information. Use this to confirm your GitHub integration is active before creating tasks that work with repositories.
This endpoint requires a Pro subscription. Ensure your BLACKBOX account is on the Pro plan before calling GitHub integration endpoints.
Authentication
To use this API, you need a BLACKBOX API Key. Follow these steps to get your API key:
- Go to app.blackbox.ai/agent-api and click Get an API Key (requires a Pro subscription)
- Once provisioning completes, you will be redirected to your Dashboard
- 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
AuthorizationstringrequiredAPI Key of the form Bearer <api_key>.
Example: Bearer sk_b41b647ffbfed27f616560
Response Fields
Connected
connectedbooleantrue when a valid GitHub token is stored.
loginstringGitHub username of the connected account.
namestring | nullDisplay name of the GitHub user.
emailstring | nullPrimary email address of the GitHub user (if public).
avatarUrlstringURL of the GitHub user's avatar image.
scopesstringComma-separated list of OAuth scopes granted by the token (e.g. "repo,user").
publicReposnumberNumber of public repositories owned by the user.
privateReposnumberNumber of private repositories owned by the user.
tokenValidbooleanWhether the stored token successfully authenticated with GitHub.
Not Connected
connectedbooleanfalse when no token is stored or the token is invalid.
messagestringHuman-readable explanation (e.g. "No GitHub token found").
curl 'https://agent.blackbox.ai/api/v1/git/status' \
-H 'Authorization: Bearer YOUR_API_KEY'const API_KEY = "YOUR_API_KEY";
const response = await fetch(
"https://agent.blackbox.ai/api/v1/git/status",
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
const data = await response.json();
if (data.connected) {
console.log(`Connected as: ${data.login}`);
console.log(`Scopes: ${data.scopes}`);
} else {
console.log("GitHub not connected:", data.message);
}import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://agent.blackbox.ai/api/v1/git/status",
headers={"Authorization": f"Bearer {API_KEY}"},
)
data = response.json()
if data["connected"]:
print(f"Connected as: {data['login']}")
print(f"Scopes: {data['scopes']}")
else:
print(f"Not connected: {data['message']}")package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
apiKey := "YOUR_API_KEY"
url := "https://agent.blackbox.ai/api/v1/git/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer "+apiKey)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result map[string]interface{}
json.Unmarshal(body, &result)
if result["connected"] == true {
fmt.Printf("Connected as: %s\n", result["login"])
} else {
fmt.Printf("Not connected: %s\n", result["message"])
}
}{
"connected": true,
"login": "octocat",
"name": "The Octocat",
"email": "octocat@github.com",
"avatarUrl": "https://avatars.githubusercontent.com/u/583231",
"scopes": "repo,user",
"publicRepos": 8,
"privateRepos": 3,
"tokenValid": true
}{
"connected": false,
"message": "No GitHub token found"
}Error Codes
| Status Code | Error | Description |
|---|---|---|
| 200 | Success | Status returned (connected or not) |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Pro subscription required |
| 500 | Internal Server Error | Failed to validate token |