Skip to main content
POST
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

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

Request Body

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

Response Fields

boolean
true when the token was validated and stored successfully.
string
GitHub username confirmed by the token.

Error Codes