API & Edge Functions
The server-side Edge Functions that power ingestion, connection and dispatch in PipeValue.
PipeValue's backend is a set of Supabase Edge Functions (Deno). Browser-facing functions require a valid user JWT and verify org membership via row-level security; service and cron calls use the service role.
ingest
Public webhook endpoint. Accepts a signed JSON payload, normalizes it, scores it, and stores a lead event.
POST /functions/v1/ingest/<connector_id>
{ "email": "jane@acme.com", "amount": 4200, "industry": "SaaS" }
connect-source
Stores a manually-entered CRM token encrypted in the Vault, marks the connector active, and introspects available fields.
list-source-fields
Returns the attribute catalog for a source, grouped by object (Contacts / Deals / Companies for HubSpot). Refreshes the token on demand before introspecting.
sync-leads
Polling ingestion: fetches recently-modified contacts, enriches HubSpot contacts with associated Deal/Company properties, scores each lead, upserts the event, and dispatches if the model is live.
sync-outcomes
Pulls closed-won outcomes (stage + realized revenue) back from the CRM and links them to the original lead events — the data behind Calibration.
connect-manual
The destinations equivalent of connect-source: stores an ad-platform token (encrypted) and the account / pixel / conversion target.
dispatch
Builds the platform-specific payload for a scored lead and sends it to every connected destination, recording a per-destination status.
sent— accepted by the platform's conversions API.skipped— model in shadow mode, or no target configured.error— rejected; the reason is logged for retry.