Documentation

API Reference

Complete reference for the Protectron REST API (v1).

https://api.protectron.ai/v1

Overview

The Protectron API allows you to programmatically interact with your compliance data. Use it to:

  • Submit events from custom integrations
  • Query audit trail data
  • Generate compliance reports
  • Manage AI systems and configurations
  • Set up webhooks for real-time notifications

API Version: v1 (stable)

Authentication

All API requests require authentication using an API key.

Getting Your API Key

  1. Go to dashboard.protectron.ai
  2. Navigate to Settings → API Keys
  3. Click Create New Key
  4. Copy the key (you won't see it again)

Using Your API Key

Include your API key in the Authorization header:

curl https://api.protectron.ai/v1/systems \
  -H "Authorization: Bearer pk_live_xxxxxxxxxxxxxxxx"

Key Types

Key PrefixTypeUse Case
pk_live_ProductionLive applications
pk_test_TestDevelopment and testing

Key Scopes

ScopeDescription
events:writeSubmit events
events:readRead events and traces
systems:readRead system configurations
systems:writeModify system configurations
reports:readGenerate and download reports
adminFull access

Rate Limits

PlanRequests/minuteRequests/day
Starter6010,000
Growth300100,000
Scale1,000500,000
EnterpriseCustomCustom

Rate limit headers are included in every response:

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
X-RateLimit-Reset: 1702742400

Errors

The API uses standard HTTP status codes:

CodeDescription
200Success
201Created
400Bad Request — Invalid parameters
401Unauthorized — Invalid or missing API key
403Forbidden — Insufficient permissions
404Not Found — Resource doesn't exist
429Too Many Requests — Rate limited
500Internal Server Error

Error responses include details:

{
  "error": {
    "code": "invalid_parameter",
    "message": "system_id is required",
    "param": "system_id",
    "doc_url": "https://docs.protectron.ai/api#events-create"
  }
}

Endpoints

Systems

GET/v1/systemsList all AI systems
GET/v1/systems/{system_id}Get system details
POST/v1/systemsCreate a new system
PATCH/v1/systems/{system_id}Update a system
DELETE/v1/systems/{system_id}Delete a system

Events

POST/v1/eventsCreate a single event
POST/v1/events/batchCreate events in batch (up to 1000)
GET/v1/eventsList events with filters
GET/v1/events/{event_id}Get event details

Traces

GET/v1/tracesList traces
GET/v1/traces/{trace_id}Get trace with events

Reports

POST/v1/reportsGenerate a compliance report
GET/v1/reports/{report_id}Get report status
GET/v1/reports/{report_id}/downloadDownload report file

Webhooks

POST/v1/webhooksCreate a webhook
GET/v1/webhooksList webhooks
DELETE/v1/webhooks/{webhook_id}Delete a webhook

Event Types

TypeDescription
llm_callLLM prompt and completion
tool_callTool/function invocation
agent_actionAgent decision or action
agent_delegationTask delegation between agents
human_approvalHuman approved action
human_rejectionHuman rejected action
human_overrideHuman overrode decision
risk_eventAnomaly or violation
errorError or exception
customCustom event type

Code Examples

Python

import requests

API_KEY = "pk_live_xxx"
BASE_URL = "https://api.protectron.ai/v1"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

# List systems
response = requests.get(f"{BASE_URL}/systems", headers=headers)
systems = response.json()["data"]

# Create event
event = {
    "system_id": "sys_abc123",
    "event_type": "llm_call",
    "data": {
        "model": "gpt-5.2",
        "input": [{"role": "user", "content": "Hello"}],
        "output": "Hi there!",
        "tokens_input": 5,
        "tokens_output": 3
    }
}
response = requests.post(f"{BASE_URL}/events", json=event, headers=headers)

TypeScript

const API_KEY = 'pk_live_xxx';
const BASE_URL = 'https://api.protectron.ai/v1';

async function listSystems() {
  const response = await fetch(`${BASE_URL}/systems`, {
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
    },
  });
  return response.json();
}

async function createEvent(event: object) {
  const response = await fetch(`${BASE_URL}/events`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(event),
  });
  return response.json();
}

cURL

# List systems
curl https://api.protectron.ai/v1/systems \
  -H "Authorization: Bearer pk_live_xxx"

# Create event
curl https://api.protectron.ai/v1/events \
  -X POST \
  -H "Authorization: Bearer pk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "system_id": "sys_abc123",
    "event_type": "llm_call",
    "data": {
      "model": "gpt-5.2",
      "tokens_input": 5,
      "tokens_output": 3
    }
  }'

SDKs

For most use cases, we recommend using our SDKs instead of the REST API directly:

LanguagePackageDocumentation
PythonprotectronSDK Overview
TypeScript@protectron/sdkSDK Overview

Ready to Integrate?

Get started with the SDK for the easiest integration, or use the REST API for custom implementations.