REST API Reference
Integrate CleanShift into your infrastructure with our JSON REST API. All endpoints require a JWT bearer token unless noted otherwise.
Authentication
Include your token in every request: Authorization: Bearer <YOUR_TOKEN>. Obtain a token via POST /auth/login. Tokens expire after 24 hours; use the refresh token to obtain a new one. API access is available on all plans.
Authentication
Register and authenticate users to obtain JWT tokens for API access.
/auth/loginAuthenticate with email + password. Returns a JWT access token and refresh token.
No auth/auth/registerCreate a new account. Returns user object and initial API key.
No authServers
Manage the servers (nodes) registered to your account. Each server runs the CleanShift agent.
/serversList all registered servers with status, last check-in time, and site count.
/servers/registerRegister a new server. Returns a unique agent token for the installer.
Scans
Trigger on-demand scans and retrieve results. Scans include file, database, and vulnerability checks.
/scans/triggerQueue a new scan on a server or specific site. Accepts scan_mode (quick | full | deep).
/scans/{id}Retrieve scan results by ID including threat counts, timestamps, and finding details.
Threats
View, manage, and remediate detected threats across your fleet.
/threatsList all detected threats with filtering by severity, status, server, and site.
/threats/{id}Update a threat's status (acknowledge, false-positive, resolved). Supports bulk operations.
/threats/{id}/remediateTrigger auto-remediation for a specific threat using the appropriate CVE playbook.
Agent
Endpoints used by the on-server agent for heartbeat check-ins and real-time communication.
/agent/checkinPeriodic heartbeat from the agent. Reports server health, site inventory, and pending results.
/ws/agentWebSocket connection for real-time bidirectional communication — push scan commands, stream results.
Example Request
| Detail | Value |
|---|---|
| Base URL | https://api.cleanshift.osg.co.in |
| Rate Limit | 100 requests / minute per token |
| Response Format | JSON (application/json) |
| WebSocket Protocol | wss:// with JWT query param |
| Token Expiry | 24 hours (refresh tokens: 30 days) |
| API Versioning | URL path — currently /v1 (implied) |
Ready to integrate?
Sign up for a free account to get your API key and start building.