2.5 KiB
2.5 KiB
GitHub Routing Reference
App name: github
Base URL proxied: api.github.com
API Path Pattern
/github/{resource}
GitHub API does not use a version prefix in paths. Versioning is handled via the X-GitHub-Api-Version header.
Common Endpoints
Get Authenticated User
GET /github/user
Get User by Username
GET /github/users/{username}
List User Repositories
GET /github/user/repos?per_page=30&sort=updated
Get Repository
GET /github/repos/{owner}/{repo}
List Repository Contents
GET /github/repos/{owner}/{repo}/contents/{path}
List Branches
GET /github/repos/{owner}/{repo}/branches
List Commits
GET /github/repos/{owner}/{repo}/commits?per_page=30
List Repository Issues
GET /github/repos/{owner}/{repo}/issues?state=open&per_page=30
Create Issue
POST /github/repos/{owner}/{repo}/issues
Content-Type: application/json
{
"title": "Issue title",
"body": "Issue description",
"labels": ["bug"]
}
List Pull Requests
GET /github/repos/{owner}/{repo}/pulls?state=open&per_page=30
Create Pull Request
POST /github/repos/{owner}/{repo}/pulls
Content-Type: application/json
{
"title": "PR title",
"body": "PR description",
"head": "feature-branch",
"base": "main"
}
Merge Pull Request
PUT /github/repos/{owner}/{repo}/pulls/{pull_number}/merge
Content-Type: application/json
{
"merge_method": "squash"
}
Search Repositories
GET /github/search/repositories?q={query}&per_page=30
Search Issues
GET /github/search/issues?q={query}&per_page=30
Get Rate Limit
GET /github/rate_limit
Notes
- Repository names are case-insensitive but the API preserves case
- Issue numbers and PR numbers share the same sequence per repository
- File content must be Base64 encoded when creating/updating files
- Rate limits: 5000 requests/hour for authenticated users, 30 searches/minute
- Pagination uses
per_page(max 100, default 30) andpageparameters - Some endpoints require specific OAuth scopes (e.g.,
read:orgfor organization operations)