DataFrunk HTTP API
API documentation
This reference lives at https://api.datafrunk.com/api-docs. JSON base: https://api.datafrunk.com/api. On this host you can also call relative /api/* routes.
Authentication
Tenant-scoped requests use the session bearer token and tracing headers from the signed-in app.
Authorization: Bearer <token> x-tenant-id: <tenant-uuid> x-user-id: <user-uuid> x-user-email: <user-email>
Some bootstrap routes return 200 with authenticated: false instead of 401 when no bearer token is present (subscription status, provider catalog).
Health
GET /api/health— service health
Auth and signup
POST /api/auth/lookup-email— resolve email / org policyPOST /api/auth/login— password sign-in (returns MFA challenge when required)GET /api/auth/session— restore session snapshot from a valid bearer tokenPOST /api/auth/login-entra— Microsoft ID tokenPOST /api/auth/login-google— Google ID tokenPOST /api/auth/login/verify-mfa— complete email OTPPOST /api/auth/login/forget-remembered-mfa— clear remembered deviceGET /api/auth/entra-config— SPA Entra metadata (anonymous)GET /api/auth/google-config— Google client id (anonymous)POST /api/auth/signup/request-otp,POST /api/auth/signup/verify-otp,POST /api/auth/signup/complete— registrationGET /api/auth/invite-preview— invitation metadata
Tenant, audit, billing
GET /api/tenants/users— tenant user listGET /api/audit/logs— audit log entriesGET /api/providers/availability— provider catalog (tenant or bootstrap)GET /api/payments/subscription-status— billing snapshotPOST /api/payments/checkout-session,portal-session,webhook— Stripe
Your SQL database (Azure SQL)
Endpoints for connections you approve in your own Azure subscription. Data stays in your database; DataFrunk stores encrypted connection metadata only.
GET /api/tenant/connections— connection metadata (no secrets)POST /api/tenant/connections/register— store encrypted credentials (Default Admin)POST /api/tenant/connections/validate— probe connectionGET /api/tenant/sql/tables— list base tables (signed-in tenant roles)GET /api/tenant/sql/rows— paginated rows; optionalincludeTotal=1forCOUNT_BIGPOST /api/tenant/sql/cell— update one cell by primary key (Editor+)
AI (metered)
POST /api/ai/query— chat completion with credit checksGET /api/ai/credits-summary— credits snapshotPOST /api/ai/metered-billing/configure— Default Admin
Console errors
POST /api/console-errors/reportGET /api/console-errors/openPOST /api/console-errors/resolve
Full curl examples and narrative reference: repository file api/API_REFERENCE.md.