Driftn Documentation
Driftn is an infrastructure observability platform for solo developers and small teams — it watches your stack's security, cost, uptime, and deploys in one place. This reference covers every API endpoint, authentication, rate limits, and integration patterns.
Platform pillars
Quickstart
The fastest way to try the API is a direct curl to the health endpoint — no auth required:
# Check API status
curl https://api.driftn.io/health
To call authenticated endpoints, pass your API secret in the header:
curl -X POST https://api.driftn.io/audit \ -H "Content-Type: application/json" \ -H "X-API-Secret: YOUR_SECRET" \ -d '{"vercel_key":"vk_..."}'
Authentication
Driftn uses two authentication mechanisms depending on the endpoint:
API Secret (server-to-server)
Pass the secret in the X-API-Secret header. This is the primary auth method for all backend-to-backend integrations.
X-API-Secret: YOUR_API_SECRET
User JWT (Supabase Auth)
For user-scoped endpoints (profile, savings history, etc.), pass the Supabase access token:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Obtain a token via magic link:
curl -X POST https://api.driftn.io/auth/register \ -H "Content-Type: application/json" \ -d '{"email":"dev@example.com"}'
Base URL & versioning
https://api.driftn.io
The API is currently at v0.1 with no URL versioning prefix. Breaking changes will be announced in the changelog and communicated via email to active subscribers.
All endpoints accept and return application/json. Timestamps are ISO 8601 in UTC.
Error handling
Driftn uses standard HTTP status codes. Error responses always include a detail field:
{
"detail": "Proporciona al menos una API Key"
}
| Status | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad request — malformed body or invalid signature |
| 401 | Unauthorized — missing or invalid API secret / JWT |
| 422 | Validation error — field missing or value out of range |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Rate limits
Rate limits are applied per IP address using slowapi:
| Endpoint group | Limit |
|---|---|
| Default (all endpoints) | 60 / minute |
| /audit, /predict, /score | 10 / minute |
| /security/scan | 3 / minute |
| /waitlist, /auth/register | 5 / minute |
| /monitor/spike | 30 / minute |
| Demo endpoints | 20 / minute |
429 Too Many Requests. Implement exponential backoff in your client.
Cloud Cost
Audits Vercel, Supabase and/or AWS for cost waste and optimisation opportunities. At least one API key is required.
| Field | Type | Required | Description |
|---|---|---|---|
| vercel_key | string | optional | Vercel personal access token |
| supabase_key | string | optional | Your Supabase project API key |
| aws_key | string | optional | AWS access key ID |
| aws_secret | string | optional | AWS secret access key |
| aws_region | string | optional | AWS region (default: us-east-1) |
| user_email | string | optional | Used to store history in Supabase |
# Example: Vercel + Supabase audit curl -X POST .../audit \ -H "X-API-Secret: YOUR_SECRET" \ -d '{"vercel_key":"vk_live_...", "supabase_key":"eyJ..."}'
Runs the same audit as POST /audit and returns a branded PDF document instead of JSON. Accepts the same parameters.
Runs an audit then generates a 30/90-day cost forecast based on historical data. Accepts the same body as /audit.
# Response includes both audit + prediction { "audit": { ... }, "prediction": { "next_30_days": 310.00, "next_90_days": 980.00, "trend": "increasing", "confidence": 0.82 } }
Calculates a 0–100 Driftn Score based on cost efficiency, deployment health, security posture and prediction risk. Stored in Supabase if user_email is provided.
Applies a suggested remediation from an audit or score result — for example, removing an idle Lambda function or fixing a missing security header. The set of allowed actions is restricted server-side via an allowlist.
| Field | Type | Required | Description |
|---|---|---|---|
| action | string | required | Must match an allowed action id |
| resource_id | string | required | The resource the action targets |
InfraSec
Runs a security scan using the vErtex engine. Covers 12 modules including SSL, OWASP Top 10, headers, WAF, CMS detection, exposed files and API endpoints.
| Field | Type | Required | Description |
|---|---|---|---|
| target | string | required | Full URL to scan (https://...) |
| mode | string | optional | fast | normal | deep (default: fast) |
| vt_key | string | optional | VirusTotal API key for enhanced checks |
| shodan_key | string | optional | Shodan API key for network intelligence |
Check SSL certificates for up to 20 domains at once.
{ "domains": ["example.com", "api.example.com"] }
Analyses HTTP security headers and generates a remediation config. Pass generate: "vercel" or "nginx" to get a ready-to-paste config file.
{
"url": "https://example.com",
"generate": "vercel"
}
Returns recent deployments from a connected Vercel project, including status, duration, and commit metadata. Used to power the Pipeline Health and overview deploy list in the dashboard.
| Field | Type | Required | Description |
|---|---|---|---|
| vercel_key | string | required | Vercel personal access token |
| limit | integer | optional | Default 10 |
API Monitor
Pings a URL from the backend server. More reliable than browser-based pings — avoids CORS and client-side network issues.
| Field | Type | Default | Description |
|---|---|---|---|
| url | string | required | URL to ping |
| method | string | GET | HTTP method |
| timeout | int | 8 | Timeout in seconds (max 30) |
Returns all endpoints registered for monitoring for a given user_id.
GET /api-monitor/endpoints?user_id=default
Returns the last limit ping results (default 50) for an endpoint, ordered newest first.
Infrastructure Platform
Driftn models your infrastructure as a graph of nodes (services, databases, APIs, deployments) and edges (calls, dependencies). Every security scan, deploy, and cost audit emits an event onto a shared timeline, which powers the Infra Graph, Time Machine, and Root Cause Timeline features in the dashboard.
/infra/* endpoints use X-API-Secret auth and accept a user_id query param to scope results to a specific account.
Returns all nodes and edges for the authenticated user. Use /infra/graph/demo (no auth) to preview the graph shape with sample data.
Re-derives nodes and edges from your connected Vercel/Supabase/AWS credentials and emits a graph_sync event onto the timeline.
| Field | Type | Required | Description |
|---|---|---|---|
| vercel_key | string | optional | Used to derive project/deployment nodes |
| supabase_key | string | optional | Used to derive database/auth nodes |
| user_id | string | optional | Defaults to "default" |
Events & Root Cause Timeline
Every meaningful change in your infrastructure — a deploy, a CPU spike, a security finding, a rollback — is recorded as an event. Events with related causes are automatically correlated within a 5-minute window into incident chains.
Supports filtering by severity (critical/high/medium/low/info) and type (deployment, cpu_spike, api_error, incident_opened, etc). /infra/events/demo returns a realistic 10-event incident chain with no auth required — useful for previewing the Root Cause Timeline UI.
Recursively follows an event's related_ids (max depth 10) and returns the full chain sorted chronologically — e.g. deploy → CPU spike → memory spike → Redis timeout → API errors → rollback → recovered.
Time Machine
A snapshot captures the full state of your infrastructure graph (plus the latest score and security scan) at a point in time. Snapshots are created automatically on deploys and security events, or manually via the dashboard.
Returns lightweight snapshot summaries (not the full payload) ordered newest first. Use POST /infra/snapshots to create one on demand.
Compares two snapshots and returns added/removed/modified nodes and edges, plus the cost and health deltas between them. Powers the "Yesterday → Today" comparison view.
Returns the Driftn Score and savings history over the last days (default 30, max 365), plus a count of critical events in that window. Powers the trend charts in the dashboard overview.
Monitoring & Cron
Continuous monitoring is what turns Driftn from a tool you check manually into a platform that watches your stack on its own. A scheduled job (e.g. a cron service of your choice) calls these endpoints on a fixed interval.
X-Cron-Secret header — distinct from X-API-Secret — so a compromised frontend secret cannot trigger monitoring sweeps or drain your email quota.
Iterates over users with monitoring_enabled = true, pings their tracked endpoints, and emits api_error or latency_spike events for failures. Recommended schedule: every 6 hours.
| Header | Required | Description |
|---|---|---|
| X-Cron-Secret | required | Must match CRON_SECRET env var |
Sends each monitored user an email with their week's event count, critical alerts, deploys, and incidents. Recommended schedule: Mondays at 9am.
Toggles continuous monitoring, email alerts, and the weekly digest for a user. Emits a config_change event so the change shows up in the activity feed.
| Field | Type | Required | Description |
|---|---|---|---|
| user_email | string | required | — |
| monitoring_enabled | boolean | optional | Default false |
| alert_email | boolean | optional | Default true |
| weekly_digest | boolean | optional | Default true |
TeamSpace
Returns tasks filtered by user_id (default) or team_id. Also available: POST, PATCH /{id}, DELETE /{id}.
| Field (POST) | Type | Description |
|---|---|---|
| title | string | Task title (required) |
| status | string | backlog | todo | inprogress | done |
| priority | string | low | medium | high | critical |
| assignee | string | Display name of assignee |
| due_date | string | ISO date string (YYYY-MM-DD) |
Returns events ordered by date. Event types: task | deadline | meeting | release.
Returns up to limit messages (default 50) for a channel and team_id. Use POST /teamspace/messages to send.
Business
Returns live MRR, ARR, churn rate and per-plan breakdown from your Stripe account. If STRIPE_SECRET_KEY is not configured, returns mock data with "source": "mock".
Returns active Stripe subscriptions with plan, amount, and start date — the customer-level breakdown behind the /mrr summary.
Receives Stripe events and logs them to Supabase. Configure in your Stripe Dashboard → Webhooks pointing to this endpoint. Requires STRIPE_WEBHOOK_SECRET.
Handled events: customer.subscription.created, customer.subscription.updated, customer.subscription.deleted, invoice.payment_failed.
Platform
Adds an email to the beta waitlist and sends a confirmation email via Resend. Idempotent — calling it again with the same email returns {"status": "already_registered"} instead of an error.
{ "email": "dev@example.com" }
Creates a Stripe Checkout session in one-time payment mode (not a subscription). Limited to 50 seats — once claimed, the endpoint returns 409.
| Field | Type | Required | Description |
|---|---|---|---|
| string | optional | Pre-fills the Stripe checkout email field |
| Field | Type | Description |
|---|---|---|
| plan | string | pro | agency |
| string | Customer email (optional if authenticated) |
Plans & limits
| Feature | Free | Lifetime Deal $50 | Agency €79/mo |
|---|---|---|---|
| Security scanner | Demo data | ✓ Real data | ✓ Real data |
| Cloud Cost audit | Demo data | ✓ Real data | ✓ Real data |
| Continuous monitoring + alerts | — | ✓ | ✓ |
| Infra Graph, Time Machine, Root Cause | Demo only | ✓ Real data | ✓ Real data |
| Full security PDF report | — | ✓ | ✓ |
| Weekly infrastructure digest | — | ✓ | ✓ |
| Client workspaces | — | — | ✓ Unlimited |
| White-label reports | — | — | ✓ |
| Monitored endpoints | 5 | Unlimited | Unlimited |
| Billing | — | One-time, forever | Monthly |
Changelog
v0.2.0 — June 2026
- Pivoted from a security/cost tool to a full infrastructure observability platform
- Infrastructure Platform: Infra Graph, Time Machine, and Root Cause Timeline
- Shared event bus (
infra_events) — every module now emits events that power correlation and the live activity feed - Continuous monitoring: scheduled
/cron/sweepchecks endpoints automatically and emits alerts - Weekly digest email summarising the week's infrastructure activity
- Lifetime Deal ($50 one-time) checkout flow — currently paused while payments are off for the beta launch
- Dedicated beta waitlist landing and 3-step onboarding flow
- TeamSpace UI marked "under construction" while real-time sync is rebuilt (API unaffected)
- Security hardening: SSRF protection on the scanner, request body size limits, global exception handler
- Privacy Policy and Terms of Service published
v0.1.0 — June 2026
- Initial MVP launch with 6 platform pillars
- Cloud Cost: Vercel, Supabase and AWS auditing
- InfraSec: vErtex security scanning, SSL monitor, header analyser
- DevTools: Stack Comparator, ENV Validator, Regex Tester, JSON Tools, Cron Builder
- API Monitor: server-side ping with Supabase history
- TeamSpace: Kanban tasks, calendar events, team chat
- Business: MRR dashboard and revenue forecasting from Stripe
- Public security scanner at
/security-check - Stripe subscriptions with webhook sync
- Supabase Auth (magic link)