API Reference

Complete documentation for FlautoPsy's REST API endpoints.

Base URL

text
https://flautopsy.stralocroft.com/api

Authentication

Include your workspace API key in the

text
Authorization
header for requests that require authentication:

text
Authorization: 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:

  • text
    X-RateLimit-Limit
    — requests allowed per day
  • text
    X-RateLimit-Remaining
    — requests remaining today
  • text
    X-RateLimit-Reset
    — Unix timestamp when limit resets

Webhook Endpoint

POST /webhook

Submit a trace for drift detection. No authentication required (workspace ID is in URL).

URL

text
POST https://flautopsy.stralocroft.com/api/webhook?workspace_id=YOUR_WORKSPACE_ID

Headers

text
Content-Type: application/json

Request Body

json
{
"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

json
{
"success": true,
"trace_id": "trace_abc123",
"message": "Trace recorded"
}

400 Bad Request

json
{
"error": "Missing required field: output"
}

401 Unauthorized

json
{
"error": "Invalid workspace ID"
}

429 Too Many Requests

json
{
"error": "Rate limit exceeded"
}

Workflows Endpoints

GET /workflows

List all workflows in your workspace. Requires authentication.

URL

text
GET https://flautopsy.stralocroft.com/api/workflows

Headers

text
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Response

200 OK

json
{
"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

text
GET https://flautopsy.stralocroft.com/api/workflows/wf_uuid_123

Response

200 OK

json
{
"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

text
GET https://flautopsy.stralocroft.com/api/workflows/wf_uuid_123/alerts

Query Parameters

  • text
    limit
    (optional, default 100, max 1000) — number of alerts to return
  • text
    status
    (optional) — "active" or "resolved"

Response

200 OK

json
{
"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

text
GET https://flautopsy.stralocroft.com/api/workflows/wf_uuid_123/traces

Query Parameters

  • text
    limit
    (optional, default 100, max 1000)
  • text
    offset
    (optional, default 0)
  • text
    order
    (optional, default "desc") — "asc" or "desc"

Response

200 OK

json
{
"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

text
GET https://flautopsy.stralocroft.com/api/alerts

Query Parameters

  • text
    limit
    (optional, default 100, max 1000)
  • text
    status
    (optional) — "active" or "resolved"
  • text
    workflow_id
    (optional) — filter by workflow

Response

200 OK

json
{
"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

text
POST https://flautopsy.stralocroft.com/api/workspace/keys

Headers

text
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request Body

json
{
"name": "Production API Key",
"key_prefix": "prod"
}

Response

200 OK

json
{
"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

text
key
is only shown once. Save it securely.

GET /workspace/keys

List all API keys in your workspace. Requires authentication.

URL

text
GET https://flautopsy.stralocroft.com/api/workspace/keys

Response

200 OK

json
{
"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

text
DELETE https://flautopsy.stralocroft.com/api/workspace/keys/key_uuid_123

Response

200 OK

json
{
"message": "Key revoked successfully"
}

404 Not Found

json
{
"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

bash
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

python
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

javascript
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