API Documentation

Programmatic access to FlareCanary. Manage endpoints, view drift events, and configure alerts via REST API.

Authentication

All authenticated endpoints accept either a session cookie (from the dashboard) or an API key via the Authorization header.

curl -H "Authorization: Bearer fc_your_api_key_here" \
  https://flarecanary.com/api/endpoints

Generate an API key in Dashboard → Settings. Keys use the fc_ prefix.

Endpoints

GET/api/endpointsAuth required

List all your monitored endpoint subscriptions.

Query: ?active=true|false (default: true)

// Response
{
  "endpoints": [
    {
      "id": "sub_abc123",
      "name": "Stripe Charges",
      "url": "https://api.stripe.com/v1/charges",
      "method": "GET",
      "pollIntervalMinutes": 60,
      "isActive": true,
      "tags": ["payments", "critical"],
      "driftCount": 2,
      "lastCheckedAt": "2026-03-16T10:00:00Z",
      "lastStatusCode": 200
    }
  ],
  "count": 1
}
POST/api/endpointsAuth required

Subscribe to a new API endpoint for schema drift monitoring.

// Request body
{
  "name": "Stripe Charges",          // required, max 200 chars
  "url": "https://api.stripe.com/v1/charges",  // required
  "method": "GET",                    // GET|POST|PUT|PATCH|DELETE
  "headers": { "Authorization": "Bearer sk_..." },
  "requestBody": null,                // for POST/PUT/PATCH
  "pollIntervalMinutes": 60,          // 15-1440 (plan-dependent)
  "tags": ["payments"]                // max 10 tags
}

// Response (201)
{ "id": "sub_abc123", "name": "Stripe Charges", ... }
GET/api/endpoints/:idAuth required

Get a single endpoint subscription with full details.

PATCH/api/endpoints/:idAuth required

Update subscription settings. URL/method/headers are immutable.

// Request body (all fields optional)
{
  "name": "Updated Name",
  "pollIntervalMinutes": 120,
  "tags": ["updated-tag"],
  "isActive": false
}
DELETE/api/endpoints/:idAuth required

Unsubscribe from an endpoint. If no other subscribers remain, the watched URL is also removed.

POST/api/endpoints/testAuth required

Test an endpoint connection without saving. Returns status code, response time, and JSON detection.

// Request body
{
  "url": "https://api.example.com/data",
  "method": "GET",
  "headers": {}
}

// Response
{
  "success": true,
  "statusCode": 200,
  "responseTimeMs": 142,
  "isJson": true,
  "fieldCount": 12
}
POST/api/endpoints/:id/refreshAuth required

Manually re-poll the endpoint and update the baseline schema.

Drift Events

GET/api/endpoints/:id/driftsAuth required

Get drift event history for an endpoint.

Query: ?limit=50&severity=breaking|warning|info

// Response
{
  "endpointId": "sub_abc123",
  "endpointName": "Stripe Charges",
  "events": [
    {
      "id": "drift_xyz",
      "severity": "breaking",
      "changes": [
        { "path": "data.currency", "type": "removed" },
        { "path": "data.amount", "type": "type_change",
          "from": "number", "to": "string" }
      ],
      "detectedAt": "2026-03-16T10:00:00Z"
    }
  ],
  "count": 1
}

Poll History & Uptime

GET/api/endpoints/:id/historyAuth required

Get poll history with response time stats for charting.

Query: ?range=24h|7d|30d (default: 7d)

// Response
{
  "history": [
    { "polledAt": "2026-03-16T10:00:00Z",
      "statusCode": 200, "responseTimeMs": 142, "success": true }
  ],
  "stats": {
    "min": 98, "max": 312, "avg": 156,
    "p50": 142, "p95": 285, "p99": 310
  },
  "totalPolls": 168,
  "successfulPolls": 167,
  "failedPolls": 1
}
GET/api/endpoints/:id/uptimeAuth required

Get 30-day uptime percentage with daily breakdown.

// Response
{
  "uptimePercent": 99.4,
  "totalPolls": 720,
  "successfulPolls": 716,
  "failedPolls": 4,
  "dailyBuckets": [
    { "date": "2026-03-16", "total": 24, "success": 24 }
  ]
}

Alerts

GET/api/alertsAuth required

List alert configurations. Optionally filter by endpoint.

Query: ?endpointId=sub_abc123 (optional)

POST/api/alertsAuth required

Create a new alert destination (email or webhook).

// Email alert
{
  "type": "email",
  "config": { "to": "you@example.com" },
  "endpointId": "sub_abc123"  // optional (global if omitted)
}

// Webhook alert
{
  "type": "webhook",
  "config": { "url": "https://hooks.slack.com/..." }
}
PATCH/api/alerts/:idAuth required

Update alert config or toggle active/inactive.

DELETE/api/alerts/:idAuth required

Remove an alert configuration.

Settings

GET/api/settings/api-keyAuth required

Check if you have an API key generated.

POST/api/settings/api-keyAuth required

Generate or regenerate your API key. Returns the raw key (store it securely — it cannot be retrieved later).

DELETE/api/settings/api-keyAuth required

Revoke your current API key.

GET/api/settings/planAuth required

Get your current plan, limits, and usage.

// Response
{
  "plan": "starter",
  "limits": {
    "maxEndpoints": 25,
    "minPollIntervalMinutes": 60
  },
  "usage": { "endpoints": 8 }
}

Demo

GET/api/demo

See a pre-built schema drift example (Stripe-like charge object). No authentication required.

POST/api/demo

Compare two JSON objects for schema differences. No authentication required.

// Request body
{
  "before": { "id": 1, "name": "Alice", "active": true },
  "after": { "id": "1", "name": "Alice", "role": "admin" }
}

// Response
{
  "drift": {
    "changes": [
      { "path": "id", "type": "type_change", "from": "number", "to": "string" },
      { "path": "active", "type": "removed" },
      { "path": "role", "type": "added" }
    ],
    "summary": { "added": 1, "removed": 1, "typeChanges": 1 }
  }
}
GET/api/demo/unstable

A demo endpoint that rotates its schema every 6 hours. Monitor this to see drift detection in action.

Errors

All errors return a JSON body with an error field.

StatusMeaning
400Invalid request body or parameters
401Missing or invalid authentication
403Plan limit reached (ENDPOINT_LIMIT, INTERVAL_LIMIT)
404Resource not found
409Conflict (e.g., duplicate email)
500Internal server error

Rate Limits & Plans

PlanEndpointsMin poll intervalPrice
Free324 hours$0
Starter251 hour$19/mo
Pro10015 minutes$49/mo