Disconnect GitHub

DELETEhttps://agent.blackbox.ai/api/v1/git/clean

Revoke and purge all stored GitHub tokens associated with your account. Clears both the database token and all GitHub-related cookies.

This endpoint permanently removes all GitHub tokens linked to your BLACKBOX account. After calling this endpoint, agent tasks that require GitHub access will fail until you reconnect via POST /api/v1/git/config.

This action is irreversible. All stored GitHub tokens will be deleted. You will need to provide a new GitHub personal access token to re-enable repository access.

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

successboolean

true when all tokens were purged successfully.

messagestring

Human-readable confirmation message.

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

const response = await fetch(
  "https://agent.blackbox.ai/api/v1/git/clean",
  {
    method: "DELETE",
    headers: { Authorization: `Bearer ${API_KEY}` },
  }
);

const data = await response.json();
console.log(data.message);
import requests

API_KEY = "YOUR_API_KEY"

response = requests.delete(
    "https://agent.blackbox.ai/api/v1/git/clean",
    headers={"Authorization": f"Bearer {API_KEY}"},
)
data = response.json()
print(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/clean"

    req, _ := http.NewRequest("DELETE", 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.Println(result["message"])
}
Response Example
{
  "success": true,
  "message": "GitHub access tokens purged successfully"
}

Error Codes

Status Code Error Description
200 Success All GitHub tokens purged
401 Unauthorized Invalid or missing API key
403 Forbidden Pro subscription required
500 Internal Server Error Failed to purge tokens