Skip to content

API Reference

SentriKat provides a comprehensive REST API for all operations.

Base URL

https://your-sentrikat-instance/api

Authentication

All API requests require authentication via Bearer token.

Getting a Token

curl -X POST https://sentrikat.example.com/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "your-password"}'

Response:

{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "token_type": "bearer",
  "expires_in": 14400
}

Using the Token

Include the token in all requests:

curl https://sentrikat.example.com/api/products \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

API Sections

Common Patterns

Pagination

List endpoints support pagination:

GET /api/products?page=1&per_page=50

Response includes pagination metadata:

{
  "items": [...],
  "total": 156,
  "page": 1,
  "per_page": 50,
  "pages": 4
}

Filtering

Most list endpoints support filtering:

GET /api/products?vendor=Microsoft&criticality=5
GET /api/vulnerabilities?priority=critical&ransomware=true

Sorting

Sort results with sort and order:

GET /api/products?sort=created_at&order=desc

Error Handling

Errors return appropriate HTTP status codes:

Code Meaning
400 Bad Request - Invalid parameters
401 Unauthorized - Missing/invalid token
403 Forbidden - Insufficient permissions
404 Not Found - Resource doesn't exist
429 Too Many Requests - Rate limited
500 Server Error - Contact support

Error response format:

{
  "error": "validation_error",
  "message": "Invalid vendor name",
  "details": {
    "field": "vendor",
    "constraint": "required"
  }
}

Rate Limiting

API requests are rate limited:

Endpoint Limit
Auth endpoints 10/minute
Agent endpoints 60/minute
All other 100/minute

Rate limit headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1234567890

OpenAPI Specification

Interactive API documentation available at:

https://your-sentrikat-instance/api/docs

Download OpenAPI spec:

curl https://sentrikat.example.com/api/openapi.json