GitHub integration
These endpoints back the GitHub integration: logging work from a
GitHub issue, mapping repositories to projects, and configuring the instance’s GitHub App. The
per-user account link (/me/github) lives on the Account page.
Log work from a GitHub issue
Section titled “Log work from a GitHub issue”POST /api/v1/github/log-work scope: write
Logs a work entry against a GitHub issue for a client that only knows its git remotes. The
server normalizes the remotes, resolves the repo→project mapping, parses the duration/date in the
caller’s timezone, enriches with the issue title and labels, and links recent agent sessions that
point at the issue. Rate-limited on the ingest path. Returns 404 with a help message when no
remote is a mapped github.com repo.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
remotes |
string[] | yes | Git remote fetch URLs, verbatim (1–10). The first that maps to a project wins. |
issueNumber |
integer | yes | The issue (or pull request) number. |
args |
string | yes | The raw <duration> [date] string, exactly as typed (≤ 200 chars). |
Returns 201 Created. degraded is true when the App was unreachable and the entry carries
only the bare issue reference (no title or labels). entry is a full
work entry.
Repository mappings
Section titled “Repository mappings”A mapping says “work logged from this repository belongs to this project”. Repo full names are unique instance-wide. The collection is nested under a workspace.
List mappings
Section titled “List mappings”GET /api/v1/workspaces/:id/github-mappings scope: read
Any workspace member. Returns the workspace’s mappings.
source is installation when the App covers the repo, or manual for a hand-entered mapping.
Create a mapping
Section titled “Create a mapping”POST /api/v1/workspaces/:id/github-mappings scope: admin
Workspace admin. Maps a repository to a project in this workspace. Works without the App (records
a manual mapping); with the App, the repo id and installation are resolved server-side. A repo
already mapped anywhere returns 409 conflict; a project outside the workspace returns 400.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
repoFullName |
string | yes | owner/repo (case-insensitive). |
projectId |
string | yes | Project in this workspace to map to. |
Returns 201 Created with the created mapping (same shape as the list rows).
Delete a mapping
Section titled “Delete a mapping”DELETE /api/v1/workspaces/:id/github-mappings/:mappingId scope: admin
Workspace admin. Removes the mapping. Returns 204 No Content.
Unmapped repositories
Section titled “Unmapped repositories”GET /api/v1/workspaces/:id/github-mappings/unmapped-repos scope: admin
Workspace admin. Repositories the App’s installations cover that no one has mapped yet — the
picker’s source. Read live from GitHub; empty ({ "repos": [] }) without an App.
The GitHub App
Section titled “The GitHub App”Every instance registers its own GitHub App. These endpoints report and manage it. Secrets never leave the server — only display data and toggles are returned.
App enabled
Section titled “App enabled”GET /api/v1/instance/github/enabled auth required
Any signed-in user. Gates the “Connect GitHub” card. Returns { "enabled": true }.
Get the App configuration
Section titled “Get the App configuration”GET /api/v1/instance/github scope: admin
Instance admin. Returns the App’s display fields and its installations.
app is null before an App is registered.
Register the App
Section titled “Register the App”POST /api/v1/instance/github/app/manifest scope: admin
Instance admin. Starts the GitHub
App Manifest flow:
returns the GitHub form target and the manifest JSON the SPA posts to GitHub, and binds the flow
to the caller’s browser. GitHub then calls back to /api/github/setup, which stores the App’s
credentials encrypted. There is nothing to copy or paste.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
owner |
string | null | yes | The organization login to register the App under, or null for the caller’s personal account. |
Remove the App
Section titled “Remove the App”DELETE /api/v1/instance/github/app scope: admin
Instance admin. Removes the App configuration. Mappings survive, so #N log-work keeps working
in the degraded, link-only form. Returns 204 No Content.
List an installation’s repositories
Section titled “List an installation’s repositories”GET /api/v1/instance/github/installations/:installationId/repos scope: admin
Instance admin. Read live from GitHub — the repositories a given installation can reach.
Account connection
Section titled “Account connection”Connecting your own GitHub account (so comments log work as you) is a per-user action — see GitHub connection on the Account page.