GitHub API: what you can do and how to use it with AI agents
The GitHub API exposes almost everything you can do in the interface: repositories, issues, pull requests, reviews, Actions, releases and the organization. Engineering, DevOps and automation tools use it. There is a REST and a GraphQL API, with access by personal token, GitHub App or OAuth.
What the GitHub API offers
Repositories and content
Read files, branches and commits, and compare versions.
Issues
Create issues, add labels, assignees, milestones and comments.
Pull requests and reviews
Open, review comments, status and merge.
GitHub Actions
Workflow runs, logs, artifacts and manual dispatch.
Releases
Publish versions with notes and attachments.
Organizations and teams
Members, teams and repository permissions.
Webhooks
Push, PR, issue and workflow events sent to your endpoint.
How to access the GitHub API
- Public APIPersonal access token (preferably fine-grained), a GitHub App installed in the organization, or OAuth. For agents, a GitHub App with per-repository permissions is usually the safest.
- There are hourly request limits: GitHub Apps get higher limits than personal tokens.
- Never give an agent repository admin permission.
- Watch for secrets in logs and code: the agent must not copy them into messages.
Official documentation: docs.github.com/rest
What an iTeam agent does with the GitHub API
Issue triage
The agent reads each new issue, asks for missing information, applies area and priority labels and suggests an owner based on the code history.
PR summary for the reviewer
When a pull request is opened, the agent comments with a summary of the changes, the riskiest files and what to test.
Failed workflow
When CI breaks on main, the agent reads the Actions log, identifies the step and the likely commit, and notifies the team in Slack with the link.
Release notes
At publish time, the agent gathers the PRs merged since the last version and drafts the notes for approval.
From the credential to the agent at work, with approval
Create a GitHub App or fine-grained token
IT defines which repositories and which permissions, for example issues with write access and contents read-only.
Register it in the iTeam vault
The credential stays in the vault and each agent gets only the allowed actions. The triage agent does not merge.
Test with approval
Comments and labels can run directly. Merges, releases and workflow dispatches go through human approval.
Ready-made AI teams for this work
Questions about the GitHub API
Is the GitHub API free?
Generally yes: the API is available on all plans, with usage limits. Features such as Actions consume minutes according to the plan.
Do I need to code to use the GitHub API with iTeam?
Not necessarily. GitHub has a ready-made connector in the catalog, and the deployment team sets up the flows with you.
REST or GraphQL?
Both exist. REST is simpler for one-off actions. GraphQL helps fetch a lot of related data in a single call.