Skip to main content
RapidDev - Software Development Agency
lovable-integrationsEdge Function Integration

How to Integrate Lovable with ScheduleOnce (OnceHub)

Connect ScheduleOnce (OnceHub) to Lovable by creating an Edge Function that calls OnceHub's REST API with an API key stored in Cloud Secrets. Build sales and support scheduling tools with team routing, round-robin assignment, and multi-step booking flows. ScheduleOnce excels over Calendly and Doodle when you need intelligent routing of meetings to the right team member based on form inputs.

What you'll learn

  • How to create an OnceHub API key and store it in Lovable Cloud Secrets
  • How to build a Lovable Edge Function that queries OnceHub booking pages and creates bookings
  • How to integrate team routing and round-robin scheduling into a Lovable sales flow
  • How to receive OnceHub webhooks for real-time booking notifications
  • When ScheduleOnce is the right scheduling tool versus Calendly or Acuity
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate14 min read35 minutesSchedulingMarch 2026RapidDev Engineering Team
TL;DR

Connect ScheduleOnce (OnceHub) to Lovable by creating an Edge Function that calls OnceHub's REST API with an API key stored in Cloud Secrets. Build sales and support scheduling tools with team routing, round-robin assignment, and multi-step booking flows. ScheduleOnce excels over Calendly and Doodle when you need intelligent routing of meetings to the right team member based on form inputs.

Build Sales and Support Scheduling Flows with ScheduleOnce in Lovable

ScheduleOnce, now rebranded as OnceHub, is built for revenue-generating and support teams rather than individual professionals or service businesses. Its key differentiator is intelligent meeting routing: when a prospect or customer requests a meeting, OnceHub can route the booking to the right team member based on their answers to qualification questions, territory assignment, account ownership, or simple round-robin distribution. This is the scheduling tool of choice for SaaS sales teams, customer success organizations, and support departments where routing meetings correctly is as important as scheduling them.

Lovable can embed OnceHub scheduling into sales and support workflows in ways that go beyond what OnceHub's native booking page offers. A pre-qualification form in Lovable collects prospect information, an Edge Function determines the right sales rep based on territory or product interest, and the booking widget shows availability for that specific rep — all without the prospect seeing routing logic or ever going to a generic booking page. Post-booking automations (CRM update, Slack notification, custom confirmation email) trigger through OnceHub webhooks received by a Lovable Edge Function.

The integration uses OnceHub's REST API (the company's current branding is OnceHub but the product was previously ScheduleOnce and both names are still widely used). API access is available on paid plans, providing access to booking pages, bookings, master pages, and team member data.

Integration method

Edge Function Integration

ScheduleOnce connects to Lovable through an Edge Function that calls OnceHub's REST API with an API key stored in Cloud Secrets. The integration supports booking page lookups, booking creation, team routing queries, and webhook receipt for real-time booking notifications.

Prerequisites

  • A Lovable account with a project open and Lovable Cloud enabled
  • An active OnceHub (ScheduleOnce) account with at least one booking page configured
  • An OnceHub API key generated from your account's integrations settings
  • Your OnceHub booking page IDs for the pages you want to embed or reference
  • Understanding of your team's routing logic — how meetings should be assigned to specific team members

Step-by-step guide

1

Generate Your OnceHub API Key

Log in to your OnceHub account at app.oncehub.com and navigate to Account Settings (click your profile avatar in the top right). Look for 'Integrations' or 'API' in the settings navigation. OnceHub's API key generation is typically found under Integrations → API → Generate API Key. OnceHub may require a specific account tier for API access — check that your plan includes API integration capabilities. Business and Enterprise plans typically include API access. If you're on a lower tier, contact OnceHub support to inquire about API access. The API key provides access to your OnceHub account data including booking pages, bookings, master pages, and team member information. Store it securely — do not share it or include it in frontend code. Also note your booking page IDs. In OnceHub, navigate to each booking page you want to reference, and note the page's ID from the URL or the page's settings panel. Booking page IDs are the unique identifiers you pass to the API when querying specific pages or creating bookings.

Pro tip: OnceHub's product has been evolving rapidly — the API documentation may refer to the product as both ScheduleOnce and OnceHub. Both names refer to the same product at app.oncehub.com. If API documentation is inconsistent, check developer.oncehub.com for the current API reference.

Expected result: An OnceHub API key is generated and ready for use. You have noted the booking page IDs for the pages your Lovable integration will reference.

2

Store OnceHub Credentials in Cloud Secrets

In Lovable, click the '+' button next to the Preview panel to open the Cloud tab, then navigate to Secrets. Add: - ONCEHUB_API_KEY: your OnceHub API key OnceHub's API authentication uses the X-API-Key header (or Authorization: Bearer depending on the API version). The Edge Function adds this header to every OnceHub API request. Verify the exact header format from OnceHub's API documentation for your account. For Lovable apps that serve multiple clients with different OnceHub accounts, store the API key for each client separately — either in separate Lovable projects or as separate Cloud Secrets with descriptive names (e.g., ONCEHUB_API_KEY_CLIENT_A and ONCEHUB_API_KEY_CLIENT_B). The Edge Function can accept a client identifier parameter to select the appropriate key.

Pro tip: OnceHub API keys are long-lived credentials. If your integration is for a client's account, have them generate the API key themselves and share it with you securely — this way they maintain ownership and can revoke it if needed.

Expected result: ONCEHUB_API_KEY is stored in Cloud Secrets. The Edge Function can authenticate OnceHub API requests via Deno.env.get().

3

Create the OnceHub API Edge Function

Create the Edge Function that handles OnceHub API operations. OnceHub's REST API base URL is https://api.oncehub.com/v2 and supports operations for booking pages, bookings, and team management. Key OnceHub API endpoints: GET /bookingpages to list all booking pages with their IDs, names, and booking URLs; GET /bookingpages/{id} to get a specific booking page's details and availability; POST /bookings to create a new booking with prospect/customer information; GET /bookings to list bookings with date range and booking page filters; GET /bookings/{id} for specific booking details. When creating a booking via the API, OnceHub typically requires: bookingPageId, startTime (the selected meeting time), and booker information (name, email, phone). Some booking pages have custom form fields — check the booking page configuration to understand what additional data to pass. For team routing scenarios, your Edge Function needs to know which booking page to use based on the routing logic. Store a mapping of routing criteria to booking page IDs in your Supabase database, and have the Edge Function query this mapping to select the right page.

Lovable Prompt

Create an Edge Function called oncehub-proxy at supabase/functions/oncehub-proxy/index.ts. Read ONCEHUB_API_KEY from Deno environment variables. Add it as X-API-Key header (or Authorization: Bearer — use whichever OnceHub requires for your API version). Accept POST requests with: operation (getBookingPages, getBookingPage, createBooking, getBookings, getBooking), and operation-specific params (for getBookingPage/createBooking/getBooking: bookingPageId or bookingId; for createBooking: bookingPageId, startTime, firstName, lastName, email, phone, and optional additionalFields object; for getBookings: startDate, endDate, bookingPageId). Handle OnceHub pagination for list endpoints. Return the response with CORS headers.

Paste this in Lovable chat

supabase/functions/oncehub-proxy/index.ts
1// supabase/functions/oncehub-proxy/index.ts
2import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
3
4const corsHeaders = {
5 "Access-Control-Allow-Origin": "*",
6 "Access-Control-Allow-Headers": "authorization, x-client-info, apikey, content-type",
7 "Access-Control-Allow-Methods": "POST, OPTIONS",
8};
9
10serve(async (req: Request) => {
11 if (req.method === "OPTIONS") {
12 return new Response("ok", { headers: corsHeaders });
13 }
14
15 try {
16 const apiKey = Deno.env.get("ONCEHUB_API_KEY");
17 const headers = { "X-API-Key": apiKey || "", "Content-Type": "application/json", "Accept": "application/json" };
18 const BASE_URL = "https://api.oncehub.com/v2";
19
20 const { operation, ...params } = await req.json();
21 let response;
22
23 switch (operation) {
24 case "getBookingPages":
25 response = await fetch(`${BASE_URL}/bookingpages`, { headers });
26 break;
27 case "getBookingPage":
28 response = await fetch(`${BASE_URL}/bookingpages/${params.bookingPageId}`, { headers });
29 break;
30 case "createBooking":
31 response = await fetch(`${BASE_URL}/bookings`, {
32 method: "POST",
33 headers,
34 body: JSON.stringify({
35 booking_page_id: params.bookingPageId,
36 starting_time: params.startTime,
37 customer: { name: params.firstName + " " + params.lastName, email: params.email, phone: params.phone },
38 additional_fields: params.additionalFields || {},
39 }),
40 });
41 break;
42 case "getBookings": {
43 const qp = new URLSearchParams();
44 if (params.startDate) qp.set("starting_after", params.startDate);
45 if (params.endDate) qp.set("starting_before", params.endDate);
46 if (params.bookingPageId) qp.set("booking_page_id", params.bookingPageId);
47 response = await fetch(`${BASE_URL}/bookings?${qp}`, { headers });
48 break;
49 }
50 case "getBooking":
51 response = await fetch(`${BASE_URL}/bookings/${params.bookingId}`, { headers });
52 break;
53 default:
54 return new Response(JSON.stringify({ error: `Unknown operation: ${operation}` }), { status: 400, headers: { ...corsHeaders, "Content-Type": "application/json" } });
55 }
56
57 const data = await response.json();
58 return new Response(JSON.stringify(data), { status: response.status, headers: { ...corsHeaders, "Content-Type": "application/json" } });
59 } catch (error) {
60 return new Response(JSON.stringify({ error: error.message }), { status: 500, headers: { ...corsHeaders, "Content-Type": "application/json" } });
61 }
62});

Pro tip: Test your Edge Function against the getBookingPages operation first — if it returns your booking page list, authentication is working. Then test createBooking with a test booking page in OnceHub's test/sandbox mode to verify the booking creation flow before connecting to production pages.

Expected result: The oncehub-proxy Edge Function is deployed. The getBookingPages operation returns your OnceHub booking pages as a JSON list.

4

Build the Sales Qualification and Routing Flow

With the Edge Function working, build the qualification and routing flow. This is where Lovable's strength shines — the multi-step form with conditional logic that routes to the right booking page based on answers. The qualification form typically has 3-5 questions that determine routing: company size (determines if enterprise or SMB team), industry or vertical (routes to industry-specialist), product area of interest (routes to product specialist), current tooling (helps the sales rep prepare), and geographic region (routes to territory rep). After the form is completed, the frontend's routing logic (or a call to the Edge Function with a routing table stored in Supabase) selects the appropriate booking page ID. The page ID is then passed to the booking component, which either redirects to OnceHub's booking URL or embeds the OnceHub booking widget inline. OnceHub provides an embed URL format for its booking pages: https://app.oncehub.com/booking/{pageId} — this can be used in an iframe for inline embedding without needing the full API booking flow. The iframe approach is simpler than building a custom time picker and gives you OnceHub's full booking UI including calendar navigation.

Lovable Prompt

Build a sales scheduling flow in my Lovable app. Step 1: a qualification form with questions: Company Size (dropdown: 1-10/11-50/51-200/200+ employees), Industry (dropdown: SaaS/Ecommerce/Healthcare/Finance/Other), and Primary Goal (dropdown: Automate workflows/Reduce costs/Scale team/Other). Step 2: based on their answers, route to different OnceHub booking pages (stored in Supabase as routing_rules table with columns: company_size_min, company_size_max, industry, booking_page_id, rep_name). Step 3: show a message 'Great, we matched you with {repName}' and embed OnceHub's booking page in an iframe using the URL https://app.oncehub.com/booking/{bookingPageId} with the prospect's name and email pre-populated as URL parameters. Show a progress indicator for the 3 steps.

Paste this in Lovable chat

Pro tip: OnceHub booking pages support pre-filling the customer form via URL parameters. Append ?name={firstName}+{lastName}&email={email}&phone={phone} to the booking page URL to pre-populate the contact fields so the prospect only needs to select a time.

Expected result: The qualification form routes users to the correct OnceHub booking page based on their answers. The booking page appears inline with the prospect's name and email pre-filled.

5

Set Up OnceHub Webhooks and Build the Booking Dashboard

OnceHub webhooks send real-time notifications when bookings are created, rescheduled, or cancelled. Create a Lovable Edge Function as the webhook receiver to capture booking events and trigger downstream actions. In OnceHub settings, navigate to Integrations → Webhooks and add your Edge Function URL as a webhook endpoint. Select the events: booking.created, booking.rescheduled, booking.canceled. OnceHub sends POST requests with booking data including the booking page ID, booking time, customer information, and any form field responses. Use webhooks to: store confirmed bookings in a Supabase bookings table, send a Slack notification to the assigned sales rep, trigger a CRM record creation or update, or start a nurture email sequence through your email provider. Build an admin booking dashboard that reads from the Supabase bookings table (populated by webhooks) rather than polling the OnceHub API on every page load. This approach is faster, reduces API usage, and ensures the dashboard works even if OnceHub is temporarily slow to respond. For complex sales scheduling workflows with CRM integration, lead scoring, or sophisticated routing rules, RapidDev's team can help design the complete sales scheduling architecture.

Lovable Prompt

Create a webhook receiver Edge Function called oncehub-webhook at supabase/functions/oncehub-webhook/index.ts. It should: validate a secret parameter (ONCEHUB_WEBHOOK_SECRET from Deno.env.get) in the URL query string, accept POST requests from OnceHub with booking data (booking_id, booking_page_id, status, starting_time, customer_name, customer_email, customer_phone, created_at), save to a Supabase bookings table (booking_id, booking_page_id, status, meeting_time, customer_name, customer_email, customer_phone, created_at, rep_name — looked up from the routing_rules table by booking_page_id), and return 200 immediately. Then build an admin bookings dashboard reading from the Supabase bookings table showing today's and this week's bookings with customer names, assigned reps, meeting times, and status badges.

Paste this in Lovable chat

Expected result: New bookings through the OnceHub pages trigger webhook events that create records in the Supabase bookings table. The admin dashboard shows all bookings with rep assignments and statuses from the Supabase table without additional API calls.

Common use cases

Build a qualified prospect booking flow for a SaaS sales team

Prospects fill out a qualification form on the Lovable-built landing page. Based on their company size and use case answers, they are routed to the right account executive's OnceHub booking page. The booking widget shows only that AE's availability, and booking confirmation triggers a CRM lead update.

Lovable Prompt

I'm building a sales scheduling flow. Prospects fill out a 4-question form (company size, industry, primary use case, current tool). Based on answers, I route to different OnceHub booking pages: enterprises go to AE Sarah (booking page ID: ABC123), SMBs go to AE Mike (booking page ID: DEF456). I've stored ONCEHUB_API_KEY in Cloud Secrets. Create an Edge Function called oncehub-proxy that: gets booking page details (availability URL), creates bookings with prospect data, and handles webhook events. Build the qualification form, routing logic, and an embedded booking step showing the assigned AE's calendar.

Copy this prompt to try it in Lovable

Create a customer success scheduling portal with territory-based routing

A SaaS company's customer success team manages accounts by region. When customers request a meeting through the Lovable portal, their account ownership is looked up in Supabase, and they are automatically routed to their assigned CSM's OnceHub booking page for scheduling.

Lovable Prompt

My customer portal needs to route support meetings to the right Customer Success Manager. When a customer clicks 'Schedule a Meeting', look up their account in Supabase to get their assigned_csm_email. Then use ONCEHUB_API_KEY to find the OnceHub booking page for that CSM (stored in a csm_booking_pages Supabase table with columns: email, oncehub_page_id, booking_url). Display an embedded booking widget for the correct CSM. If no CSM is assigned, show a default round-robin booking page (page ID: GHI789). After booking, create a meeting record in Supabase and send a Slack notification to the CSM.

Copy this prompt to try it in Lovable

Build a support ticket-to-meeting escalation workflow

When a support ticket is marked as needing a call, an automated OnceHub booking link is sent to the customer. A Lovable admin dashboard shows all escalated tickets with meeting status — whether a meeting has been scheduled, the booking time, and the assigned support agent.

Lovable Prompt

I want to add meeting escalation to my support ticket system. When an agent marks a ticket as 'Needs Call', the system creates an OnceHub booking for the next available support agent on the round-robin team page (page ID: JKL012) and sends the booking URL to the customer's email via Resend. Using ONCEHUB_API_KEY, create an Edge Function that gets available booking links for a team page and creates a pre-filled booking with customer name and email. Build an escalation dashboard showing tickets with 'Needs Call' status, booking sent/pending status, and confirmed meeting times from OnceHub webhooks.

Copy this prompt to try it in Lovable

Troubleshooting

OnceHub API returns 401 or 403 on all requests

Cause: The API key is invalid, not yet activated, or the account plan does not include API access.

Solution: Verify your API key in OnceHub account settings → Integrations → API. Confirm your account plan includes API access by checking OnceHub's pricing page or contacting their support. If the key was recently generated, wait a few minutes for activation. Test the key by calling GET /bookingpages directly in your browser with the X-API-Key header set to your key.

Booking creation returns an error about invalid starting_time format

Cause: OnceHub expects the booking start time in a specific ISO 8601 format with UTC timezone indicator, and the value passed may be missing the timezone offset or in a wrong format.

Solution: Ensure the startTime parameter is a valid ISO 8601 string in UTC format: '2026-04-15T14:00:00Z'. Times without a timezone indicator may be rejected or interpreted incorrectly. Convert the user-selected time to UTC before passing it to the createBooking operation. Also verify the time falls within the booking page's available hours — times outside availability hours will be rejected.

typescript
1// Convert local time selection to UTC for OnceHub:
2const localDate = new Date(`${selectedDate}T${selectedTime}:00`);
3const utcString = localDate.toISOString(); // '2026-04-15T14:00:00.000Z'

Webhook receiver Edge Function does not receive OnceHub webhook events

Cause: The webhook URL is not correctly registered in OnceHub, the Edge Function URL is wrong, or the secret parameter validation is rejecting the request.

Solution: In OnceHub settings, verify the webhook URL is the exact Edge Function URL with the secret parameter: https://{project-ref}.supabase.co/functions/v1/oncehub-webhook?secret={ONCEHUB_WEBHOOK_SECRET}. Test by manually triggering a test booking in OnceHub and checking Cloud → Logs for the incoming request. If the request reaches the function but is rejected, temporarily remove the secret validation to confirm the payload format before re-adding security.

OnceHub booking page embed shows the wrong timezone to users

Cause: The OnceHub booking page URL does not include timezone information, and OnceHub defaults to the booking page owner's timezone.

Solution: Pass the user's timezone as a URL parameter in the iframe src: ?timezone={Intl.DateTimeFormat().resolvedOptions().timeZone} (URL-encoded). OnceHub's booking pages generally support a timezone parameter to display available times in the visitor's local timezone. This prevents users from booking in the wrong timezone.

typescript
1// Pass user timezone to OnceHub iframe
2const userTimezone = encodeURIComponent(Intl.DateTimeFormat().resolvedOptions().timeZone);
3const iframeSrc = `https://app.oncehub.com/booking/${bookingPageId}?name=${encodeURIComponent(name)}&email=${encodeURIComponent(email)}&timezone=${userTimezone}`;

Best practices

  • Build routing logic in your Lovable app using Supabase-stored routing rules rather than hardcoding booking page IDs — this lets business owners update routing without code changes
  • Use OnceHub's iframe embed for the booking UI when possible rather than building a custom time picker — OnceHub's native booking page handles timezone display, availability, and buffer times correctly
  • Pre-fill OnceHub booking page URLs with prospect name and email via URL parameters to reduce friction and improve booking completion rates
  • Store confirmed bookings in Supabase via webhooks to enable fast dashboard queries without polling the OnceHub API on every page load
  • Pass the user's browser timezone as a URL parameter to the OnceHub iframe to prevent timezone confusion for distributed teams and international prospects
  • Use OnceHub's team booking pages (round-robin) for scenarios where any available team member can take the meeting — this avoids the need to track individual rep availability
  • Implement webhook signature validation using the ONCEHUB_WEBHOOK_SECRET pattern to prevent unauthorized booking notifications from reaching your Edge Function
  • Log all OnceHub webhook events to a Supabase table before processing — this creates an audit trail and lets you replay events if processing fails

Alternatives

Frequently asked questions

What is the difference between ScheduleOnce and OnceHub?

ScheduleOnce is the original product name and OnceHub is the company's rebranding (app.oncehub.com). They are the same product. The ScheduleOnce name is still widely used in the market and in older documentation. When you see references to both names, treat them as equivalent. The current application is at app.oncehub.com and the API is at api.oncehub.com.

How does OnceHub round-robin routing work and can I control it via the API?

OnceHub's round-robin assigns incoming bookings to team members in sequence, distributing meetings evenly. The routing is managed within OnceHub's team booking page settings — you assign team members to a booking pool and OnceHub handles the assignment logic. Via the API, you create bookings against the team booking page ID, and OnceHub automatically assigns the booking to the next available team member. You can retrieve the assigned team member from the booking response after creation.

Can I use ScheduleOnce/OnceHub to qualify prospects before showing the booking calendar?

OnceHub has a feature called 'Booking Forms' that lets you add qualification questions before the calendar appears in the booking flow. However, for advanced routing based on form responses (routing to different team members based on company size or territory), you get more control by building the qualification logic in Lovable and then directing to the appropriate OnceHub booking page ID based on the answers. This hybrid approach gives you full control over the routing logic while using OnceHub's scheduling engine.

Does OnceHub support multi-meeting workflows where a sequence of meetings is booked?

OnceHub supports multi-step scheduling through its Master Pages feature, which links multiple booking pages in a sequence. Via the API, you can reference master pages when creating bookings to initiate the multi-step flow. This is useful for sales workflows where a discovery call leads to a demo booking, which then triggers a proposal review meeting. The master page configuration in OnceHub defines the sequence, and the API call initiates the first booking in the chain.

What is the rate limit for OnceHub's API?

OnceHub's API rate limits vary by plan. Contact OnceHub support for the current rate limit documentation for your plan tier. For typical Lovable app usage — a few hundred bookings per month — rate limits are unlikely to be an issue. For high-volume scenarios (thousands of bookings per day), use the webhook pattern for data collection rather than polling the API repeatedly, and cache booking page data in Supabase to minimize read requests.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.