Skip to main content

Edge Functions Overview

All edge functions are deployed as Supabase Edge Functions (Deno/TypeScript). Unless noted otherwise, they require a Supabase JWT Bearer token and are scoped to the authenticated user's agency.

Agent Management

FunctionMethodDescription
agents-createPOSTCreate a new agent in Ultravox with local mapping
agents-listGETList all agents with Ultravox data merged with local mappings
agents-getGETGet a single agent with stats and phone number assignments
agents-updatePUTUpdate agent configuration in Ultravox and local DB
agents-deleteDELETEDelete an agent from Ultravox and remove local mapping
agents-assignPOSTAssign agents to clients and campaigns (batch support)
agents-syncPOSTSync agents between local DB and Ultravox

Phone Number Management

FunctionMethodDescription
phone-numbers-searchGETSearch available phone numbers on Telnyx
phone-numbers-purchasePOSTPurchase a phone number via Telnyx
phone-numbers-listGETList agency phone numbers with filtering and stats
phone-numbers-assignPOST/PATCH/DELETEAssign or unassign phone numbers to agents
phone-numbers-releaseDELETEPermanently release a phone number from Telnyx

Telephony Integration

FunctionMethodDescription
provision-telephonyPOSTFull provisioning: create Telnyx app, outbound profile, import to Ultravox
import-telnyx-to-ultravoxPOSTRetry failed Ultravox import after Telnyx provisioning
verify-telephony-configGETVerify Telnyx configuration in Ultravox

Tool Management

FunctionMethodDescription
tools-listGETList tools with filtering by type/category
tools-getGETGet a single tool by ID with optional refresh
tools-syncPOSTSync all tools from Ultravox to local DB

Voice Management

FunctionMethodDescription
voices-listGETList cached voices (no API key needed)
voices-syncPOSTSync voices from Ultravox to local cache

API Key Validation & Storage

FunctionMethodDescription
validate-ultravox-keyPOSTValidate an Ultravox API key
validate-telnyx-keyPOSTValidate a Telnyx API key
save-ultravox-integrationPOSTStore encrypted Ultravox API key
store-telnyx-credentialsPOSTStore encrypted Telnyx credentials

Historical Data Sync

FunctionMethodDescription
start-historical-syncPOSTInitiate a historical call sync job
process-historical-syncPOSTProcess sync jobs in batches (cron)
cancel-historical-syncPOSTCancel pending/in-progress sync jobs

Call Processing

FunctionMethodDescription
get-call-recordingGETGet call recording URL from Ultravox
process-enrichment-queuePOSTFetch transcripts and run AI analysis (cron)
process-webhook-queuePOSTProcess queued webhook events (cron)

Integration & Status

FunctionMethodDescription
get-integration-statusGETShow integration status with next steps
get-sync-statusGETGet active/recent sync job status
get-ultravox-agentsGETFetch all Ultravox agents for manual mapping

Configuration & Aggregation

FunctionMethodDescription
save-agent-mappingPOSTSave agent-to-client/campaign mappings
refresh-aggregationsPOSTRefresh daily stats for last 7 days (cron)

Webhook

FunctionMethodDescription
webhook-ingestPOSTReceive and queue Ultravox webhook events