API Reference
Rack Gateway exposes a JSON REST API for authentication, admin workflows, and Convox proxying. The OpenAPI spec is the source of truth, but this page summarizes the current surface area.
Base URL
Section titled “Base URL”| Environment | Base URL |
|---|---|
| Development | http://localhost:8447/api/v1 |
| Production | https://gateway.example.com/api/v1 |
Authentication
Section titled “Authentication”Gateway endpoints require a session (browser cookie or CLI login). API tokens (automation) can use the rack proxy (/api/v1/rack-proxy/*) and only four gateway endpoints: GET /info, GET /rack, POST /deploy-approval-requests and GET /deploy-approval-requests/{id}. Every other gateway endpoint returns 403 API tokens cannot use this endpoint.
Each gateway endpoint declares the permission it needs; callers without it get 403 insufficient permissions: requires <permission>. Endpoints under /users/{email} that read or sign out a user’s own sessions, profile or audit log also accept that user themselves.
Session Authentication
Section titled “Session Authentication”The web UI’s session is the session_token cookie; requests that change something also need the CSRF token in
an X-CSRF-Token header. A CLI session token is sent as a bearer token:
curl -H "Authorization: Bearer YOUR_SESSION_TOKEN" \ https://gateway.example.com/api/v1/infoAPI Token Authentication
Section titled “API Token Authentication”curl -H "Authorization: Bearer YOUR_API_TOKEN" \ https://gateway.example.com/api/v1/rack-proxy/appsEndpoint Summary
Section titled “Endpoint Summary”Gateway Info
Section titled “Gateway Info”GET /info- the signed-in user, the rack, integration status and the gateway’s versionGET /rack- the rack’s system information (from the rack’s/system)GET /roles- roles and their permissionsGET /created-by- who created the given apps, builds or releases, for display
Health
Section titled “Health”GET /health- Health check (503 for a minute after an audit write fails)
OAuth + CLI Login
Section titled “OAuth + CLI Login”CLI login uses the RFC 8252 loopback flow (see OAuth Flow):
POST /auth/cli/start- S256 code challenge, CLI state and loopbackredirect_uri; returnsauth_urlGET /auth/cli/callback- identity provider redirect; exchanges the code, then binds the browserGET /auth/cli/mfa- continues the bound browser to MFA (or enrollment)POST /auth/cli/mfa- submits an MFA code from the bound browserGET /auth/cli/return- issues the single-use login code and redirects the browser to the CLI’s loopback listenerPOST /auth/cli/cancel- cancels the login from the bound browser; returns the loopback URL that tells the CLIPOST /auth/cli/complete- redeems the login code with the CLI’s code verifier for a session tokenGET /auth/cli/initiator- the device name and IP that started the login, shown on the approval pagePOST /auth/cli/logout- revokes the CLI session sent as the bearer token (cookies are ignored)GET /auth/web/login(also supportsHEAD)GET /auth/web/callbackPOST /auth/web/logout(with the session’sX-CSRF-Token)
MFA Management
Section titled “MFA Management”All under /auth/mfa:
GET /auth/mfa/statusPOST /auth/mfa/enroll/totp/startPOST /auth/mfa/enroll/totp/confirmPOST /auth/mfa/enroll/yubiotp/startPOST /auth/mfa/enroll/webauthn/startPOST /auth/mfa/enroll/webauthn/confirmPOST /auth/mfa/verifyPOST /auth/mfa/webauthn/assertion/startPOST /auth/mfa/webauthn/assertion/verifyPUT /auth/mfa/preferred-methodPUT /auth/mfa/methods/:methodIDDELETE /auth/mfa/methods/:methodIDPOST /auth/mfa/backup-codes/regeneratePOST /auth/mfa/trusted-devices/trustDELETE /auth/mfa/trusted-devices/:deviceID
Admin & Settings
Section titled “Admin & Settings”GET /users,POST /users,GET /users/:email,PUT /users/:email,DELETE /users/:emailPUT /users/:email/nameGET /users/:email/sessions,GET /users/:email/audit-logsPOST /users/:email/sessions/:sessionID/revokePOST /users/:email/sessions/revoke_allPOST /users/:email/lock,POST /users/:email/unlockPOST /users/:email/mfa/reset: removes another user’s MFA methods, backup codes and trusted devices and signs them outGET /api-tokens,GET /api-tokens/:tokenID,POST /api-tokensPUT /api-tokens/:tokenID,DELETE /api-tokens/:tokenIDGET /api-tokens/permissionsGET /audit-logs,GET /audit-logs/export,GET /audit-logs/verification(the latest hourly verification)GET /jobs,GET /jobs/:id,DELETE /jobs/:id,POST /jobs/:id/retryGET /settingsPUT /settings/mfa-configuration,DELETE /settings/mfa-configurationPUT /settings/allow-destructive-actions,DELETE /settings/allow-destructive-actionsPUT /settings/vcs-and-ci-defaults,DELETE /settings/vcs-and-ci-defaultsPUT /settings/deploy-approvals,DELETE /settings/deploy-approvalsPUT /settings/session-configuration,DELETE /settings/session-configurationPOST /settings/rack-tls-cert/refreshPOST /diagnostics/sentry- Slack integration:
GET /integrations/slack,POST /integrations/slack/oauth/authorize,GET /integrations/slack/oauth/callback,PUT /integrations/slack/channels,PUT /integrations/slack/alerts,GET /integrations/slack/channels/list,POST /integrations/slack/test,DELETE /integrations/slack
GET /apps/:app/env,PUT /apps/:app/env- env values for the web UI (secrets masked unless permitted)GET /apps/:app/settingsPUTandDELETEon/apps/:app/settings/vcs-ci-deploy,protected-env-vars,secret-env-vars,audit-visible-env-vars,approved-deploy-commandsandservice-image-patterns
Deploy Approvals
Section titled “Deploy Approvals”GET /deploy-approval-requestsGET /deploy-approval-requests/:idGET /deploy-approval-requests/:id/audit-logsPOST /deploy-approval-requestsPOST /deploy-approval-requests/:id/approvePOST /deploy-approval-requests/:id/rejectPOST /deploy-approval-requests/:id/extend
Convox Proxy
Section titled “Convox Proxy”* /rack-proxy/*(all HTTP methods; header authentication only, so the Convox CLI and API tokens, never the browser cookie)- For the web UI, with a session:
GET /convox/apps,GET /convox/apps/*,GET /convox/instances,GET /convox/system/processes,PUT /convox/apps/:app/services/:name(scale) andDELETE /convox/apps/:app/processes/:pid
Error Responses
Section titled “Error Responses”Errors use a simple JSON payload:
{ "error": "message"}OpenAPI Specification
Section titled “OpenAPI Specification”The generated OpenAPI spec is available at:
GET /openapi.jsonThis schema is generated from the Go handlers and used to build the TypeScript API client.