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.
Booking Endpoints
Endpoints for the public booking engine. Availability checks and booking creation are public (no JWT required), making them suitable for embedding in external websites and booking link pages. Booking management requires authentication.
All endpoints use POST to the hyper-worker base URL with the type field specifying the action.
POST https://<project>.supabase.co/functions/v1/hyper-worker
get-availability
Public - No authentication required.
Check calendar free/busy times for one or more calendars within a date range. Returns busy blocks so the client can calculate available slots.
Request
{
"type": "get-availability",
"timeMin": "2026-03-21T00:00:00Z",
"timeMax": "2026-03-28T00:00:00Z",
"calendarIds": ["calendar-id@resource.calendar.google.com"]
}
| Field | Type | Required | Description |
|---|---|---|---|
timeMin | string | Yes | Start of the time range (ISO 8601 / RFC 3339) |
timeMax | string | Yes | End of the time range (ISO 8601 / RFC 3339) |
calendarIds | string[] | Yes | Array of Google Calendar IDs to check |
Process
Calls the Google Calendar FreeBusy API and returns the busy intervals for the requested calendars.
Response
{
"busy": [
{
"start": "2026-03-21T10:00:00Z",
"end": "2026-03-21T11:00:00Z"
},
{
"start": "2026-03-21T14:00:00Z",
"end": "2026-03-21T15:30:00Z"
}
]
}
The response contains the time blocks that are busy. To determine available slots, subtract the busy blocks from your desired time range on the client side.
booking
Public - No authentication required.
Create a confirmed booking with automatic Google Meet link generation, confirmation emails, and optional WhatsApp notification.
Rate limit: 10 requests per 60 seconds
Request
{
"type": "booking",
"name": "John Smith",
"email": "john@example.com",
"phone": "+1234567890",
"company": "Acme Corp",
"date": "March 25, 2026",
"time": "2:00 PM",
"isoTime": "2026-03-25T10:00:00Z",
"timezone": "America/New_York"
}
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Booker's full name |
email | string | Yes | Booker's email address |
phone | string | No | Phone number in E.164 format. If provided, a WhatsApp confirmation is sent |
company | string | No | Company name |
date | string | Yes | Human-readable date string for display in notifications |
time | string | Yes | Human-readable time string for display in notifications |
isoTime | string | Yes | Meeting start time in ISO 8601 format (used for calendar event creation) |
timezone | string | Yes | IANA timezone identifier (e.g., America/New_York, Asia/Dubai) |
Process
- Creates a 30-minute Google Calendar event with an auto-generated Google Meet link
- Inserts a booking record with status
confirmed - Sends a confirmation email to the booker (includes Meet link and calendar ICS attachment)
- Sends an admin alert email
- If
phoneis provided, sends a WhatsApp template message with the booker's name and meeting time
Response
{
"success": true,
"meetingLink": "https://meet.google.com/abc-defg-hij"
}
manage-booking
Authenticated - Requires JWT.
Cancel or manage an existing booking. Cancellation removes the associated Google Calendar event.
Request
{
"type": "manage-booking",
"action": "cancel",
"bookingId": "<uuid>"
}
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Management action. Currently supports: cancel |
bookingId | string | Yes | Booking ID to manage |
Process
For the cancel action:
- Updates the booking status to
cancelled - Deletes the associated Google Calendar event
Response
{
"success": true
}
Typical Integration Flow
A booking page typically follows this sequence:
1. Page loads
-> Call get-availability for the selected date range
-> Display available time slots to the user
2. User selects a slot and fills in their details
-> Call booking with the selected time and contact info
-> Show confirmation with the Meet link
3. Admin cancels if needed
-> Call manage-booking with action: cancel
Example: Fetching Available Slots
// Fetch busy times for next 7 days
const response = await fetch(HYPER_WORKER_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
type: 'get-availability',
timeMin: '2026-03-21T00:00:00Z',
timeMax: '2026-03-28T00:00:00Z',
calendarIds: ['primary']
})
})
const { busy } = await response.json()
// busy = [{ start: "...", end: "..." }, ...]
// Subtract from your available hours to get open slots
No Authorization header is needed for get-availability or booking since both are public endpoints.
Related
- Communications Endpoints - WhatsApp templates used for booking confirmations
- Finance Endpoints - Invoices can be linked to booked engagements