Docs
Intelbase developer docs
This documents only what the project actually implements. Unimplemented capabilities are labelled as such — no sample code pretending to work.
Lookup orchestration & status
The browser posts { kind, value, requestId, consent }. The server resolves user and organization from the session — client-sent userId / organizationId is never trusted.
Emails are lowercased and length-checked; usernames have leading @ stripped. Quota check and task creation happen inside a single transaction,organization_id + request_id is unique so retries never bill twice.
Each source runs with its own timeout and status. Final states converge tocompleted / partial / empty / failed / cancelled, with reserve and refund recorded separately in the usage ledger.
Internal API
| Method & path | Behavior |
|---|---|
| POST /api/lookups | Idempotently create and execute a lookup; returns the full snapshot plus statusUrl / eventsUrl |
| GET /api/lookups | Paginated history with kind, status, cursor, limit |
| GET /api/lookups/[id] | Current snapshot; cross-tenant access returns 404 without leaking existence |
| GET /api/lookups/[id]/events | SSE replay of persisted events with Last-Event-ID / after support |
| POST /api/lookups/[id]?action=cancel | Idempotent cancel; incurred provider cost is reported separately |
| POST /api/lookups/[id]/exports?format=csv|json | Generate a redacted export and write an audit event |
| GET /api/providers | Public capability, configuration status and storage mode — no secrets |
| POST /api/monitors | Create a monitor; explicitly rejected without completed domain verification |
| POST /api/api-keys | Create a key; plaintext returned exactly once |
| POST /api/shares | Create a revocable, expiring redacted share link |
Public API
Reuses the same orchestration layer. Requires an Authorization: Bearer key, a UUID Idempotency-Key and the matching scope.
curl -X POST https://intelbase.art/api/v1/lookup/email \
-H "Authorization: Bearer ib_xxxxxxxx" \
-H "Idempotency-Key: 3f1b2c4d-8e9a-4b7c-9d1e-2f3a4b5c6d7e" \
-H "Content-Type: application/json" \
-d '{"value":"name@example.com","consent":true}'The response contains assessments, accounts, exposures, providers and timeline. Raw vendor responses are never exposed.
Error semantics
| code | HTTP | Retryable | Meaning |
|---|---|---|---|
| invalid_request | 400 | No | Missing kind / value / consent / idempotency key, or invalid format |
| unauthenticated | 401 | No | Not signed in, or API key invalid |
| forbidden | 403 | No | Cross-tenant, untrusted origin, or missing required scope |
| not_found | 404 | No | Task does not exist or belongs to another organization |
| conflict | 409 | No | Same idempotency key used with different parameters |
| quota_exceeded | 429 | No | Organization daily quota exhausted |
| provider_unavailable | 503 | Yes | All sources unavailable; quota has been refunded |
| internal_error | 500 | Yes | Server error; includes requestId for troubleshooting |
Source support matrix
| Source | Supports | Requires | Status |
|---|---|---|---|
Demo data Fixed synthetic data for validating the full interaction chain; never calls external sources. | email / username | No key needed | Not configured |
Email-domain signals Reads MX / SPF / DMARC via public DNS-over-HTTPS; describes domain configuration only. | No key needed | Available | |
Gravatar Public avatar & profile API for the email hash. | No key needed | Available | |
GitHub Public user profile and creation date from GitHub’s REST API. | username | GITHUB_API_TOKEN | Available |
Breach metadata (HIBP) Licensed breach metadata: event, date, data classes. No credentials. | HIBP_API_KEY | Not configured | |
Email-linked accounts (Apify) Runs a licensed actor to collect email-linked public accounts. | APIFY_TOKEN, APIFY_EMAIL_LOOKUP_ACTOR_ID | Not configured |
DNS uses Cloudflare DoH; Gravatar uses the official public profile API; GitHub uses the public REST API (optional token raises the limit). HIBP and Apify need keys — when missing the state is not_configured and no metered request is made.
Data model
Migration script: data/intelbase/schema.sql. Every table uses a dedicated DB_TABLE_PREFIX (default intelbase_) — never reuse the template site’s production database.
lookups
Tasks, encrypted input, idempotency key, final-state snapshot
lookup_events
Monotonic seq, supports resumable replay
usage_ledger
reserve / refund with a unique business key
monitors / monitor_runs
Targets, verification state, next run, deltas
api_keys
SHA-256 hash, scopes, revocation time
report_shares
Token hash, redaction level, expiry & revocation
memberships
Organization, member, role
suppression_requests
Removal / objection intake and disposition
Deployment & configuration checklist
The table below is generated from live environment probing — the checkmarks are this instance’s real state.
| Variable | Purpose | Required | Status |
|---|---|---|---|
| AUTH_SECRET | Auth.js signing secretsign-in sessions | Yes | Missing |
| AUTH_GOOGLE_ID | Google OAuth Client IDGoogle sign-in | Yes | Missing |
| AUTH_GOOGLE_SECRET | Google OAuth Client SecretGoogle sign-in | Yes | Missing |
| SUPABASE_URL | Supabase Project URLpersistent storage, history, team | Yes | Missing |
| SUPABASE_SERVICE_ROLE_KEY | Supabase service_role Keyserver-side database access | Yes | Missing |
| LOOKUP_INPUT_ENCRYPTION_KEY | Lookup input encryption keyencrypted lookup values | Yes | Missing |
| LOOKUP_HMAC_KEY | Lookup input HMAC keydeduplication index | Yes | Missing |
| HIBP_API_KEY | Have I Been Pwned Keybreach metadata module | Optional | Missing |
| GITHUB_API_TOKEN | GitHub Tokenusername lookup rate limit | Optional | Missing |
| APIFY_TOKEN | Apify Tokenemail-linked accounts | Optional | Missing |
| DODO_PAYMENTS_API_KEY | Dodo Payments API Keysubscriptions and quota | Optional | Missing |
| DODO_PAYMENTS_WEBHOOK_KEY | Dodo Webhook verification keypayment callbacks | Optional | Missing |
| WEBHOOK_SIGNING_KEY | Monitor webhook signing keymonitor notifications | Optional | Missing |
Minimal go-live steps
- 1. Create a dedicated Supabase project and run
data/intelbase/schema.sqlin the SQL Editor. - 2. Configure AUTH_SECRET and Google OAuth; callback is
https://your-host/api/auth/callback/google. - 3. Set AUTH_URL and NEXT_PUBLIC_SITE_URL to the final domain (https, no path).
- 4. Generate two 32-byte keys — LOOKUP_INPUT_ENCRYPTION_KEY, LOOKUP_HMAC_KEY — and store them as server secrets.
- 5. Configure HIBP / Apify / GitHub / Dodo as needed; unconfigured modules automatically show not_configured.
- 6. Verify with
npm run build, then deploy to Cloudflare or a container.
Known limits
- Long lookups currently complete within a single request; no persistent queue. Apify overruns return unknown without retry to avoid double billing. Production should adopt Cloudflare Queues or a dedicated worker.
- Monitoring depends on scheduled execution and domain verification; today only a controlled switch exists.
- PDF export is unimplemented — no unauditable screenshot-style reports.
- The AI summary is not wired to a model and shows not_configured; once wired it may only cite existing evidenceIds.
- Payments reuse the template’s Dodo integration capability, but new plans need dedicated products and webhooks — currently unbound, so the pricing button shows "payments not configured".
- Bulk lookups, SSO and webhook notifications are planned but have no clickable placeholders.