Get GitHub Config

GEThttps://agent.blackbox.ai/api/v1/git/config

Returns the GitHub account linked to your BLACKBOX API key, or { connected: false } if no token is stored.

This endpoint returns the GitHub account connected to your BLACKBOX API key. Use it to check which GitHub user is linked before creating tasks that work with repositories.

This endpoint requires a Pro subscription.

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

Authorizationstringrequired

API Key of the form Bearer <api_key>.

Example: Bearer sk_b41b647ffbfed27f616560

Response Fields

connectedboolean

true if a valid GitHub token is stored, false otherwise.

loginstring

GitHub username. Present when connected: true.

namestring | null

Display name of the GitHub user.

emailstring | null

Primary email of the GitHub user.

avatarUrlstring

GitHub avatar URL.

scopesstring

OAuth scopes granted by the token (e.g. "repo,user").

tokenCreatedAtstring | null

ISO 8601 timestamp when the token was stored. null if not recorded.

Request Example
curl 'https://agent.blackbox.ai/api/v1/git/config' \
  -H 'Authorization: Bearer YOUR_API_KEY'
const API_KEY = "YOUR_API_KEY";

const response = await fetch(
  "https://agent.blackbox.ai/api/v1/git/config",
  { headers: { Authorization: `Bearer ${API_KEY}` } }
);
const data = await response.json();
console.log(data.connected ? `Connected as ${data.login}` : "Not connected");
import requests

API_KEY = "YOUR_API_KEY"

response = requests.get(
    "https://agent.blackbox.ai/api/v1/git/config",
    headers={"Authorization": f"Bearer {API_KEY}"},
)
data = response.json()
print(f"Connected: {data['connected']}")
if data["connected"]:
    print(f"Login: {data['login']}")
package main

import (
    "encoding/json"
    "fmt"
    "io"
    "net/http"
)

func main() {
    apiKey := "YOUR_API_KEY"
    url := "https://agent.blackbox.ai/api/v1/git/config"

    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)
    fmt.Printf("Connected: %v\n", result["connected"])
}
Response Example
{
  "connected": true,
  "login": "octocat",
  "name": "The Octocat",
  "email": "octocat@github.com",
  "avatarUrl": "https://avatars.githubusercontent.com/u/583231",
  "scopes": "repo,user",
  "tokenCreatedAt": "2026-05-01T12:00:00.000Z"
}
{
  "connected": false
}

Error Codes

Status Code Error Description
200 Success Config returned
401 Unauthorized Invalid or missing API key
403 Forbidden Pro subscription required
500 Internal Server Error Failed to retrieve config