Documentation
AlphaGitHub compatibility
Use Octokit and other GitHub REST clients against Upstream by changing the base URL.
The Upstream API is in alpha. Endpoints, fields and limits can change before it's stable. Send feedback to support@coline.app.
Upstream serves a GitHub-compatible REST API at https://api.upstream.codes/api/v3. Responses use GitHub's field names, numeric IDs, node_id values, Link pagination and error format, so most GitHub REST clients work unchanged.
Octokit
import { Octokit } from "@octokit/rest";
const octokit = new Octokit({
baseUrl: "https://api.upstream.codes/api/v3",
auth: process.env.UPSTREAM_TOKEN,
});
const { data: pull } = await octokit.rest.pulls.create({
owner: "acme",
repo: "api",
head: "feature/search",
base: "main",
title: "Add search",
});
octokit.paginate follows the Link header. X-GitHub-Api-Version accepts 2022-11-28 and 2026-03-10.
gh
gh api works against upstream.codes:
GH_ENTERPRISE_TOKEN=$UPSTREAM_TOKEN gh api --hostname upstream.codes repos/acme/api
Most other gh commands, including gh pr, gh issue and gh auth login, use GitHub's GraphQL API, which Upstream doesn't serve yet.
Supported areas
| Area | Paths |
|---|---|
| Repositories | repos/{owner}/{repo}, user/repos, orgs/{org}/repos, forks, transfer |
| Contents | contents/{path}, including raw media types, and creating, updating and deleting files |
| Git data | git/ref, git/refs, git/matching-refs, git/trees (with recursive=1), git/commits, git/blobs, git/tags |
| Commits | commits, commits/{ref} (including .diff and .patch), compare/{base}...{head}, branches, tags |
| Pull requests | pulls, files, commits, merge, update-branch, reviews, review comments, requested reviewers |
| Checks | check-runs, commits/{ref}/check-runs, check-suites, commits/{ref}/check-suites, rerequest, statuses/{sha}, commits/{ref}/status |
| Issues | issues, comments, labels, assignees, reactions, lock |
| Releases | releases, latest, by tag, assets and asset upload |
| Actions | workflows, runs, jobs, dispatches, cancel, rerun |
| Apps | app, app/installations, access tokens, suspension, installation/repositories, app/hook/config, app/hook/deliveries |
| Webhooks | Repository and organization hooks, and app webhooks with installation, installation_repositories, check_suite, check_run, workflow_run and workflow_job |
| Account | user, users/{user}, orgs/{org}, members, notifications |
| Search | search/code, search/issues, search/repositories, search/users |
Differences from GitHub
- Issue and pull request numbers share one sequence, and
issues/{number}endpoints also reach pull requests. Older repositories can have an Issue and a Change Request with the same number; there,issues/{number}addresses the Issue. - Releases need their tag pushed first;
target_commitishdoesn't create a missing tag. Releases can't be deleted. - Pending reviews aren't supported. Submit a review with an
event; inlinecommentsare added before the review. - Commit filters
author,sinceanduntilaren't supported yet. - Search needs one
repo:owner/namequalifier for code and issue search. - GraphQL isn't available.