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"
}
GitHub Integration
GitHub Connection Status
Check whether your GitHub account is connected and verify that your stored token is valid.
GET
/
api
/
v1
/
git
/
status
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"
}
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
sk-xxxxxxxxxxxxxxxxxxxxxx
Headers
string
required
API Key of the form
Bearer <api_key>.Example: Bearer sk_b41b647ffbfed27f616560Response Fields
Connected
boolean
true when a valid GitHub token is stored.string
GitHub username of the connected account.
string | null
Display name of the GitHub user.
string | null
Primary email address of the GitHub user (if public).
string
URL of the GitHub user’s avatar image.
string
Comma-separated list of OAuth scopes granted by the token (e.g.
"repo,user").number
Number of public repositories owned by the user.
number
Number of private repositories owned by the user.
boolean
Whether the stored token successfully authenticated with GitHub.
Not Connected
boolean
false when no token is stored or the token is invalid.string
Human-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 |