Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Apps

List the branches of a GitHub repo

The branches of a repo that Troopy's GitHub App reaches, 500 at most: the default branch first, then the others by name. Sessions takes one of them for its bug tickets.

get/api/v1/apps/github/branches

Authorization

HeaderAuthorization: Bearer <API key>
Or the headerX-API-Key: <API key>
API keyMake one in Troopy under Settings > API keys. It acts as you, in its workspace.
Scopesapps:read

Other ways to call it

CLItroopy github branches
MCP tooltroopy_list_branches
Rate limit30 calls in 60 seconds, for each key

Query parameters

repo*string

owner/name

Response

200 · application/json
data*object
3 properties
repo*string

owner/name

defaultBranch*string
branches*array<string>

The default branch first

Errors

400 invalid_inputFix the field named in detail. Each operation's schema is in /api/v1/openapi.json.
401 unauthorizedSend an API key as `Authorization: Bearer tr_live_...`. Create one in Troopy under Settings.
403 forbiddenThe key lacks a scope this operation needs, or its owner lacks the role. detail says which; create a key with the scope, or ask an organization owner or admin.
429 rate_limitedWait the number of seconds in Retry-After, then retry.