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"])
}
{
"success": true,
"message": "GitHub access tokens purged successfully"
}
GitHub Integration
Disconnect GitHub
Revoke and purge all stored GitHub tokens associated with your account. Clears both the database token and all GitHub-related cookies.
DELETE
/
api
/
v1
/
git
/
clean
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"])
}
{
"success": true,
"message": "GitHub access tokens purged successfully"
}
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:- 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
boolean
true when all tokens were purged successfully.string
Human-readable confirmation message.
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"])
}
{
"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 |