Skip to main content
POST
/
scheduling
/
simple-scheduler
/
config
curl -X POST https://api.avoca.ai/v1/scheduling/simple-scheduler/config \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Workspace-ID: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "team_id": 123,
    "primary_color": "#0066CC",
    "logo_url": "https://example.com/logo.png",
    "issue_types": ["HVAC", "Plumbing", "Electrical"],
    "show_exact_timeslots": false,
    "lead_time_minutes": 120,
    "timeframe_hours": {
      "morning": {
        "start": 8,
        "end": 12,
        "label": "Morning (8AM-12PM)"
      },
      "afternoon": {
        "start": 12,
        "end": 17,
        "label": "Afternoon (12PM-5PM)"
      },
      "evening": {
        "start": 17,
        "end": 20,
        "label": "Evening (5PM-8PM)"
      }
    },
    "dispatch_fee": "$89 dispatch fee",
    "homeowner_required": true,
    "additional_questions": [
      {
        "id": "property_type",
        "question": "What type of property?",
        "type": "select",
        "options": ["Single Family Home", "Condo/Townhouse", "Commercial"],
        "required": true
      },
      {
        "id": "issue_description",
        "question": "Please describe the issue",
        "type": "text",
        "required": true
      }
    ],
    "tags_required": [123, 456],
    "confirmation_settings": {
      "message": "Your appointment is confirmed! A technician will arrive during your selected window.",
      "show_tracking": true,
      "send_sms": true,
      "send_email": true
    },
    "widget_position": "bottom-right",
    "trigger_delay": 5
  }'
{
  "data": {
    "widget_id": "widget_abc123",
    "embed_code": "<script src=\"https://scheduler.avoca.ai/widget.js\" data-widget-id=\"widget_abc123\" async></script>",
    "preview_url": "https://scheduler.avoca.ai/preview/widget_abc123",
    "configuration": {
      "team_id": 123,
      "primary_color": "#0066CC",
      "issue_types": ["HVAC", "Plumbing", "Electrical"],
      "status": "active"
    }
  },
  "meta": {
    "request_id": "req_xyz789",
    "timestamp": "2024-01-20T10:00:00Z"
  }
}
The Simple Scheduler is a customizable web widget that allows customers to book appointments directly from your website. This endpoint configures its appearance, behavior, and booking rules.

Request

team_id
number
required
Your ServiceTitan team/tenant ID
primary_color
string
default:"#0066CC"
Primary color for the widget (hex format)
logo_url
string
URL to your company logo
issue_types
array
required
Service types customers can select:
  • HVAC
  • Plumbing
  • Electrical
  • Appliance Repair
  • Other
show_exact_timeslots
boolean
default:"false"
Show specific time slots vs arrival windows
lead_time_minutes
number
default:"120"
Minimum minutes before appointment can be booked
timeframe_hours
object
Available booking windows
dispatch_fee
string
Service call fee display (e.g., “$0 (Free estimates)”)
homeowner_required
boolean
default:"true"
Require customer to confirm they own the property
additional_questions
array
Custom questions to ask during booking
tags_required
array
ServiceTitan tag IDs required for all bookings
tags_conditional
array
ServiceTitan tag IDs applied conditionally
confirmation_settings
object
Confirmation page configuration
widget_position
string
default:"bottom-right"
Widget position on page: bottom-right, bottom-left, center
trigger_delay
number
default:"0"
Seconds before widget appears (0 = immediate)

Response

widget_id
string
Unique identifier for this widget configuration
embed_code
string
HTML/JavaScript code to embed on your website
preview_url
string
URL to preview the configured widget
configuration
object
The saved configuration
curl -X POST https://api.avoca.ai/v1/scheduling/simple-scheduler/config \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Workspace-ID: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "team_id": 123,
    "primary_color": "#0066CC",
    "logo_url": "https://example.com/logo.png",
    "issue_types": ["HVAC", "Plumbing", "Electrical"],
    "show_exact_timeslots": false,
    "lead_time_minutes": 120,
    "timeframe_hours": {
      "morning": {
        "start": 8,
        "end": 12,
        "label": "Morning (8AM-12PM)"
      },
      "afternoon": {
        "start": 12,
        "end": 17,
        "label": "Afternoon (12PM-5PM)"
      },
      "evening": {
        "start": 17,
        "end": 20,
        "label": "Evening (5PM-8PM)"
      }
    },
    "dispatch_fee": "$89 dispatch fee",
    "homeowner_required": true,
    "additional_questions": [
      {
        "id": "property_type",
        "question": "What type of property?",
        "type": "select",
        "options": ["Single Family Home", "Condo/Townhouse", "Commercial"],
        "required": true
      },
      {
        "id": "issue_description",
        "question": "Please describe the issue",
        "type": "text",
        "required": true
      }
    ],
    "tags_required": [123, 456],
    "confirmation_settings": {
      "message": "Your appointment is confirmed! A technician will arrive during your selected window.",
      "show_tracking": true,
      "send_sms": true,
      "send_email": true
    },
    "widget_position": "bottom-right",
    "trigger_delay": 5
  }'
{
  "data": {
    "widget_id": "widget_abc123",
    "embed_code": "<script src=\"https://scheduler.avoca.ai/widget.js\" data-widget-id=\"widget_abc123\" async></script>",
    "preview_url": "https://scheduler.avoca.ai/preview/widget_abc123",
    "configuration": {
      "team_id": 123,
      "primary_color": "#0066CC",
      "issue_types": ["HVAC", "Plumbing", "Electrical"],
      "status": "active"
    }
  },
  "meta": {
    "request_id": "req_xyz789",
    "timestamp": "2024-01-20T10:00:00Z"
  }
}

Widget Embed Instructions

Once configured, add the embed code to your website:
<!-- Add before closing </body> tag -->
<script src="https://scheduler.avoca.ai/widget.js" 
        data-widget-id="widget_abc123" 
        async>
</script>
The widget will automatically appear based on your configuration settings.

Customization Options

  • Branding: Match your brand colors and add your logo
  • Availability: Control booking windows and lead times
  • Questions: Gather the exact information you need
  • Confirmations: Customize how customers receive confirmations
  • Position: Place the widget where it works best