REST API Reference

Complete API documentation for integrating with Perimi

v1.0🔒 Requires API authentication📡 Base URL: https://api.perimi.ai

Authentication

API Key Authentication

Include your API key in the Authorization header of all requests:

Authorization: Bearer YOUR_API_KEY

Get Your API Key

Generate API keys from your dashboard:

  1. 1. Log into your Perimi dashboard
  2. 2. Go to Settings → API Keys
  3. 3. Click "Generate New Key"
  4. 4. Copy and store securely

Core Endpoints

POST/api/v1/streams

Create a new video stream

Request Example
{
  "name": "Warehouse Camera 1",
  "location": "Building A - Entrance",
  "connection_url": "rtsp://192.168.1.100:554/stream",
  "credentials": {
    "username": "admin",
    "password": "password123"
  },
  "tags": ["entrance", "high-priority"]
}
GET/api/v1/streams

List all streams

Response Example
{
  "streams": [
    {
      "stream_id": "warehouse-cam-1_abc123",
      "name": "Warehouse Camera 1",
      "status": "active",
      "last_frame": "2024-09-14T10:30:00Z"
    }
  ]
}
GET/api/v1/anomalies

Get anomaly detections

Response Example
{
  "anomalies": [
    {
      "id": "anomaly_123",
      "stream_id": "warehouse-cam-1_abc123",
      "type": "motion_detection",
      "confidence": 0.92,
      "timestamp": "2024-09-14T10:25:00Z",
      "location": {"x": 150, "y": 200}
    }
  ]
}

HTTP Response Codes

Success Codes

200 OKRequest successful
201 CreatedResource created
204 No ContentSuccessful deletion

Error Codes

400 Bad RequestInvalid request data
401 UnauthorizedInvalid API key
404 Not FoundResource not found
429 Rate LimitedToo many requests

SDKs & Tools

Python SDK

Official Python library with full API coverage

pip install perimi-python

JavaScript SDK

Browser and Node.js compatible SDK

npm install @perimi/sdk

Postman Collection

Complete API collection for testing

Download Collection
Perim - AI-Powered Anomaly Detection for Critical Infrastructure