Git over HTTPS
Every repository is served with the Git smart HTTP protocol. Clone and fetch are anonymous; push uses HTTP Basic with the user spb and a personal access token as the password.
$git clone https://git.spboucher.ai/admin-ka.git $git ls-remote https://git.spboucher.ai/admin-ka.git
Read endpoints
Base URL https://git.spboucher.ai/api/v1. Responses are JSON; errors use the envelope {"error": {"code", "message"}}.
| Method | Path | Returns |
|---|---|---|
| GET | /api/v1/repos | Every repository with its overview (description, topics, languages, counts, last push). |
| GET | /api/v1/repos/:name | One repository overview. |
| GET | /api/v1/repos/:name/languages | Bytes and percentages per language at HEAD. |
| GET | /api/v1/repos/:name/commits?ref=&page= | Commit history, 40 per page, with diff statistics. |
| GET | /api/v1/repos/:name/tree?ref=&path= | One directory level of the tree at a ref. |
| GET | /api/v1/repos/:name/releases | Tags with their attached release assets and checksums. |
| GET | /api/v1/search?q=&scope=&repo=&limit= | Scoped search: all, repos, files, commits, branches or readmes. |
| GET | /api/v1/stats | Site totals: repositories, commits, streaks, languages. |
| GET | /healthz | Version, uptime, repository count, cache footprint. |
Files, archives, feeds
| Method | Path | Returns |
|---|---|---|
| GET | /raw/:repo/:ref/:path | The file as stored, streamed. HTML is served as plain text. |
| GET | /archive/:repo/:ref.zip | A zip snapshot of the tree at a branch, tag or commit. |
| GET | /archive/:repo/:ref.tar.gz | The same snapshot as a gzipped tarball. |
| GET | /releases/:repo/:tag/:asset | A release asset; the sha256 is in the X-Checksum-Sha256 header. |
| GET | /feed.atom | Atom feed of the latest pushes and tags. |
| GET | /sitemap.xml | Sitemap of every repository page. |
| GET | /og/:repo.png | The social card of a repository. |
Write endpoints
Owner only: send Authorization: Bearer <token>. The spbgit command line wraps all of them.
| Method | Path | Does |
|---|---|---|
| POST | /api/v1/repos | Create a repository. |
| PATCH | /api/v1/repos/:name | Update description, topics, homepage, pinned, research, default branch. |
| DELETE | /api/v1/repos/:name | Soft-delete a repository (recoverable). |
| PUT | /api/v1/repos/:name/releases/:tag/assets/:asset | Upload a release asset (streamed to disk). |
| DELETE | /api/v1/repos/:name/releases/:tag/assets/:asset | Remove a release asset. |
| POST | /api/v1/tokens | Mint a personal access token. |
| GET | /api/v1/tokens | List tokens (labels and last use, never the secret). |
| DELETE | /api/v1/tokens/:id | Revoke a token. |
| GET | /api/v1/whoami | Check that a token is valid. |
Limits and errors
- Public endpoints are limited to 200 requests per minute per IP address; beyond that the answer is
429with the coderate_limited. - Search queries are capped at 120 characters and
limitat 50 results per group. - Unknown repositories and refs answer
404withnot_foundorref_not_found. - Definitions of every count returned by
/api/v1/statsare on the metrics page.