swadhinbiswas # Changelog Β· 1/17/2026
9eabb75
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Reference - OpenCodeHub Docs</title>
<meta name="description" content="OpenCodeHub REST API reference">
<link rel="icon" type="image/svg+xml" href="../public/logo.svg">
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="header">
<a href="index.html" class="header-logo">
<img src="../public/logo.svg" alt="OpenCodeHub" height="40">
</a>
<nav class="header-nav">
<a href="getting-started.html">Getting Started</a>
<a href="deployment.html">Deployment</a>
<a href="cli.html">CLI</a>
<a href="api.html">API</a>
</nav>
</header>
<div class="layout">
<aside class="sidebar">
<div class="sidebar-section">
<div class="sidebar-title">API</div>
<nav class="sidebar-nav">
<a href="#auth" class="sidebar-link active">Authentication</a>
<a href="#repos" class="sidebar-link">Repositories</a>
<a href="#prs" class="sidebar-link">Pull Requests</a>
<a href="#webhooks" class="sidebar-link">Webhooks</a>
</nav>
</div>
</aside>
<main class="main">
<div class="content">
<h1>π API Reference</h1>
<p>RESTful API for programmatic access to OpenCodeHub.</p>
<section id="auth">
<h2>π Authentication</h2>
<p>All API requests require authentication via Bearer token:</p>
<pre><code>Authorization: Bearer YOUR_API_TOKEN</code></pre>
<p>Create tokens in <strong>Settings β Developer β API Tokens</strong>.</p>
</section>
<section id="repos">
<h2>π Repositories</h2>
<table>
<tr>
<td><code>GET /api/repos</code></td>
<td>List repositories</td>
</tr>
<tr>
<td><code>GET /api/repos/:owner/:repo</code></td>
<td>Get repository</td>
</tr>
<tr>
<td><code>POST /api/repos</code></td>
<td>Create repository</td>
</tr>
<tr>
<td><code>DELETE /api/repos/:owner/:repo</code></td>
<td>Delete repository</td>
</tr>
</table>
<h3>Example</h3>
<pre><code>curl -H "Authorization: Bearer TOKEN" \
https://git.example.com/api/repos/user/project</code></pre>
</section>
<section id="prs">
<h2>π Pull Requests</h2>
<table>
<tr>
<td><code>GET /api/repos/:owner/:repo/pulls</code></td>
<td>List PRs</td>
</tr>
<tr>
<td><code>POST /api/repos/:owner/:repo/pulls</code></td>
<td>Create PR</td>
</tr>
<tr>
<td><code>PUT /api/repos/:owner/:repo/pulls/:id/merge</code></td>
<td>Merge PR</td>
</tr>
</table>
</section>
<section id="webhooks">
<h2>π Webhooks</h2>
<p>Configure webhooks in <strong>Repository β Settings β Webhooks</strong>.</p>
<h3>Events</h3>
<table>
<tr>
<td><code>push</code></td>
<td>Code pushed to repository</td>
</tr>
<tr>
<td><code>pull_request</code></td>
<td>PR opened, closed, merged</td>
</tr>
<tr>
<td><code>issue</code></td>
<td>Issue created or updated</td>
</tr>
</table>
<h3>Payload Example</h3>
<pre><code>{
"event": "pull_request",
"action": "opened",
"repository": {"name": "project", "owner": "user"},
"pull_request": {"number": 42, "title": "Add feature"}
}</code></pre>
</section>
<footer
style="margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border-primary); text-align: center; color: var(--text-muted);">
<p>Made with β€οΈ by <a href="https://github.com/swadhinbiswas">Swadhin Biswas</a></p>
</footer>
</div>
</main>
</div>
</body>
</html>