API Reference¶
Complete API documentation for ChatOps REST and WebSocket APIs.
Base URL¶
Authentication¶
ChatOps uses two authentication methods:
- JWT Tokens: For user authentication (REST API and frontend WebSockets)
- API Keys: For agent authentication (agent WebSocket connections)
See Authentication Guide for details.
API Endpoints¶
Authentication¶
POST /auth/register- Register new userPOST /auth/login- Login and get tokensPOST /auth/refresh- Refresh access tokenGET /auth/me- Get current userPUT /auth/me- Update profilePOST /auth/change-password- Change passwordPOST /auth/logout- Logout (invalidate refresh token)
Servers¶
GET /servers- List all serversPOST /servers- Create serverGET /servers/{id}- Get server detailsPUT /servers/{id}- Update serverDELETE /servers/{id}- Delete server
Metrics¶
GET /metrics/{server_id}- Get latest metricsGET /metrics/{server_id}/history- Get metrics history
Docker¶
GET /docker/{server_id}/containers- List containersPOST /docker/{server_id}/containers/{container_id}/start- Start containerPOST /docker/{server_id}/containers/{container_id}/stop- Stop containerPOST /docker/{server_id}/containers/{container_id}/restart- Restart containerGET /docker/{server_id}/containers/{container_id}/logs- Get container logs
Commands¶
POST /commands/{server_id}- Execute command
Alerts¶
GET /alerts- List alertsGET /alerts/{id}- Get alert detailsPOST /alerts/{id}/resolve- Resolve alertGET /alerts/thresholds- List alert thresholdsPOST /alerts/thresholds- Create alert thresholdPUT /alerts/thresholds/{id}- Update alert thresholdDELETE /alerts/thresholds/{id}- Delete alert threshold
API Keys¶
GET /api-keys/me- Get my API keysPOST /api-keys- Create API keyDELETE /api-keys/{id}- Revoke API key
WebSocket¶
WS /agents/ws- Agent WebSocket endpointWS /ws/metrics/{server_id}- Frontend metrics WebSocketWS /ws/logs/{server_id}- Frontend logs WebSocket
Interactive Documentation¶
When running the API server, interactive documentation is available at:
- Swagger UI:
/docs - ReDoc:
/redoc
Response Format¶
Success Response¶
Error Response¶
Status Codes¶
200- Success201- Created400- Bad Request401- Unauthorized403- Forbidden404- Not Found422- Validation Error500- Internal Server Error
Rate Limiting¶
Rate limiting is not currently implemented but planned for future versions.