TofuPilotTofuPilot
DashboardApiV2Github

Get GitHub installation token

Generate a short-lived GitHub installation access token for authenticated API calls. Returns null if no GitHub App is installed for the organization.

Access

API KeyAccess LevelDescription
UserFullUsers have full access to githubs
StationUnauthorizedStations cannot read githubs

Endpoint

GET/v2/github/installation-token
AuthorizationBearer <token>

API key for authentication. Use format: Bearer YOUR_API_KEY

In: header

Response Body

from tofupilot.v2 import TofuPilot

# Initialize the TofuPilot client
client = TofuPilot()

# Execute the operation
result = client.github.get_installation_token()

# Handle response
print(result)
{
  "token": "ghs_xxxxxxxxxxxxxxxxxxxx",
  "expires_at": "2024-01-15T11:30:00Z"
}
{
  "message": "Forbidden",
  "code": "FORBIDDEN",
  "issues": []
}
{
  "code": "PRECONDITION_FAILED",
  "message": "GITHUB_INSTALLATION_SUSPENDED",
  "issues": []
}
{
  "message": "Internal server error",
  "code": "INTERNAL_SERVER_ERROR",
  "issues": []
}

How is this guide?