API Reference
Overview

API Reference

Complete documentation for all GlowScript server actions and APIs.

Available APIs

Core Operations

APIDescription
AppointmentsManage client appointments, scheduling, and status
SchedulingProvider schedules, blockouts, rooms, and equipment

Revenue Features

APIDescription
Gift CardsGift card templates, purchases, and redemptions
WaitlistAppointment waitlist management and notifications
OpportunitiesCRM pipeline for leads and prospects

Authentication

All API calls require authentication via Supabase. Include the user's JWT token in requests:

const supabase = createClient(url, anonKey)
await supabase.auth.signInWithPassword({ email, password })
// Client is now authenticated for all subsequent calls

Error Handling

All server actions return a consistent response format:

type ActionResponse<T> = 
  | { success: true; data: T }
  | { success: false; error: string }

Example usage:

const result = await createAppointment(data)
 
if (!result.success) {
  console.error('Failed:', result.error)
  return
}
 
console.log('Created:', result.data)

Rate Limits

GlowScript uses Supabase's built-in rate limiting. For high-volume operations, consider:

  • Batching requests where possible
  • Using server-side actions for bulk operations
  • Implementing client-side caching