API Reference
Complete documentation for FlautoPsy's REST API endpoints.
Base URL
https://flautopsy.stralocroft.com/api Authentication
Include your workspace API key in the
AuthorizationAuthorization: Bearer YOUR_API_KEY Get your API key from Settings → API Keys or Settings → Setup.
Rate Limiting
- Free tier: 1,000 requests/day
- Pro tier: 10,000 requests/day
- Agency tier: Unlimited
Rate limit headers:
- — requests allowed per daytextX-RateLimit-Limit
- — requests remaining todaytextX-RateLimit-Remaining
- — Unix timestamp when limit resetstextX-RateLimit-Reset
Webhook Endpoint
POST /webhook
Submit a trace for drift detection. No authentication required (workspace ID is in URL).
URL
POST https://flautopsy.stralocroft.com/api/webhook?workspace_id=YOUR_WORKSPACE_ID Headers
Content-Type: application/json Request Body
{ "workflow_id": "string (required)", "prompt": "string (optional, max 10,000 chars)", "output": "string (required, max 10,000 chars)", "latency_ms": number (required), "cost_tokens": number (required), "model": "string (required)"} Response
200 OK
{ "success": true, "trace_id": "trace_abc123", "message": "Trace recorded"} 400 Bad Request
{ "error": "Missing required field: output"} 401 Unauthorized
{ "error": "Invalid workspace ID"} 429 Too Many Requests
{ "error": "Rate limit exceeded"} Workflows Endpoints
GET /workflows
List all workflows in your workspace. Requires authentication.
URL
GET https://flautopsy.stralocroft.com/api/workflows Headers
Authorization: Bearer YOUR_API_KEYContent-Type: application/json Response
200 OK
{ "workflows": [ { "id": "wf_uuid_123", "name": "email-classifier", "status": "healthy", "trace_count": 145, "alert_count": 2, "baseline_mature": true, "created_at": "2026-05-01T12:00:00Z" } ]} GET /workflows/:id
Get details for a specific workflow.
URL
GET https://flautopsy.stralocroft.com/api/workflows/wf_uuid_123 Response
200 OK
{ "id": "wf_uuid_123", "name": "email-classifier", "status": "healthy", "trace_count": 145, "alert_count": 2, "baseline_mature": true, "baseline_stats": { "latency_ms": {"mean": 250, "std_dev": 25}, "cost_tokens": {"mean": 850, "std_dev": 50} }, "created_at": "2026-05-01T12:00:00Z"} GET /workflows/:id/alerts
List all alerts for a workflow.
URL
GET https://flautopsy.stralocroft.com/api/workflows/wf_uuid_123/alerts Query Parameters
- (optional, default 100, max 1000) — number of alerts to returntextlimit
- (optional) — "active" or "resolved"textstatus
Response
200 OK
{ "alerts": [ { "id": "alert_xyz", "workflow_id": "wf_uuid_123", "detector": "COST_SPIKE", "severity": "high", "message": "Cost increased 5.2x baseline", "triggered_at": "2026-05-23T14:30:00Z", "status": "active", "evidence": { "baseline_cost": 1000, "current_cost": 5200, "ratio": 5.2 } } ]} GET /workflows/:id/traces
List traces for a workflow.
URL
GET https://flautopsy.stralocroft.com/api/workflows/wf_uuid_123/traces Query Parameters
- (optional, default 100, max 1000)textlimit
- (optional, default 0)textoffset
- (optional, default "desc") — "asc" or "desc"textorder
Response
200 OK
{ "traces": [ { "id": "trace_abc123", "workflow_id": "wf_uuid_123", "prompt": "Classify this email...", "output": "spam", "latency_ms": 245, "cost_tokens": 1250, "model": "gpt-4", "created_at": "2026-05-23T14:25:00Z", "drift_detected": false, "alerts": [] } ], "total": 145, "limit": 100, "offset": 0} Alerts Endpoint
GET /alerts
List all alerts in your workspace.
URL
GET https://flautopsy.stralocroft.com/api/alerts Query Parameters
- (optional, default 100, max 1000)textlimit
- (optional) — "active" or "resolved"textstatus
- (optional) — filter by workflowtextworkflow_id
Response
200 OK
{ "alerts": [ { "id": "alert_xyz", "workflow_id": "wf_uuid_123", "workflow_name": "email-classifier", "detector": "LATENCY_SPIKE", "severity": "high", "message": "Latency increased 6x baseline", "triggered_at": "2026-05-23T14:30:00Z", "status": "active", "evidence": {...} } ], "total": 5} API Keys Endpoint
POST /workspace/keys
Create a new API key. Requires authentication.
URL
POST https://flautopsy.stralocroft.com/api/workspace/keys Headers
Authorization: Bearer YOUR_API_KEYContent-Type: application/json Request Body
{ "name": "Production API Key", "key_prefix": "prod"} Response
200 OK
{ "id": "key_uuid_123", "name": "Production API Key", "key": "flautopsy_key_prod_abc123def456ghi789", "key_prefix": "prod", "created_at": "2026-05-23T14:00:00Z"} Note: The
keyGET /workspace/keys
List all API keys in your workspace. Requires authentication.
URL
GET https://flautopsy.stralocroft.com/api/workspace/keys Response
200 OK
{ "keys": [ { "id": "key_uuid_123", "name": "Production API Key", "key_prefix": "prod", "created_at": "2026-05-23T14:00:00Z", "last_used": "2026-05-23T15:30:00Z" } ]} DELETE /workspace/keys/:id
Revoke an API key. Requires authentication.
URL
DELETE https://flautopsy.stralocroft.com/api/workspace/keys/key_uuid_123 Response
200 OK
{ "message": "Key revoked successfully"} 404 Not Found
{ "error": "Key not found"} Error Codes
| Code | Meaning | |------|---------| | 200 | OK — Request successful | | 400 | Bad Request — Invalid input | | 401 | Unauthorized — Missing/invalid API key | | 404 | Not Found — Resource doesn't exist | | 429 | Rate Limited — Too many requests | | 500 | Server Error — Try again later |
Code Examples
cURL: Submit a Trace
curl -X POST https://flautopsy.stralocroft.com/api/webhook?workspace_id=YOUR_WORKSPACE_ID \ -H "Content-Type: application/json" \ -d '{ "workflow_id": "email-classifier", "prompt": "Classify this email", "output": "spam", "latency_ms": 245, "cost_tokens": 1250, "model": "gpt-4" }' Python: Get Workflows
import requests headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"} response = requests.get( "https://flautopsy.stralocroft.com/api/workflows", headers=headers) workflows = response.json()["workflows"]for wf in workflows: print(f"{wf['name']}: {wf['trace_count']} traces") Node.js: List Alerts
const fetch = require('node-fetch'); async function getAlerts() { const response = await fetch( 'https://flautopsy.stralocroft.com/api/alerts?status=active', { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } } ); const data = await response.json(); console.log(`${data.alerts.length} active alerts`);} getAlerts(); Webhook & Trace Details
For more information about the webhook and trace fields, see:
Need help? Email support@stralocroft.com