API Reference

GitHub

The GitHub integration connects a user's GitHub account with a personal access token, so agents can work with the repositories that account can reach. The connection is scoped to the user who created it. To index repository content for agent search, see Vectorise GitHub data on the knowledge index page.

Connect GitHub

POST /api/github/connect

Connects GitHub with a personal access token after validating it.

Validates the personal access token against GitHub, then stores it against the caller. After connecting, choose a repository to index with Vectorise GitHub data.

Authentication
Bearer token How it works

Body parameters application/json

  • token string Required

    GitHub personal access token.

Returns

Returns success: true and a confirmation message.

Errors

  • 400 No token was provided.
  • 401 GitHub rejected the token.
Request
curl -X POST "$VDF_BASE_URL/api/github/connect" \
  -H "Authorization: Bearer $VDF_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "<ACCESS_TOKEN>"
  }'
Response 200
{
  "success": true,
  "message": "Successfully connected to GitHub. Please select a repository to vectorize."
}

Check GitHub status

GET /api/github/status

Returns whether the caller has connected GitHub.

Reports whether the caller has a stored GitHub connection. The token is never returned.

Authentication
Bearer token How it works

Parameters

No parameters.

Returns

Returns isConnected, which is true when a GitHub token is stored for you.

Request
curl "$VDF_BASE_URL/api/github/status" \
  -H "Authorization: Bearer $VDF_ACCESS_TOKEN"
Response 200
{
  "success": true,
  "isConnected": true
}

List repositories

GET /api/github/repositories

Returns the repositories the connected GitHub token can access, including private and organisation repositories, most recently updated first.

Authentication
Bearer token How it works

Parameters

No parameters.

Returns

Returns an array of repositories.

Errors

  • 401 GitHub is not connected for the caller.
Request
curl "$VDF_BASE_URL/api/github/repositories" \
  -H "Authorization: Bearer $VDF_ACCESS_TOKEN"
Response 200
[
  {
    "id": 123456789,
    "name": "api",
    "full_name": "acme/api",
    "private": true,
    "description": "Public API service",
    "url": "https://github.example.com/acme/api"
  }
]

Disconnect GitHub

POST /api/github/disconnect

Removes the caller's stored GitHub connection.

Authentication
Bearer token How it works

Parameters

No parameters.

Returns

Returns success: true and a confirmation message.

Request
curl -X POST "$VDF_BASE_URL/api/github/disconnect" \
  -H "Authorization: Bearer $VDF_ACCESS_TOKEN"
Response 200
{
  "success": true,
  "message": "Successfully disconnected from GitHub"
}