Skip to main content
Internal reference — not the public API

This documents NearSync's internal action-dispatch surface, used by the apps themselves and by tenant automations. It is not the public API and carries no stability guarantee — actions may change or be removed without notice. For the supported, versioned public API see API Reference.

Hyper-Worker Gateway

The hyper-worker is NearSync's server-side API gateway, deployed as a Supabase Edge Function. All API requests route through a single endpoint, dispatched to handler modules based on a type field in the request body.

Base URL

https://<your-supabase-project>.supabase.co/functions/v1/hyper-worker

Replace <your-supabase-project> with your Supabase project reference. For BYOK deployments, this is your own Supabase project URL.

Request Format

All endpoints use POST with a JSON body unless otherwise noted. The type field determines which handler processes the request.

curl -X POST https://<project>.supabase.co/functions/v1/hyper-worker \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-jwt-token>" \
-d '{
"type": "ai-chat",
"prompt": "Summarize this deal"
}'

Exceptions to POST

Three patterns use GET instead of POST:

PatternMethodUse Case
Health checkGET (no params)Uptime monitoring
WhatsApp webhook verificationGET with hub.* paramsMeta webhook setup
Email tracking pixelGET with type=track-emailOpen tracking

Service Modules

The hyper-worker routes requests across 15 service domains:

ModuleEndpointsDescription
Auth & Userscreate-user, send-welcome, invite-staff, validate-invite, accept-inviteAccount creation, invitations, onboarding
Chatfetch-admin-chats, link-whatsapp-contact, update-chat-session, fetch-chat-history, log-web-chatConversation management
Google Workspacefetch-inbox, fetch-email-detail, mark-email-read, fetch-calendar, create-meet-event, send-emailGmail, Calendar, Meet integration
Bookingget-availability, booking, manage-bookingScheduling and appointment management
Financecreate-payment, verify-paymentPayment processing (Stripe, Razorpay)
Legalverify-document, sign-document, generate-contractDocument signing and generation
Projectsprd, enrich-project, enrich-organizationDeal creation, AI enrichment
Messagingsend-whatsapp, get-voice-tokenWhatsApp and Twilio voice
Workflowsexecute-workflow, resume-workflow, process_queueAutomation engine
AIai-chatMulti-provider chat completion
CRM Synccrm-init-oauth, crm-connections, crm-disconnect, crm-save-api-key, crm-start-sync, crm-sync-status, crm-sync-historyExternal CRM integration
Integrationsintegration-init-oauth, integration-connections, integration-disconnect, integration-test, integration-refreshUnified OAuth for 14+ providers
Utilitiessystem-cleanup, sync-google-reviews, track-viewMaintenance and tracking
WebhooksWhatsApp incoming, Twilio voiceInbound event handlers
TrackingEmail open pixelEmail read tracking

Response Format

All responses return JSON (unless noted otherwise). Successful responses typically include a success: true field or the requested data directly.

{
"success": true
}

Error Responses

Errors return a JSON object with an error field and an appropriate HTTP status code.

{
"error": "Missing required field: email"
}
StatusMeaning
400Invalid action type or bad request body
401Missing or invalid JWT
403Webhook verification failed
429Rate limit exceeded
500Server error

See Rate Limits for 429 response headers and Authentication for auth details.

Health Check

A plain GET request with no query parameters returns the isolate health status.

curl https://<project>.supabase.co/functions/v1/hyper-worker

Response (200, text/plain):

NearSync Worker Passive Health Check: OK

CORS

The gateway enforces origin-based CORS. Only requests from *.nearsync.tech are allowed in production. Preflight responses are cached for 86,400 seconds (24 hours). Supported methods: GET, POST, OPTIONS.

Standalone Edge Functions

In addition to the hyper-worker, NearSync deploys several standalone edge functions at their own URLs:

FunctionPathPurpose
canva-oauth/functions/v1/canva-oauthCanva OAuth flow and design operations
crm-oauth/functions/v1/crm-oauthHubSpot and Salesforce OAuth callbacks
integration-oauth/functions/v1/integration-oauthUnified OAuth callback for 14+ providers
process-reminders/functions/v1/process-remindersCron-triggered reminder processing
fetch-reviews/functions/v1/fetch-reviewsGoogle Places review sync
lusha-sync/functions/v1/lusha-syncLusha lead search and enrichment

External Dependencies

The hyper-worker connects to several third-party APIs. If a dependency is unavailable, only the affected feature degrades - the gateway itself remains operational.

ServiceFeatures Affected
Google Gemini / OpenAIAI chat, PRD generation, enrichment
Gmail APIEmail read/send
Google CalendarBooking, availability, calendar sync
Google DocsContract and invoice generation
Meta Graph APIWhatsApp messaging
Stripe / RazorpayPayment processing
TwilioVoice calls
ResendTransactional email notifications

Next Steps