This directory contains per-function deep docs for Supabase Edge Function APIs.
๐ Looking for the master list? See api-master-reference.md โ single page covering all 68 edge functions + MIVAA Python endpoints (auth models, categories, call patterns). Start there if you're integrating; come here for endpoint details.
All APIs are implemented as Supabase Edge Functions running on Deno and are accessible via:
Base URL: https://bgbavxtjlbvgplozizxu.supabase.co/functions/v1/
Email sending, domain verification, and analytics using AWS SES.
email-apiMulti-channel messaging (SMS, WhatsApp) using Twilio.
messaging-apiContact management for CRM system.
crm-contacts-apiUser account and profile management.
crm-users-apiCompany records management.
crm-companies-apiQuote requests and proposal management.
quotes-apiprice_source, price_lookup_call_id), product_prices cache tableAdmin-only API for sourcing, composing, and committing prices from the
"Pricing" Knowledge Base category. Covers: category setup, ingesting price
docs, AI-mode lookup via price_lookup agent tool, quick-pick direct
search, commit flow, and audit trail.
agent-chat (AI mode), mivaa-gateway action
search_knowledge_base (quick mode), Supabase PostgREST for commitsprice_proposal reasoning chain, price_doc_type
sub-types (price_list / discount_rule / contract_terms / promotion),
upsert-by-title doc ingestion, full audit trail via agent_tool_call_logsCollaborative filtering recommendations and interaction tracking.
recommendations-apiUnified multi-agent AI system powered by LangChain.js and Claude.
agent-chatkai (default, Sonnet), interior-designer (Sonnet), demo (Haiku). Legacy aliases search/insights/seo resolve to kai.load_skill), multimodal images, SSE streaming, long-term memoryGateway to Python backend services (RAG, search, AI services).
mivaa-gatewayBatch processing of PDF documents.
pdf-batch-processWeb scraping session control and management.
scrape-session-managerIntelligent XML file imports with AI-powered field mapping.
xml-import-orchestratorScheduled price monitoring from competitor sources.
price-monitoring-cronVisual workflow automation โ execute, test, and event-trigger flows.
flow-engine, flow-scheduler-cron, flow-webhookMulti-model AI video generation for interior design.
generate-interior-video-v2, generate-social-videoTransform empty room photos into furnished renders.
generate-virtual-stagingGemini-powered interior image generation with 4 modes.
generate-interior-geminiMasked inpainting โ regenerate a painted zone in a room image.
generate-region-editGenerate 3D Gaussian Splat worlds from interior images via WorldLabs Marble.
generate-vr-worldmarble-1.0-draft (18 cr, ~30โ45s), marble-1.1 (190 cr, ~5min). Legacy 0.1-mini/0.1-plus deprecated.vr_worldsGenerate PBR texture maps for AR preview rendering.
generate-pbr-mapsClaude-powered search result re-ordering for improved relevance.
ai-rerankVoyage AI 1024D embedding generation for Knowledge Base documents.
kb-generate-embeddingkb_docs insert/content change. Idempotent via content hash.Pinterest account linking with board/pin access.
pinterest-oauthget-auth-url, callback, get-boards, get-board-pins, disconnectsocial_accounts table (platform='pinterest')PINTEREST_APP_ID, PINTEREST_APP_SECRET, PINTEREST_REDIRECT_URIImport pins into moodboards (works pre-OAuth via oEmbed).
pinterest-importextract-pin, import-pin, import-pins-bulkComplete SEO content generation pipeline โ 5 functions, all POST + JWT.
| Function | Purpose |
|---|---|
seo-research |
DataForSEO keyword research (6 parallel API calls) |
seo-plan |
Article structure + meta tags + FAQ schema |
seo-write |
Full article via Claude Sonnet |
seo-analyze |
15+ SEO quality checks, auto-fix via Gemini |
seo-pipeline |
Orchestrator: research โ plan โ write โ analyze |
Surfaced to the kai agent as sub-agent tools (admin-gated).
Social media OAuth, publishing, analytics, and content generation.
late-oauth, late-publish, late-analytics, generate-social-content, generate-social-image, generate-social-videoSubscriptions and credit purchases via Stripe.
crm-stripe-api, stripe-checkout, stripe-customer-portalStripe webhook event handling for subscriptions and payments.
stripe-webhooksUniversal executor for all background agent types.
background-agent-runneragent_id, catalog endpoint, chain/event/cron/manual triggersSigLIP2 visual embedding generation.
Not user-callable. pg_cron invokes these on a schedule. No auth header from frontend โ they use SUPABASE_SERVICE_ROLE_KEY.
| Function | Schedule | Purpose |
|---|---|---|
agent-scheduler-cron |
1 min | Dispatch background agents whose cron is due |
auto-recovery-cron |
5 min | Re-dispatch stuck runs (>8 min no heartbeat, <3 attempts) |
job-cleanup-cron |
weekly | Purge old jobs, logs, stale progress |
flow-scheduler-cron |
1 min | Run due scheduled flows |
ai-pricing-updater |
weekly | Sync AI model pricing into ai_model_pricing |
campaign-processor |
1 min | Email campaign dispatcher (Resend, 8/min) |
check-material-alerts |
daily | Run saved searches + email subscribers |
scheduled-import-runner |
5 min | Run due XML imports |
messaging-processor |
1 min | SMS/WhatsApp batch sender (Twilio, 10/batch) |
Wipe derived data while preserving accounts/KB/CRM/prompts.
reset-platformAggregated health status across AI providers + MIVAA + external APIs.
health-checkReusable field-mapping templates for XML/scraping imports.
field-templatesAI-suggested field mappings from HTML analysis.
suggest-fieldsMost APIs require authentication via Supabase Auth:
Authorization: Bearer <supabase_access_token>
import { supabase } from '@/integrations/supabase/client';
const { data: { session } } = await supabase.auth.getSession();
const accessToken = session?.access_token;
// Using Supabase client (recommended)
const { data, error } = await supabase.functions.invoke('email-api', {
body: {
action: 'send',
to: 'user@example.com',
subject: 'Hello',
html: '<p>Hello World</p>'
}
});
// Using fetch
const response = await fetch(
'https://bgbavxtjlbvgplozizxu.supabase.co/functions/v1/email-api',
{
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
action: 'send',
to: 'user@example.com',
subject: 'Hello',
html: '<p>Hello World</p>'
})
}
);
All APIs return errors in a consistent format:
{
success: false,
error: string,
code?: string,
details?: object
}
200 - Success201 - Created400 - Bad Request (validation error)401 - Unauthorized (missing or invalid token)403 - Forbidden (insufficient permissions)404 - Not Found500 - Internal Server Error503 - Service UnavailableDefault rate limits apply to all APIs:
All APIs support CORS with the following headers:
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: authorization, x-client-info, apikey, content-type
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE, PATCH
For API support or questions: