Overview
Forge integrates with GitHub for authentication, pull request creation, and repository operations. Base URL:http://localhost:8887/api/github
Authentication
GitHub OAuth Device Flow
Forge uses GitHub’s device flow for authentication.Step 1: Initiate Device Flow
Step 2: Poll for Token
Pull Requests
Create Pull Request
Create a GitHub PR from task attempt branch (covered in Attempts API).string
required
The task attempt ID
Attach Existing PR
Link an existing GitHub PR to a task attempt.string
required
The task attempt ID
Repository Operations
Get Repository Info
Get information about the project’s GitHub repository.string
required
The project ID
List Pull Requests
List pull requests for a project.string
required
The project ID
string
default:"open"
Filter by PR state:
open, closed, or allinteger
default:"1"
Page number for pagination
integer
default:"20"
Items per page (max 100)
Webhooks
Configure Webhook
Set up GitHub webhook to receive events.string
required
The project ID
array
required
Array of events to subscribe to:
pull_request, push, issue_comment, pull_request_reviewstring
required
The webhook endpoint URL to receive GitHub events
pull_request- PR opened, closed, mergedpush- Commits pushedissue_comment- Comments on issues/PRspull_request_review- PR reviews
SDK Examples
Next Steps
Attempts API
Create PRs from task attempts
Authentication
Configure GitHub OAuth

