Skip to main content
POST
/
api
/
v1
/
git
/
config
curl -X POST 'https://agent.blackbox.ai/api/v1/git/config' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ "githubToken": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }'
{
  "success": true,
  "login": "octocat"
}
This endpoint validates a GitHub personal access token against the GitHub API and stores it for future agent tasks. If a token is already stored, it is replaced.
This endpoint requires a Pro subscription. Required GitHub token scopes: repo (for private repos) and user (for profile info).

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

Authorization
string
required
API Key of the form Bearer <api_key>.Example: Bearer sk_b41b647ffbfed27f616560
Content-Type
string
required
Must be application/json.

Request Body

githubToken
string
required
A GitHub personal access token (classic or fine-grained).Example: "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Response Fields

success
boolean
true when the token was validated and stored successfully.
login
string
GitHub username confirmed by the token.
curl -X POST 'https://agent.blackbox.ai/api/v1/git/config' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ "githubToken": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }'
{
  "success": true,
  "login": "octocat"
}

Error Codes

Status CodeErrorDescription
200SuccessToken validated and stored
400Bad RequestMissing githubToken or token rejected by GitHub
401UnauthorizedInvalid or missing API key
403ForbiddenPro subscription required
500Internal Server ErrorFailed to validate or store token