Synced from Hive. This page is pulled from hivecommons/hive@v5 during the docs build. Edit the canonical source in the Hive repository.

Dashboard REST API reference — Auth and external accounts

Part of the Dashboard REST API reference; see that page for how auth levels and pkg/<file>:<line> source citations are read and checked. Edit this file for routes in this area and run src/scripts/check-api-reference-citations.sh --fix to resync citations.

MethodPathAuthPurposeSource
GET/api/gh-authDashboard auth/sessionGitHub Authpkg/dashboard/api.go:171
GET/api/gh-rate-limitsDashboard auth/sessionGitHub Rate Limitspkg/dashboard/api.go:172
GET/api/gh-user-auth/statusPublicGitHub User Auth Statuspkg/dashboard/api.go:173
POST/api/gh-user-auth/startPublicGitHub User Auth Startpkg/dashboard/api.go:174
POST/api/gh-user-auth/pollPublicGitHub User Auth Pollpkg/dashboard/api.go:175
POST/api/gh-user-auth/logoutPublicGitHub User Auth Logoutpkg/dashboard/api.go:176
GET/api/gh-user-auth/sessionPublicGitHub User Auth Sessionpkg/dashboard/api.go:177
GET/api/claude-auth/statusDashboard auth/sessionClaude Auth Statuspkg/dashboard/claude_auth.go:54
POST/api/claude-auth/startDashboard auth/sessionClaude Auth Startpkg/dashboard/claude_auth.go:55
POST/api/claude-auth/exchangeDashboard auth/sessionClaude Auth Exchangepkg/dashboard/claude_auth.go:56
POST/api/claude-auth/logoutDashboard auth/sessionClaude Auth Logoutpkg/dashboard/claude_auth.go:57
GET/api/copilot-auth/statusDashboard auth/sessionCopilot Auth Statuspkg/dashboard/copilot_auth.go:85
POST/api/copilot-auth/startOwner onlyCopilot Auth Startpkg/dashboard/copilot_auth.go:86
POST/api/copilot-auth/logoutOwner onlyCopilot Auth Logoutpkg/dashboard/copilot_auth.go:88
GET/api/openrouter/connect/startDashboard auth/sessionOpen Router Startpkg/dashboard/openrouter.go:45
GET/api/openrouter/qrDashboard auth/sessionOpen Router QRpkg/dashboard/openrouter.go:46
GET/api/openrouter/modelsDashboard auth/sessionOpen Router Modelspkg/dashboard/openrouter.go:47
GET/api/openrouter/creditDashboard auth/sessionOpen Router Creditpkg/dashboard/openrouter.go:48
GET/openrouter/callbackPublicOpen Router Callbackpkg/dashboard/openrouter.go:49
POST/api/github-app/recheckDashboard auth/sessionGitHub App Recheckpkg/dashboard/server.go:1857
POST/api/github-app/install-clickedDashboard auth/sessionGitHub App Install Clickedpkg/dashboard/server.go:1858
GET/gh-setupPublicGitHub App Setup Callbackpkg/dashboard/server.go:1859
GET/api/github-owner-identityOwner onlyThe hive owner’s GitHub identity for remote repos (#18197): connected, login, scope, connected_at, usable, reason, verified_at, scope_required (public_repo), private_repos_supported (false) and file (the token file path on the spoke). Never the tokenpkg/dashboard/api.go:591
POST/api/github-owner-identity/startOwner onlyStart the consent: a GitHub device flow with the spoke’s oauth_client_id asking for public_repo, separate from the scope-free login flow. Returns user_code, verification_uri, expires_in, interval, scope and the flow_id the poll must present. 502 when GitHub refused the device-code requestpkg/dashboard/api.go:592
POST/api/github-owner-identity/pollOwner onlyPoll the consent with {"flow_id"}: status pending / slow_down (poll again), complete (with login and the identity) or error. On completion the granted scope must cover public_repo, the token must validate and the account must be the logged-in owner’s; the identity is then stored on the spoke (/data/secrets/github-owner-token, HIVE_GITHUB_OWNER_TOKEN_FILE overrides) and the reference-repo policies re-resolve. 400 without a live flow or with the wrong flow_id; audited as github_owner_identity_connected / _rejectedpkg/dashboard/api.go:593
DELETE/api/github-owner-identityOwner onlyDisconnect: removes the token file, drops every write-tier reference repo to read-only on the next pass, returns the previous login and a note that GitHub-side revocation is done under Settings → Applications on github.com; audited as github_owner_identity_disconnectedpkg/dashboard/api.go:594
GET/api/github-tokenOwner onlyPAT status for PAT-mode hives (#19633): mode (pat / app), rotatable, configured, fingerprint (the sha256 prefix /api/config/export shows) and, when this process verified the token, login and verified_at. Never the tokenpkg/dashboard/api.go:597
PUT/api/github-tokenOwner onlyRotate the PAT without a restart with {"token"}. Verified against github.api_url first (GET /user, read access to every project.repos entry, the boot scope check for the current ACMM level); a failure is 422 and nothing changes. A verified token is saved through the normal keystore-sealed config save, adopted as a new PAT client, and running agents get fresh credentials. Returns the GET body plus sealed (true when the saved token is a keystore envelope; false when it was written as plaintext, in which case the config file is kept owner-only, 0600). Needs Content-Type: application/json (415 otherwise) and refuses Sec-Fetch-Site: cross-site (403). 409 when github.app_id is set (rechecked under the GitHub config lock); 500 when the config has no source path, so the token would not survive a restart. After a rejected token, further attempts get 429 with Retry-After for 15 seconds (HIVE_GITHUB_TOKEN_REJECT_COOLDOWN, a Go duration, 0 turns it off). Audited as github_token_rotated / github_token_rejected by fingerprintpkg/dashboard/api.go:598