API Reference
The GitForge REST API lets you manage repositories, branches, commits, pull requests, and more programmatically. All endpoints return JSON.
Base URL
https://api.gitforge.devAll API paths are relative to this base URL. Self-hosted instances use your configured domain.
Authentication
GitForge supports two authentication methods:
Bearer Token
Use a session token or Personal Access Token (PAT) in the Authorization header:
Authorization: Bearer gf_your_personal_access_tokenBasic Auth (Git operations)
For Git clone/push/pull over HTTP, use your PAT as the password with any username:
git clone http://x:[email protected]/org/repo.gitGo to Settings → Access Tokens in the web dashboard to create a Personal Access Token. Tokens are prefixed with gf_ and support scoped permissions.
Rate Limiting
API requests are rate limited per authenticated user. Current limits:
Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Endpoints
Repositories
Branches
Commits
Pull Requests
Files & Trees
Webhooks
Example Requests
List your repositories
curl -s https://api.gitforge.dev/api/repos \
-H "Authorization: Bearer gf_YOUR_PAT" | jq .Create a repository
curl -X POST https://api.gitforge.dev/api/repos \
-H "Authorization: Bearer gf_YOUR_PAT" \
-H "Content-Type: application/json" \
-d '{
"name": "my-project",
"description": "A new project",
"visibility": "private",
"defaultBranch": "main"
}'Create a pull request
curl -X POST https://api.gitforge.dev/api/repos/REPO_ID/prs \
-H "Authorization: Bearer gf_YOUR_PAT" \
-H "Content-Type: application/json" \
-d '{
"title": "Add new feature",
"description": "Implements the new feature",
"sourceBranch": "feature/new-thing",
"targetBranch": "main"
}'Error Responses
Errors return a JSON object with an error field:
{
"error": "Repository not found"
}Explore and test API endpoints interactively in the browser.
Our SDKs wrap the REST API with typed interfaces and handle authentication, pagination, and error handling automatically.