GitHub REST API collection template
Repositories, issues, pull requests, commits and Actions runs with the GitHub REST API.
What's inside
Everyday GitHub REST API calls: who am I, my repositories, issues and pull requests of a repository, recent commits and GitHub Actions runs, plus search. Set owner and repo to point every request at your repository.
13 requests in 4 folders · Base URL https://api.github.com · Bearer token
Set it up
- Open GitHub REST API in Requestarium (or in the app: Import, Start from a template) and import it. You get the collection and a "GitHub REST API" environment.
- Create a fine-grained personal access token at github.com/settings/tokens with read access to the repository (and Issues write access to create issues).
- Fill in the environment, pick it in the environment menu and send the first request.
Environment variables
| Variable | What it is |
|---|---|
githubTokensecret | Personal access token. |
owner | User or organization that owns the repository. |
repo | Repository name. |
issueNumber | Filled by "Create an issue". |
Requests
Users
- GETGet the authenticated user
/userThe account the token belongs to; a quick way to check the token.
- GETList my repositories
/user/reposRepositories you can access, recently updated first.
- GETRate limit
/rate_limitHow many requests you have left this hour.
Repositories
- GETGet a repository
/repos/{{owner}}/{{repo}}Stars, default branch, visibility and more.
- GETList commits
/repos/{{owner}}/{{repo}}/commitsThe latest commits on the default branch.
- GETList branches
/repos/{{owner}}/{{repo}}/branchesBranches of the repository.
- GETSearch repositories
/search/repositoriesGitHub search syntax in q.
Issues and pull requests
- GETList open issues
/repos/{{owner}}/{{repo}}/issuesOpen issues (pull requests are listed too).
- POSTCreate an issue
/repos/{{owner}}/{{repo}}/issuesOpens an issue and saves its number as issueNumber.
- POSTComment on an issue
/repos/{{owner}}/{{repo}}/issues/{{issueNumber}}/commentsAdds a comment to the issue.
- GETList open pull requests
/repos/{{owner}}/{{repo}}/pullsOpen pull requests.
Actions
- GETList workflow runs
/repos/{{owner}}/{{repo}}/actions/runsRecent GitHub Actions runs and their status.
- GETList workflows
/repos/{{owner}}/{{repo}}/actions/workflowsWorkflows defined in the repository.