What is Headless Routing?
Headless Routing allows you to use your own custom forms (on your website, application, or landing pages) while leveraging Cal.com’s powerful routing logic. Instead of requiring users to fill out a Cal.com Routing Form directly, you can:- Collect data through your own forms
- Pass that data to Cal.com via URL parameters
- Let Cal.com handle the routing decision-making
- Direct users to the appropriate booking flow
How It Works
The headless routing flow follows these steps:- User fills out your custom form on your website or application
- Form data is collected (e.g., name, email, company size, urgency)
- Data is forwarded to Cal.com as URL parameters
- Cal.com Routing Form processes the parameters
- User is directed to the appropriate booking page or outcome(e.g. redirecting to an external webpage or showing a Custom Page with a message)
Implementation Steps
1. Create Your Routing Form
First, create a Routing Form in Cal.com with fields that will receive data from your external form:- Navigate to Routing Forms
- Create a new Routing Form
- Add fields that match the data you’ll collect:
- Use clear field identifiers (e.g.,
firstName
,lastName
,email
,companySize
) - These identifiers will be used as URL parameter names
- Use clear field identifiers (e.g.,
- Configure routing logic based on these fields
2. Prepare Your External Form
Your external form should:- Collect the necessary information
- Match field names to your Routing Form identifiers
- Construct the URL with parameters
3. Pass Data via URL Parameters
Construct the headless routing URL with your form data:- URL encode special characters (e.g.,
+
becomes%2B
) - All parameter names must match your Routing Form field identifiers
- The
form
parameter should be the your Routing Form ID that you see on in your Routing Form URL. e.g. forhttps://app.cal.com/routing/route-builder/8cfd7889-9043-4e20-9a09-db8e2c9f747c
, the Routing Form ID is8cfd7889-9043-4e20-9a09-db8e2c9f747c
Using Attributes for Team Member Routing
Headless routing works seamlessly with Cal.com’s attribute-based routing system. This allows you to dynamically route bookings to specific team members based on attributes like:- Service type (e.g., Sales, Support, Technical)
- Language preferences
- Geographic region
- Product expertise
- Custom attributes specific to your organization
How Attribute Routing Works
- Set up attributes in your organization settings
- Assign attributes to team members
- Configure your Routing Form to match fields with attributes
- Pass attribute values via URL parameters from your custom form
service
attribute, you can pass it directly:
Troubleshooting
Common Issues
Parameters not being recognized:- Verify field identifiers match exactly
- Check for typos in parameter names
- Ensure proper URL encoding
- Test the Routing Form directly first
- Verify all required fields are included
- Check routing logic configuration
Try It Out
You can experiment with a live example in this CodeSandbox demo.Related Resources
- Routing Forms Overview
- Routing with Attributes - Set up attribute-based team member routing
- Cal.com Embed Documentation