Webhooks, cron and internal endpoints
Webhook paths are excluded from middleware (api/webhooks is in the matcher’s negative lookahead) and
authenticate themselves. Handler behaviour is documented in Events.
Provider webhooks
POST /api/webhooks/event-logger
Retell AI call events.
- Flow
-
-
Parse the payload and extract source, event type and
call.call_id. -
Ignore inbound calls as a safety measure.
-
Upsert a
WebhookEventrow, unique on(source, eventId). -
Dispatch through
webhookEventDispatcher. -
Return
200.
-
- Registered event types
-
call_analyzedonly. Thecall_startedregistration is commented out inlib/events/event-handler.ts, socall_startedpayloads are stored but not handled.
There is no signature verification on this endpoint. Treat the URL as a secret and add verification before exposing it more widely.
POST /api/webhooks/resend
Resend email events.
- Flow
-
-
Verify the Svix signature when
RESEND_WEBHOOK_SECRETis set; skipped when unset (development). -
Upsert a
WebhookEventrow, idempotent on thesvix-idheader. -
Extract
data.email_idas the correlation key. -
Dispatch through
ResendWebhookDispatcher.
-
- Handled
-
email.sent,email.delivered,email.delivery_delayed,email.opened,email.clicked,email.bounced,email.complained,email.unsubscribed,email.received. See Resend email events.
POST /api/webhooks/nooks
Human-dialer call outcomes.
- Flow
-
-
Optional secret check —
Authorization: BearerorX-Nooks-SignatureagainstNOOKS_WEBHOOK_SECRET. -
Upsert a
WebhookEventrow withsource = "Nooks", idempotent oneventId. -
Dispatch through
NooksWebhookDispatcher.
-
- Handled
-
call.logged. See Nooks events.
POST /api/webhooks/hubspot
HubSpot CRM subscription notifications.
- Flow
-
-
Validate the HubSpot HMAC (or legacy) signature using
HUBSPOT_WEBHOOK_CLIENT_SECRET(lib/utils/hubspot/webhook-signature.ts). -
Normalise the payload (
lib/utils/hubspot/webhook-normalize.ts). -
Publish as
Crm.HubSpotWebhookto the CRM queue viapublishCrmWorkflowEvent.
-
POST /api/webhooks/telnyx
Telnyx AI assistant call events. Store only — no handlers are registered.
- Flow
-
-
Require
TELNYX_PUBLIC_KEY. Return503when it is unset. -
Verify the Ed25519 signature (
telnyx-timestamp,telnyx-signature-ed25519) over the raw body. Return401when the signature is missing, invalid, or older than five minutes. -
Upsert a
WebhookEventrow withsource = "Telnyx", idempotent ondata.id. -
Dispatch through
TelnyxWebhookDispatcher. Unknown event types are stored and return200.
-
POST /api/webhooks/elevenlabs
ElevenLabs Agents post-call events. Store only — no dispatcher or handlers.
- Flow
-
-
Require
ELEVENLABS_WEBHOOK_SECRET. Return503when it is unset. -
Verify the
ElevenLabs-SignatureHMAC (t=…,v0=…) over the raw body. Return401when it is missing, malformed, invalid, or more than 30 minutes old. -
Parse the JSON body; return
400when it is not a JSON object. -
Upsert a
WebhookEventrow withsource = "ElevenLabs", idempotent on{type}:{conversation_id}.post_call_audiois stored without its base64 audio.
-
POST /api/webhooks/five9
Accepts a Five9 payload and stores it for later processing.
|
This route writes with |
Cron jobs
There are no HTTP cron endpoints. The global jobs are Inngest cron functions, which Inngest invokes
through the signed /api/inngest endpoint. Schedules are in UTC.
| Function | Schedule | Effect |
|---|---|---|
|
|
|
|
|
Zeroes |
|
|
Releases numbers unused 3+ days with fewer than 10 lifetime calls, one Inngest step per number; returns |
To run one now, invoke it from the Inngest dashboard (or the Inngest dev server locally).
Internal endpoints
Gated by verifyInternalSecret() — Authorization: Bearer <INTERNAL_API_SECRET>. Fails closed when the
secret is unset.
| Endpoint | Caller |
|---|---|
|
|
|
|
Inngest
GET|POST|PUT /api/inngest
Serves every registered function through serve() from inngest/next: testContextCollection,
processRequest, purchasePhoneNumber, callTarget, callEndedAnalysis, nooksCallAnalysis,
emailSend, emailCampaignDuplicate, sequenceExecute.
Authenticated by Inngest’s own signing key (INNGEST_SIGNING_KEY). Adding a function means adding it to
the functions array — a function that is not listed will never run. See Workflows.