GitHub

GitHub API

Article indexing, repo content retrieval, and webhook handling.

Auth

Most endpoints use AuthGuard with PUBLIC permission.

Repo access requires owner session unless repo is "gitbook".

GET /github/:repo/articles

Get paginated articles for a repo.

Permission: PUBLIC Guard: AuthGuard

Query

NameTypeRequiredNotes
pagenumberNoDefault 1.
limitnumberNoDefault 10, max 100.

Response

{ "articles": [], "total": 0, "page": 1, "limit": 10, "totalPages": 0 }
If repo is not "gitbook", the session user must have owner == true.
POST /github/:repo/reindex

Reindex a repo path for articles.

Permission: READ_WRITE Guard: AuthGuard

Body

NameTypeRequiredNotes
pathstringYesFile or directory path.
refreshbooleanNoClear cache before reindex.

Response

{ "message": "Reindex process completed", "success": true, "repo": "repo", "path": "docs", "indexed": 10, "errors": 0 }
GET /github/:repo/*

Fetch repo content for a given path. The wildcard captures everything after the repo name.

Permission: PUBLIC Guard: AuthGuard

Path

NameTypeRequiredNotes
repostringYesRepo slug.
*stringNoPath segment after /github/:repo/

Response

GitHub contents API payload.
POST /github/:repo/webhook

Handle GitHub webhook events for repo indexing.

Permission: PUBLIC

Headers

NameRequiredNotes
x-github-eventYesEvent type, e.g. push or ping.
x-hub-signature-256YesHMAC signature for verification.

Body

Raw JSON payload from GitHub.
Raw body must be available for signature verification.