Documentation

Alpha

GitHub 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

AreaPaths
Repositoriesrepos/{owner}/{repo}, user/repos, orgs/{org}/repos, forks, transfer
Contentscontents/{path}, including raw media types, and creating, updating and deleting files
Git datagit/ref, git/refs, git/matching-refs, git/trees (with recursive=1), git/commits, git/blobs, git/tags
Commitscommits, commits/{ref} (including .diff and .patch), compare/{base}...{head}, branches, tags
Pull requestspulls, files, commits, merge, update-branch, reviews, review comments, requested reviewers
Checkscheck-runs, commits/{ref}/check-runs, check-suites, commits/{ref}/check-suites, rerequest, statuses/{sha}, commits/{ref}/status
Issuesissues, comments, labels, assignees, reactions, lock
Releasesreleases, latest, by tag, assets and asset upload
Actionsworkflows, runs, jobs, dispatches, cancel, rerun
Appsapp, app/installations, access tokens, suspension, installation/repositories, app/hook/config, app/hook/deliveries
WebhooksRepository and organization hooks, and app webhooks with installation, installation_repositories, check_suite, check_run, workflow_run and workflow_job
Accountuser, users/{user}, orgs/{org}, members, notifications
Searchsearch/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_commitish doesn't create a missing tag. Releases can't be deleted.
  • Pending reviews aren't supported. Submit a review with an event; inline comments are added before the review.
  • Commit filters author, since and until aren't supported yet.
  • Search needs one repo:owner/name qualifier for code and issue search.
  • GraphQL isn't available.