Closedloop.ai
Resources

Gateway endpoints reference

Every HTTP endpoint the desktop gateway exposes, grouped by operation family.

The desktop gateway binds to 127.0.0.1:19432 (or the first fallback in 19433–19435). All /api/gateway/* routes require auth.

Metadata

RouteMethodsNotes
/healthGETUnauthenticated liveness and capability probe.
/api/gateway/reposGET, POST, DELETE, PATCHManaged repositories.
/api/gateway/settings/binary-pathsGET, PATCHOverride claude/codex/python3/git paths.
/api/gateway/mcp-authGETMCP auth metadata parity route.

Git

RouteMethods
/api/gateway/gitPOST (status/branch/commit/push/pull/branch-diff/sync-status dispatch)
/api/gateway/git/branchesGET
/api/gateway/git/diffPOST
/api/gateway/git/worktreePOST, DELETE
/api/gateway/git/branch-worktreeGET
/api/gateway/git/repo-pathGET
/api/gateway/git/prPOST

Retired: local-gh PR data and identity routes

These answered from a local gh invocation and are retired. Desktop GitHub data now comes from the cloud projection or server-backed GitHub APIs, so the routes stay registered and, once a request passes the gateway's auth, onboarding and approval gates, respond HTTP 410 with { "error": "github_data_route_retired" }. Those gates run first and can answer before the route does — a request made before onboarding completes gets 403, not 410.

410 rather than an unregistered path so a version-skewed client can tell a deliberately removed endpoint from one that is merely unimplemented: this gateway answers 501 operation not implemented for an unrecognized /api/gateway/* path, which means "may arrive later".

RouteMethods
/api/gateway/git/pr/listGET
/api/gateway/git/pr/commentsGET
/api/gateway/git/pr/reviewsGET
/api/gateway/git/pr/replyPOST
/api/gateway/git/pr/filesGET
/api/gateway/git/pr/file-diffGET
/api/gateway/git/pr/head-shaGET
/api/gateway/git/pr/inline-commentPOST
/api/gateway/git/userGET

Filesystem

RouteMethods
/api/gateway/directoriesGET
/api/gateway/files/searchGET

Operation IDs

The supported operation IDs drive approval policy and telemetry tagging:

git_action, git_pr, git_branch_worktree,
repos_config, filesystem, binary_paths_settings

Required headers for authenticated calls

  • X-Desktop-Gateway-Token (internal cloud executor) or X-Desktop-Session-Token + Origin (browser)
  • Content-Type: application/json (where a body is sent)

See Desktop gateway for the full auth model.

On this page