PULLBASE_TLS_ENABLED=true and provide certificate paths. Alternatively, use a reverse proxy for TLS termination. Admin and viewer accounts authenticate with bearer tokens, while agents use their agent token.
Interactive API Documentation
Pullbase includes an interactive Swagger UI for exploring and testing the API.GET /swagger/*
Serves the interactive Swagger UI documentation. Access it at https://pullbase.example.com/swagger/index.html.
Public endpoints
These endpoints do not require authentication.GET /healthz
Kubernetes-style liveness probe. Returns healthy if the service is running and the database is reachable.
GET /readyz
Kubernetes-style readiness probe. Returns healthy if the service is ready to accept traffic, including database connectivity and migration status.
GET /serverinfo/{serverID}
Returns Git configuration for a server. Used by agents during initial bootstrap to fetch repository details before authenticating.
Server identifier.
GET /bootstrap/status
Returns whether bootstrap is available (first admin not yet created).
POST /bootstrap/admin
Creates the first admin user using the bootstrap secret.
Authentication
POST /auth/login
GET /auth/me
Returns the authenticated user. Requires Authorization: Bearer <token>.
Environments
GET /environments
POST /environments
GET /environments/{environmentID}
Returns a single environment by ID.
PUT /environments/{environmentID}
Updates an environment. Supports updating notification_webhook_url for webhook notifications.
DELETE /environments/{environmentID}
POST /environments/{environmentID}/toggle-auto-reconcile
Toggles the auto-reconcile setting for an environment.
POST /environments/{id}/rollback
Initiates a rollback to a previous commit.
GET /environments/{id}/rollbacks
Lists rollback events for an environment.
Maximum number of rollbacks to return (1-100).
Pagination offset.
GET /environments/{id}/commits
Returns available commits for rollback selection.
Maximum number of commits to return (1-50).
GET /rollbacks/{id}
Returns the status of a specific rollback operation.
Rollback event ID.
pending- Rollback created but not yet startedin_progress- Agents are applying the rollbackcompleted- All agents have applied the target commitfailed- Rollback failed (checkerror_message)
POST /environments/{id}/test-webhook
Sends a test webhook notification to verify the configured webhook URL.
GET /environments/health
Returns health status for all environments.
Servers
POST /servers
GET /servers
Lists all servers with their latest status.
Filter servers by environment ID.
GET /servers/{serverID}
Returns a single server by ID, including last status, agent version, and drift state.
PUT /servers/{serverID}
Updates a server.
DELETE /servers/{serverID}
Deletes a server, revoking its tokens and clearing status history.
POST /servers/{serverID}/toggle-auto-reconcile
Toggles auto-reconcile for a server.
GET /servers/{serverID}/status/history
Returns chronological status entries including commit hash, drift flag, agent version, and timestamp.
GET /servers/{serverID}/drift
Returns detailed drift information for a server, including which packages, services, or files have drifted from the desired state. The drift_details field follows the DriftDetails schema: packages / services / files arrays of DriftItem objects (type, name, expected, actual, message) plus an optional summary.
GET /servers/{serverID}/install-script
Returns a shell script for installing the agent on the target server.
Agent token for authentication.
Agent version to install. When omitted or set to
latest, the parameter is not sent.Base64-encoded CA certificate for custom TLS.
- Downloads the agent binary from GitHub releases
- Creates a
pullbaseservice user - Configures
/etc/pullbase/agent.env - Installs a hardened systemd service
- Starts the agent
Token management
GET /servers/{serverID}/tokens– list tokensPOST /servers/{serverID}/tokens– create token (description,expires_in)DELETE /servers/{serverID}/tokens/{tokenID}– deactivate token
GET /servers/{serverID}/install
Returns installation instructions for the agent.
Token expiration
GET /tokens/expiring
Returns tokens that are expiring within a specified number of days.
Number of days to look ahead (max 365).
Config validation
POST /validate-config
Validates a config.yaml file before committing to Git.
- YAML syntax with line/column error positions
- Package states:
present,latest,absent - Service states:
running,stopped - File modes: valid octal (e.g.,
0644,0755) - Service managers:
systemd,supervisor,supervisord,docker-supervisor,openrc
User management
GET /users
Supports pagination and role filtering.
Maximum number of users per page (1-500).
Pagination offset.
Filter by role (
admin, user, viewer).POST /users
DELETE /users/{userID}
Agent endpoints
These endpoints require agent token authentication (Authorization: Bearer <agent_token>).
GET /agent/serverinfo
Returns Git configuration and target commit for the authenticated agent’s server.
GET /agent/git-token
Returns a short-lived GitHub installation token when the environment uses a GitHub App.
PUT /agent/status
Reports agent status to the server.
agent_version field is optional but recommended. It’s displayed in the UI and helps track agent deployments.
Webhooks
POST /webhooks/{provider}
Receives webhooks from Git providers. Currently supports github.
The webhook payload is validated using HMAC signature verification with PULLBASE_WEBHOOK_SECRET_KEY.
Notification webhooks
Pullbase can send webhook notifications when drift is detected or errors occur during reconciliation.Configuration
Setnotification_webhook_url when creating or updating an environment:
Webhook payload
drift_detected- Agent detected configuration driftapply_error- Error occurred during reconciliationtest- Test webhook from the UI or API
Retry behavior
Failed webhook deliveries are retried up to 3 times with exponential backoff (1s, 2s, 4s delays).GET /webhook-statuses
Returns the current webhook delivery status for all environments.
Web UI
Pullbase includes an embedded web dashboard accessible at/ui/. The UI is a single-page application (SPA) that communicates with the API.
Routes
| Path | Description |
|---|---|
/ | Redirects to /ui/ |
/ui/ | Dashboard home (requires authentication) |
/ui/login | Login page |
/ui/servers | Server list and management |
/ui/environments | Environment list and management |
/ui/assets/* | Static assets (JS, CSS, fonts) |
Authentication
The web UI uses cookie-based session authentication:- User submits credentials to
POST /ui/login - Server validates and sets
session_tokencookie - Subsequent requests include the cookie automatically
- Protected routes redirect to
/ui/loginif unauthenticated
Metrics
Pullbase provides metrics endpoints for monitoring drift events, reconciliation success rates, and agent connectivity.GET /metrics/drift
Returns drift event metrics over a specified time period.
Number of days to include (1-90).
GET /metrics/reconciliation
Returns reconciliation success/failure metrics over time.
Number of days to include (1-90).
GET /metrics/connectivity
Returns agent online/offline status for all servers.
Error handling
400 Bad Request– validation failure (details in theerrorfield)401 Unauthorized– missing or invalid token403 Forbidden– caller lacks the required role (for example, viewer attempting an admin action)404 Not Found– resource does not exist or has been deleted429 Too Many Requests– rate limited (checkRetry-Afterheader)500 Internal Server Error– unexpected server error (check server logs)