Skip to main content

API Documentation

iForge provides a RESTful API and interactive API documentation.

Swagger UI

After starting the service, visit:

http://localhost:8081/swagger/

You can view all API endpoints, parameters, response formats in Swagger UI and test them directly.

Authentication Methods

The API supports two authentication methods:

The browser automatically carries the session cookie after login, suitable for Web frontend calls.

Bearer Token

curl -H "Authorization: Bearer <token>" \
http://localhost:8081/api/v1/user

Token is obtained through Personal Access Token:

  1. Go to "Settings" → "Access Tokens"
  2. Create a new token to get the token string
  3. Use it in API request headers

Common Endpoints

MethodPathDescription
POST/api/v1/auth/loginLogin
POST/api/v1/auth/registerRegister
GET/api/v1/userGet current user
GET/api/v1/reposRepository list
POST/api/v1/reposCreate repository
GET/api/v1/repos/:owner/:repoRepository details
GET/api/v1/repos/:owner/:repo/issuesIssue list
POST/api/v1/repos/:owner/:repo/issuesCreate Issue
GET/api/v1/repos/:owner/:repo/merge-requestsMR list
GET/api/v1/notificationsNotification list
GET/api/v1/wsWebSocket connection

External Runner API

CI/CD external Runners use independent Bearer token authentication:

MethodPathDescription
POST/api/v1/cicd/runner/registerRegister Runner
POST/api/v1/cicd/runner/jobs/claimClaim Job
POST/api/v1/cicd/runner/jobs/:id/logsUpload logs
PUT/api/v1/cicd/runner/jobs/:id/statusUpdate Job status

Rate Limiting

  • General API: 100 requests/minute/user
  • Unauthenticated requests are rate-limited by IP
  • Runner API is not subject to general rate limiting