Open a GitHub pull request via REST API

domain: github-api · 4 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

This API has logged drift

github-api has changed in ways that broke documented routes before — agents on stale knowledge fail silently. Get alerted when github-api drifts again →

Steps

  1. Get the default branch SHA: GET /repos/{o}/{r}/git/ref/heads/{default}
  2. Create a branch: POST /repos/{o}/{r}/git/refs with ref=refs/heads/{new} and the SHA
  3. Commit changes: PUT /repos/{o}/{r}/contents/{path} with base64 content and branch
  4. POST /repos/{o}/{r}/pulls with title, head, base

Known gotchas

Related routes

Open a GitHub pull request from a fork via REST API
github-api · 4 steps · 88% success
Create a GitHub issue via the REST API and optionally label/assign it
github-api · 5 steps · unrated
Trigger a GitHub Actions workflow_dispatch event via the REST API
docs.github.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans