Skip to main content

API Overview

ArgusAI provides a RESTful API for all functionality.

Base URL

http://localhost:8000/api/v1

With HTTPS:

https://your-domain.com/api/v1

Authentication

ArgusAI supports two authentication methods:

Include the X-API-Key header with your API key:

curl -H "X-API-Key: argus_abc123..." http://localhost:8000/api/v1/events

API keys provide:

  • Scoped permissions: read:events, read:cameras, write:cameras, admin
  • Per-key rate limiting: Configurable requests per minute
  • Usage tracking: Monitor requests and last used timestamp

See API Keys for full documentation.

JWT Token Authentication (Dashboard)

For browser-based access, JWT tokens are used via cookies or Authorization header.

Common Endpoints

Cameras

MethodEndpointDescription
GET/camerasList all cameras
POST/camerasCreate camera
GET/cameras/{id}Get camera details
PUT/cameras/{id}Update camera
DELETE/cameras/{id}Delete camera
POST/cameras/{id}/startStart camera
POST/cameras/{id}/stopStop camera
POST/cameras/testTest connection

Events

MethodEndpointDescription
GET/eventsList events (paginated)
GET/events/{id}Get event details
DELETE/events/{id}Delete event
POST/events/{id}/reanalyseRe-analyze event
GET/events/statsEvent statistics
GET/events/exportExport events CSV

Protect Controllers

MethodEndpointDescription
GET/protect/controllersList controllers
POST/protect/controllersAdd controller
GET/protect/controllers/{id}Get controller
PUT/protect/controllers/{id}Update controller
DELETE/protect/controllers/{id}Delete controller
POST/protect/controllers/testTest connection
GET/protect/controllers/{id}/camerasList cameras

AI

MethodEndpointDescription
GET/ai/providersList AI providers
POST/ai/describeDescribe image
GET/ai/usageGet usage stats
GET/ai/capabilitiesGet provider capabilities
GET/ai/context-metricsGet MCP context metrics
POST/ai/refine-promptAI-assisted prompt refinement

API Keys

MethodEndpointDescription
GET/api-keysList API keys
POST/api-keysCreate API key
GET/api-keys/{id}Get API key details
DELETE/api-keys/{id}Revoke API key
GET/api-keys/{id}/usageGet usage stats

System

MethodEndpointDescription
GET/system/healthHealth check
GET/system/settingsGet settings
PUT/system/settingsUpdate settings
GET/system/storageStorage stats
GET/system/ssl-statusSSL configuration

Request Format

Headers

Content-Type: application/json
Accept: application/json

Pagination

List endpoints support pagination:

GET /events?page=1&limit=20

Response includes:

{
"items": [...],
"total": 150,
"page": 1,
"limit": 20,
"pages": 8
}

Filtering

Many endpoints support filtering:

GET /events?camera_id=123&detection_type=person

Response Format

Success

{
"id": "uuid",
"created_at": "2025-12-23T10:30:00Z",
"...": "..."
}

Error

{
"detail": "Error message",
"status_code": 400
}

WebSocket

Real-time updates are available via WebSocket:

ws://localhost:8000/ws

Events:

  • event.created - New event detected
  • camera.status - Camera status change
  • notification.new - New notification

Rate Limiting

API key authenticated requests are rate-limited based on the key's configured limit. Rate limit headers are included in responses:

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

When rate limited, the API returns 429 Too Many Requests with a Retry-After header.

OpenAPI Documentation

Interactive API documentation available at:

  • Swagger UI: /docs
  • ReDoc: /redoc
  • OpenAPI JSON: /openapi.json