Skip to main content

API overview

PatchBase exposes a REST API under /api/v1/. All endpoints return JSON. The API is used by the dashboard, the agent, and any integrations you build.

Base URL

http://<server-host>:5199/api/v1

Endpoints at a glance

Health

MethodPathAuthDescription
GET/healthNoneHealth check

Setup

MethodPathAuthDescription
GET/setup/statusNoneCheck if initial setup is needed
POST/setup/completeNoneComplete initial setup (create admin)

Authentication

MethodPathAuthDescription
POST/auth/loginNoneLogin with email/password, returns JWT

Profile

MethodPathAuthDescription
GET/profileJWTGet current user profile
PATCH/profileJWTUpdate profile

Settings

MethodPathAuthDescription
GET/settingsJWTGet server settings
PATCH/settingsJWTUpdate settings
POST/settings/test-emailJWTSend a test email
POST/settings/send-reportJWTSend a vulnerability report email

Hosts

MethodPathAuthDescription
GET/hostsJWTList all hosts
GET/hosts/pendingJWTList pending (unapproved) hosts
GET/hosts/tokensJWTList registration tokens
POST/hosts/tokensJWTCreate a registration token
POST/hosts/tokens/{tokenID}/revokeJWTRevoke a registration token
POST/hosts/{hostID}/approveJWTApprove a pending host
POST/hosts/sshJWTCreate an SSH pull host
POST/hosts/manualJWTCreate a manual host
GET/hosts/manual/scriptJWTGet the collector script (?os_family=apt|rpm)
POST/hosts/{hostID}/onboard-sshJWTOnboard an SSH host
POST/hosts/{hostID}/reportJWTUpload a manual collection report
DELETE/hosts/{hostID}JWTDelete a host
GET/hosts/{hostID}JWTGet host details
GET/hosts/{hostID}/snapshotJWTGet latest snapshot
GET/hosts/{hostID}/pull-jobsJWTList SSH pull job history
POST/hosts/{hostID}/pull-nowJWTTrigger an immediate SSH pull
GET/hosts/{hostID}/packages/vulnerableJWTList vulnerable packages
GET/hosts/{hostID}/packages/upgradableJWTList upgradable packages
GET/hosts/{hostID}/kernel-postureJWTGet kernel posture info

Advisories

MethodPathAuthDescription
GET/advisories/scopesJWTList advisory scope statuses
POST/advisories/scopes/{scopeKey}/syncJWTTrigger manual scope sync
GET/advisories/overviewJWTGet advisory overview
GET/advisories/{id}JWTGet advisory details

Dashboard

MethodPathAuthDescription
GET/dashboard/overviewJWTGet dashboard summary

Agent endpoints

MethodPathAuthDescription
POST/agent/registerRegistration tokenRegister a new host
POST/agent/snapshotsHost access tokenSubmit a snapshot

WebSocket

MethodPathAuthDescription
GET/wsJWTWebSocket for live dashboard updates

See the individual pages in this section for details on authentication, host endpoints, advisory endpoints, and WebSocket events.