01Overview
AgentLabs is a multi-tenant SaaS platform for deploying AI-powered voice agents at scale. It handles everything from telephony routing and AI conversation management to appointment booking, Google integrations, payment processing, and white-label branding.
AI Voice Agents
Deploy ElevenLabs or OpenAI-powered conversational agents for inbound and outbound calling.
CoreAppointment Booking
Agents book appointments during calls automatically. Sync to Google Calendar.
NewGoogle Integrations
Sync call data to Google Sheets and appointments to Google Calendar via OAuth.
NewSIP Engine
Use your own SIP trunks with 13 supported providers for full telephony control.
PluginWhite-Label
Full branding control — custom logo, domain, app name, colors, and footer.
OptionalREST API & Webhooks
Programmatic access via API keys and real-time event delivery via signed webhooks.
PluginQuick Start — Minimum Viable Setup
- Database: Set up PostgreSQL and set
DATABASE_URL - Secrets: Generate and set
SESSION_SECRETandJWT_SECRET - Build & Initialize: Run
npm install,npm run build,npm run db:push - Telephony: Configure at least one provider (Twilio recommended)
- AI Provider: Add an ElevenLabs API key to the credential pool
- Payments: Enable at least one payment gateway for credit purchases
- Email: Configure SMTP for notifications and password resets
- Admin Account: Create your super admin via the installer on first visit
02System Requirements
| Component | Minimum | Recommended | Notes |
|---|---|---|---|
| Node.js | 18.x | 20.x LTS | ESM required |
| PostgreSQL | 14+ | 15+ | pgvector extension optional (for RAG) |
| RAM | 2 GB | 4+ GB | 8 GB+ for high call volumes |
| Storage | 20 GB | 50+ GB | For recordings and uploads |
| CPU | 2 cores | 4+ cores | For concurrent call handling |
| OS | Ubuntu 20.04+ | Ubuntu 22.04 LTS | Debian-based preferred |
Network Requirements
- Port 443 (HTTPS) must be publicly accessible — required for telephony webhooks
- Port 5000 internally (proxied by Nginx to 443)
- Outbound access to ElevenLabs, OpenAI, Twilio, Plivo, and Google APIs
- A valid domain with SSL certificate (Let's Encrypt is free and sufficient)
03Fresh Installation
Follow these steps for a brand-new AgentLabs installation on a clean Ubuntu server. This sets up Node.js, PostgreSQL, the application, and PM2 process manager.
Install Node.js 20 and System Tools
# Update system packages
sudo apt-get update && sudo apt-get upgrade -y
# Install Node.js 20.x LTS
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Verify versions
node --version # Should show v20.x.x
npm --version
# Install PM2 process manager globally
sudo npm install -g pm2
Install and Configure PostgreSQL
# Install PostgreSQL
sudo apt-get install -y postgresql postgresql-contrib
# Start and enable PostgreSQL
sudo systemctl start postgresql
sudo systemctl enable postgresql
# Create database and user
sudo -u postgres psql <<EOF
CREATE DATABASE agentlabs;
CREATE USER agentlabs_user WITH ENCRYPTED PASSWORD 'your_secure_password_here';
GRANT ALL PRIVILEGES ON DATABASE agentlabs TO agentlabs_user;
\q
EOF
Download and Extract AgentLabs
# Create application directory
sudo mkdir -p /root/agentlabs
cd /root/agentlabs
# Upload your AgentLabs zip file and extract
unzip AgentLabs-v5.3.7.zip -d .
# Ensure plugins directory exists (for add-ons)
mkdir -p plugins
touch plugins/.gitkeep
Create the Environment File
Create a .env file in the application root with the following required variables:
# ─── Core ───────────────────────────────────
NODE_ENV=production
PORT=5000
APP_URL=https://yourdomain.com
BASE_URL=https://yourdomain.com
# ─── Database ────────────────────────────────
DATABASE_URL=postgresql://agentlabs_user:your_secure_password_here@localhost:5432/agentlabs
# ─── Security (generate with the command below) ──
SESSION_SECRET=<64-char-random-string>
JWT_SECRET=<64-char-random-string>
# Generate secure secrets:
# node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
.env file to version control. Use at least 64 random characters for both secrets. Keep these values secret — they protect session cookies and JWT tokens.Install Dependencies and Build
# Install all npm packages
npm install
# Build the frontend (Vite) and backend (esbuild)
npm run build
Initialize the Database Schema
# Push the Drizzle schema to the database
# This creates all tables, indexes, and default data
npm run db:push
Install Plugins (Optional)
If you have purchased add-on plugins, install them now before starting the application:
# Extract plugin zips into the plugins/ directory
unzip AgentLabs-SIPEngine-Plugin-v2.0.0.zip -d plugins/
unzip AgentLabs-TeamManagement-Plugin-v2.0.0.zip -d plugins/
unzip AgentLabs-RESTAPI-Plugin-v1.0.0.zip -d plugins/
Start with PM2
# Start the application
pm2 start npm --name "agentlabs" -- start
# Or using the ecosystem config (if included)
pm2 start ecosystem.config.cjs
# Save PM2 config to survive server reboots
pm2 save
pm2 startup
Configure Nginx Reverse Proxy and SSL
See the Nginx & SSL section for the complete Nginx configuration and SSL certificate setup with Let's Encrypt.
https://yourdomain.com — you'll be redirected to the installation wizard to create your super admin account.04Updating to a New Version
AgentLabs releases updates as versioned zip files. Updates are generally non-breaking but always read the changelog before upgrading a production system.
pg_dump) and note your current version. Do not skip versions — upgrade one major version at a time if jumping more than one major release.Back Up Your Database
# Create a database backup
pg_dump -U agentlabs_user -d agentlabs -f ~/backup_$(date +%Y%m%d).sql
# Verify the backup was created
ls -lh ~/backup_*.sql
Download and Prepare the New Version
# Upload the new zip to your server, then:
cd /tmp
unzip AgentLabs-v5.3.7.zip -d agentlabs-new
Preserve Critical Files Before Overwriting
# Copy your .env to a safe location
cp /root/agentlabs/.env ~/agentlabs.env.backup
# Backup your plugins directory
cp -r /root/agentlabs/plugins ~/agentlabs-plugins-backup
Apply the Update
# Copy new files over the existing installation
# (rsync is preferred — excludes .env and plugins/)
rsync -av --exclude='.env' --exclude='plugins/' \
/tmp/agentlabs-new/ /root/agentlabs/
# Restore .env if it was overwritten
cp ~/agentlabs.env.backup /root/agentlabs/.env
# Restore plugins
cp -r ~/agentlabs-plugins-backup/* /root/agentlabs/plugins/
Install New Dependencies
# Install any newly added npm packages
cd /root/agentlabs
npm install
Run Database Migrations
# Apply schema changes from the new version
# Use db:migrate (safe, non-destructive) — NOT db:push in production
npm run db:migrate
# If no migration script is provided, use db:push
# npm run db:push
db:migrate applies only the new SQL changes safely. db:push syncs the full schema — both are safe for updates since the schema is additive, but db:migrate is safer for production.Rebuild and Restart
# Build the frontend with new changes
npm run build
# Restart the application
pm2 restart agentlabs
# Watch logs to verify healthy startup
pm2 logs agentlabs --lines 50
Verify the Upgrade
Check startup logs for the health check confirmation:
[Startup] Health check PASSED
Database: OK - All tables present
Environment: All required variables present
✓ Server fully initialized on port 5000
Also visit Admin → System → Version to confirm the version number updated.
05First-Time Setup
After your first deployment, navigate to your domain. AgentLabs detects no admin exists and redirects you to the Installation Wizard.
Run the Installation Wizard
Visit https://yourdomain.com. You'll be redirected to /install automatically.
- Enter your name and email for the super admin account
- Set a strong password (at least 8 characters, mix of letters and numbers)
- Set your platform name (shown in emails and the UI)
Configure Essential Settings in Admin Panel
After logging in, navigate to Admin → Settings and configure:
- Telephony: Add Twilio or Plivo credentials
- AI Providers: Add at least one ElevenLabs API key
- Email: Configure SMTP so users receive notifications
- Payments: Enable at least one payment gateway
- Branding: Upload your logo and set colors
Create Your First Agent
Navigate to My Agents → Create Agent. Give it a name, select an ElevenLabs voice, write a system prompt, and assign a phone number (purchased from Twilio through the platform).
Test With a Call
Use the Test Call button on the agent to verify everything is working end-to-end before launching campaigns.
06Telephony Providers
AgentLabs supports Twilio and Plivo as telephony providers. Both can be active simultaneously — agents can be assigned to either provider. Configure in Admin → Settings → Telephony.
Twilio is the primary telephony provider. It powers outbound bulk calling, inbound call routing, and phone number purchasing directly from the platform.
Create a Twilio Account
Sign up at twilio.com. Verify your email and complete account verification. Add a payment method to enable purchasing phone numbers.
Get Your Credentials
From the Twilio Console home page, copy your Account SID and Auth Token:
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=your_auth_token_here
These can also be entered directly in the Admin Panel (no .env entry needed).
Enter Credentials in Admin Panel
Go to Admin → Settings → Telephony → Twilio:
- Paste your Account SID and Auth Token
- Toggle Enable KYC if you want to require regulatory bundles before users purchase numbers (recommended for compliance)
- Click Test Connection to verify
- Click Save
Configure Webhooks in Twilio
For numbers purchased outside the platform, configure these webhook URLs in the Twilio Console under Phone Numbers → Manage → Active Numbers:
| Webhook | URL | Method |
|---|---|---|
| Voice (Incoming) | {APP_URL}/api/twilio/voice | POST |
| Status Callback | {APP_URL}/api/twilio/status | POST |
| Recording Callback | {APP_URL}/api/twilio/recording | POST |
Plivo is an alternative telephony provider with competitive international rates. Configure it alongside or instead of Twilio.
Create a Plivo Account
Sign up at plivo.com. Complete identity verification before purchasing numbers.
Get Credentials
From your Plivo Console, copy the Auth ID and Auth Token:
PLIVO_AUTH_ID=your_auth_id
PLIVO_AUTH_TOKEN=your_auth_token
Configure in Admin Panel
Go to Admin → Settings → Telephony → Plivo and enter your Auth ID and Auth Token.
Set Up Webhook URLs
In the Plivo Console, create a Plivo Application and set:
| Setting | URL |
|---|---|
| Answer URL | {APP_URL}/api/plivo/voice/answer |
| Hangup URL | {APP_URL}/api/plivo/voice/hangup |
07AI Providers
AgentLabs supports ElevenLabs and OpenAI as AI voice engines. ElevenLabs is the primary provider offering premium voice quality with a multi-key pool. OpenAI provides an alternative Realtime voice engine and the text embeddings used by the Knowledge Base.
ElevenLabs provides the conversational AI engine and natural voice synthesis. AgentLabs supports a multi-key pool for load balancing across multiple API credentials — essential for high call volumes.
How the Credential Pool Works
Add multiple ElevenLabs API keys. The platform automatically routes calls to the least-loaded credential, switches to backup keys on failure, and tracks per-key usage in real time.
Create an ElevenLabs Account
Sign up at elevenlabs.io. Subscribe to a plan that includes the Conversational AI feature (API access). A Business or Scale plan is recommended for production use.
Get Your API Key
In ElevenLabs, go to Profile → API Keys and create a new API key. Copy it immediately — it won't be shown again in full.
Add Key to the Credential Pool
Go to Admin → Settings → ElevenLabs Pool and click Add Credential:
- Name: A friendly label (e.g., "Key 1 — Production")
- API Key: Paste your ElevenLabs API key
- Priority: Lower number = higher priority. Use 1 for your primary key.
- Max Concurrent Calls: Max simultaneous calls on this key (default: 5)
Test the Connection
Click Test Connection on the credential. The platform verifies the API key and fetches available voices and agents. A green checkmark confirms success.
Pool Management Features
| Feature | Description |
|---|---|
| Auto Load Balancing | Routes new calls to the credential with the most available capacity |
| Automatic Failover | If a key hits rate limits or errors, calls are moved to the next available key |
| Priority Routing | Lower-priority keys are only used when higher-priority ones are full |
| Usage Tracking | Real-time concurrent call count per credential shown in the Admin panel |
| Per-Agent Assignment | Optionally lock a specific agent to a specific ElevenLabs credential |
OpenAI serves two roles in AgentLabs: (1) the Realtime API for voice conversations as an alternative to ElevenLabs, and (2) text embeddings for the Knowledge Base (RAG) feature.
Create an OpenAI Account
Sign up at platform.openai.com and add billing information. Enable the Realtime API model access if using OpenAI for voice calls.
Create an API Key
Go to Settings → API Keys and click Create new secret key. Copy it and store it securely.
# Set this in your .env for RAG / Knowledge Base
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Configure Realtime Voice (Optional)
For OpenAI-powered voice agents (as an alternative to ElevenLabs), go to Admin → Settings → OpenAI Pool and add credentials. Multiple keys are supported for pooling.
Configure LLM Settings
In Admin → Settings → AI Models, choose default LLM models for free and paid plan users (e.g., GPT-4o Mini for free, GPT-4o for paid).
OPENAI_API_KEY environment variable to be set. It uses the text-embedding-ada-002 model to generate vector embeddings from your documents.08Payment Gateways
AgentLabs supports five payment gateways for credit purchases. Enable one or more depending on your target markets. All gateways require a webhook endpoint to confirm payments. Configure in Admin → Settings → Payment Gateways.
Stripe is the most widely used payment gateway — recommended for global deployments. Supports credit/debit cards, bank transfers, and subscriptions.
Create a Stripe Account
Sign up at stripe.com and complete identity verification. Enable your account for live payments before going to production.
Get API Keys
From Developers → API Keys, copy your publishable and secret keys:
# Use live keys for production, test keys for testing
STRIPE_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxxxx
VITE_STRIPE_PUBLIC_KEY=pk_live_xxxxxxxxxxxxxxxxxxxxxxxx
Set Up a Webhook Endpoint
In Developers → Webhooks, click Add endpoint:
- Endpoint URL:
{APP_URL}/api/webhooks/stripe - Events:
checkout.session.completed,invoice.paid,customer.subscription.created,customer.subscription.updated,customer.subscription.deleted
STRIPE_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxxxx
Configure in Admin Panel
Go to Admin → Settings → Payment Gateways → Stripe. Enter Secret Key, Publishable Key, and Webhook Secret. Select your currency and set mode to Live for production.
Razorpay is the leading payment gateway for India. Supports INR payments and local UPI transfers.
Create Account and Complete KYC
Sign up at razorpay.com. Complete KYC (business verification) — required to accept live payments.
Get Credentials
RAZORPAY_KEY_ID=rzp_live_xxxxxxxxxxxxxxxx
RAZORPAY_KEY_SECRET=xxxxxxxxxxxxxxxxxxxxxxxx
Set Up Webhook
In Razorpay Dashboard → Settings → Webhooks, add endpoint: {APP_URL}/api/webhooks/razorpay
RAZORPAY_WEBHOOK_SECRET=your_webhook_secret
PayPal provides global payment coverage — especially popular in North America and Europe.
Create a PayPal Business Account
Sign up at developer.paypal.com. Create an app in the developer dashboard.
Get Credentials
PAYPAL_CLIENT_ID=your_client_id
PAYPAL_CLIENT_SECRET=your_client_secret
PAYPAL_MODE=sandbox # change to 'live' for production
Configure Webhook
Add webhook URL: {APP_URL}/api/webhooks/paypal
Paystack is the dominant payment gateway for Africa — Nigeria, Ghana, Kenya, and South Africa.
Create Account
Sign up at paystack.com and complete business verification.
Get Credentials
PAYSTACK_PUBLIC_KEY=pk_live_xxxxxxxxxxxxxxxx
PAYSTACK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxx
PAYSTACK_WEBHOOK_SECRET=your_webhook_secret
Configure Webhook
Add webhook URL: {APP_URL}/api/webhooks/paystack
MercadoPago is the leading payment gateway for Latin America — Brazil, Mexico, Argentina, and Colombia.
Create Account
Sign up at mercadopago.com.
Get Credentials
MERCADOPAGO_ACCESS_TOKEN=your_access_token
MERCADOPAGO_PUBLIC_KEY=your_public_key
MERCADOPAGO_WEBHOOK_SECRET=your_webhook_secret
Configure Webhook
Add webhook URL: {APP_URL}/api/webhooks/mercadopago
15Email & SMTP
Configure SMTP to send transactional emails — password resets, OTP codes, payment receipts, campaign notifications, and low-credit alerts.
Choose an Email Provider
Use any SMTP-compatible service. Recommended providers for transactional email:
- SendGrid — Reliable, good deliverability, generous free tier
- Mailgun — Developer-friendly, good EU region support
- Amazon SES — Very cost-effective at scale
- Postmark — Best-in-class deliverability
- Gmail SMTP — Only for low-volume development/testing
Configure SMTP Settings
Go to Admin → Settings → Email:
| Field | Example | Notes |
|---|---|---|
| SMTP Host | smtp.sendgrid.net | Your provider's SMTP server |
| SMTP Port | 587 | 587 (STARTTLS) or 465 (SSL) |
| SMTP Username | apikey | Often "apikey" for SendGrid |
| SMTP Password | SG.xxxxx | Your API key or password |
| From Email | noreply@yourdomain.com | Must be verified with your provider |
| From Name | Your Platform Name | Shown in email clients |
| Use TLS | Yes | Enable for port 587 |
Test the Email Configuration
Click the Send Test Email button. You should receive a test message within 30 seconds. If not, check your spam folder and SMTP credentials.
Available Email Templates
AgentLabs ships with 8 pre-built templates you can customize in Admin → Settings → Email Templates:
Welcome Email
Sent on new user registration
Password Reset
Recovery link with 5-minute expiry
OTP Verification
Two-factor authentication code
Low Credits Alert
Triggered when balance falls below threshold
Payment Receipt
Sent after successful credit purchase
Campaign Complete
Summary when a campaign finishes
16Branding & White-Label
AgentLabs supports full white-labeling. Replace every default brand reference with your own logo, name, domain, and colors.
Configure in Admin → Settings → Branding:
| Setting | Description | Recommended |
|---|---|---|
| App Name | Shown in the header, emails, and page title | Your company/product name |
| App Tagline | Subtitle shown on the landing page | Short, descriptive phrase |
| Logo URL | Main logo image URL | SVG or PNG, 200x50px |
| Favicon URL | Browser tab icon | ICO or 32x32 PNG |
| Primary Color | Main brand color used for buttons and accents | Hex code, e.g., #6366f1 |
| Footer Text | Copyright and legal notice in the footer | © 2026 Your Company |
| Support Email | Shown in error pages and contact sections | support@yourdomain.com |
APP_URL environment variable.17SEO & Analytics
Configure SEO metadata and inject analytics scripts for tracking. These settings help with search discoverability and user behavior analysis.
Meta Tags (Admin → Settings → SEO)
| Setting | Description |
|---|---|
| Default Title | Page title template — e.g., {Page} | YourBrand |
| Meta Description | Default description for search results |
| Meta Keywords | Comma-separated keywords (limited SEO impact today) |
| OG Image URL | Social share preview image (1200x630px recommended) |
| Twitter Card Type | summary_large_image recommended |
| Canonical URL | Prevents duplicate content penalties |
Analytics Scripts
Inject tracking scripts without editing source code. Go to Admin → Settings → Analytics Scripts:
- Google Analytics 4: Paste your
gtag.jssnippet in the Head Scripts field - Google Tag Manager: Paste GTM code in Head Scripts (body part in Body Scripts)
- Facebook Pixel: Paste pixel code in the Head Scripts field
- Custom Scripts: Any JavaScript — use Head Scripts for code that must run early, Body Scripts for deferred analytics
Robots & Sitemap
- Auto-generated
/sitemap.xml— updated dynamically - Configurable
/robots.txtrules - Option to block specific paths from indexing
18System Settings
Fine-tune platform behavior through Admin → Settings → System. These settings affect authentication, billing, connection limits, and monitoring.
Authentication
| Setting | Default | Description |
|---|---|---|
jwt_expiry_days | 7 | How long JWT tokens stay valid |
otp_expiry_minutes | 5 | Two-factor OTP code lifetime |
password_reset_expiry_minutes | 5 | Password reset link lifetime |
Credit & Billing
| Setting | Default | Description |
|---|---|---|
credit_price_per_minute | 0.1 | Credits consumed per call minute |
phone_number_monthly_credits | 50 | Monthly credits charged for each phone number |
low_credits_threshold | 50 | Credit level that triggers the low-balance alert email |
min_credit_purchase | 10 | Minimum credit package size in currency units |
Connection & Performance Limits
| Setting | Default | Description |
|---|---|---|
max_ws_connections_per_process | 1000 | Total WebSocket connections per server process |
max_ws_connections_per_user | 5 | Max concurrent connections per user account |
max_openai_connections_per_credential | 50 | Max OpenAI Realtime sessions per API key |
db_pool_min_connections | 2 | Minimum database connection pool size |
db_pool_max_connections | 20 | Maximum database connection pool size |
campaign_batch_concurrency | 10 | Maximum concurrent outbound calls per campaign batch |
Resource Monitoring & Auto-Restart
| Setting | Default | Description |
|---|---|---|
auto_restart_enabled | false | Restart the process automatically if resource limits are exceeded |
auto_restart_ram_percent | 75 | RAM usage percentage threshold for auto-restart |
auto_restart_cpu_percent | 85 | CPU usage percentage threshold for auto-restart |
19Knowledge Base (RAG)
The Knowledge Base lets you upload documents that AI agents can reference during conversations, providing accurate, document-grounded responses without hallucination.
OPENAI_API_KEY set in your environment. OpenAI generates the vector embeddings. ElevenLabs handles the conversation using retrieved context.Supported Document Types
PDF Documents
Product manuals, FAQs, policies, guides
Plain Text
Knowledge articles, scripts
Word Documents
DOCX format supported
Web Pages
Scrape and index any public URL
How It Works
Upload Documents
Navigate to Knowledge Base in your user dashboard. Click Upload Document or enter a URL to scrape.
Automatic Processing Pipeline
- Chunking: Documents are split into smaller segments (~500 tokens each)
- Embedding: Each chunk is converted to a 1536-dimensional vector via OpenAI
- Indexing: Vectors are stored in the database for fast retrieval
Assign Documents to Agents
When creating or editing an agent, select which knowledge base documents it should use. An agent can have multiple documents assigned.
Runtime Context Injection
During a call, when a question is detected, the system performs a vector similarity search against the assigned documents and injects the most relevant chunks into the ElevenLabs conversation context.
21Flow Automation & AppointmentsNew
The Flow Automation & Appointments feature allows AI agents to book appointments directly during a call. When a caller wants to schedule, the agent captures their information and books automatically — no human agent needed.
How It Works
When you enable appointment booking for an agent, AgentLabs automatically creates a book_appointment tool in ElevenLabs. During a call, if the caller asks to schedule a meeting, the AI agent uses this tool — capturing name, phone, email, preferred date/time, and service — then registers the appointment in the platform and shows it in the Appointments dashboard.
Appointment Status Lifecycle
- Pending: Just booked by the AI agent — awaiting confirmation
- Confirmed: Manually confirmed by your team — the appointment is happening
- Completed: The appointment took place successfully
- Cancelled: The appointment was cancelled (by either party)
- No-Show: The contact did not appear at the scheduled time
The Appointments Dashboard
Navigate to Appointments in your dashboard. The interface has four tabs:
| Tab | Shows |
|---|---|
| Upcoming | All pending and confirmed appointments sorted by date |
| All | Every appointment regardless of status, with filters |
| Completed | Historical completed appointments |
| Cancelled | Cancelled and no-show appointments |
Each appointment card shows:
- Contact name, phone number, and email (if captured)
- Appointment date and time
- Service name and duration
- Which AI agent booked it
- Current status badge
- Google Calendar sync badge (if connected)
- Notes field for your team
Appointment Settings
Go to Appointments → Settings tab to configure:
| Setting | Description |
|---|---|
| Working Days | Toggle which days of the week are available (Mon–Sun) |
| Working Hours | Start and end time per working day (e.g., 09:00–17:00) |
| Buffer Minutes | Minimum gap required between appointments (default: 30 min) |
| Allow Overlapping | Whether the agent can book multiple appointments in the same time slot |
Enabling Appointment Booking for an Agent
Configure Appointment Settings
Ensure your working hours and buffer settings are configured in the Appointments Settings tab before enabling booking on agents.
Enable on Your Agent
When creating or editing an agent, find the Appointment Booking toggle in the agent settings. Enable it and configure the default service name and appointment duration.
Automatic Tool Registration
AgentLabs automatically creates a book_appointment tool in your ElevenLabs agent configuration. The tool includes the current date context and your webhook URL — no manual ElevenLabs configuration needed.
Test a Booking
Make a test call to your agent. When prompted, say something like "I'd like to schedule an appointment for tomorrow at 2pm." The agent should confirm and the appointment should appear in your dashboard within seconds.
22Google Sheets SyncNew
Automatically append call data to a Google Spreadsheet at the end of every call. This enables you to track outcomes, transcripts, and caller information in a familiar spreadsheet format without manual data entry.
Part 1 — Create a Google Cloud Project and OAuth Credentials
Google Sheets sync uses OAuth 2.0. You need to create credentials in the Google Cloud Console. These credentials are shared between Google Sheets and Google Calendar sync if you use both.
Create a Google Cloud Project
Go to console.cloud.google.com. Click Select a project → New Project. Give it a name (e.g., "AgentLabs Integration") and click Create.
Enable the Google Sheets API
- In your project, go to APIs & Services → Library
- Search for "Google Sheets API"
- Click on it and click Enable
- Wait about 30 seconds for the API to activate
Configure the OAuth Consent Screen
- Go to APIs & Services → OAuth consent screen
- Choose External (unless you have a Google Workspace account)
- Fill in App name, user support email, and developer contact email
- Under Scopes, add:
https://www.googleapis.com/auth/spreadsheets - Under Test users, add your Google account email
- Click Save and Continue through all steps
Create OAuth 2.0 Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Application type: Web application
- Name: e.g., "AgentLabs OAuth Client"
- Under Authorized redirect URIs, click Add URI and enter:
{APP_URL}/auth/google/callback
Replace {APP_URL} with your actual domain. Click Create. A dialog shows your Client ID and Client Secret — copy both.
Enter Credentials in Admin Settings
Go to Admin → Settings → Google Integration:
- Paste your Google Client ID
- Paste your Google Client Secret
- Click Save
Part 2 — Connect a Google Account
Initiate OAuth Connection
As a regular user, go to My Account → Integrations → Google Sheets and click Connect Google Account. You'll be redirected to Google's OAuth screen.
Authorize Access
Sign in with your Google account and click Allow to grant AgentLabs read/write access to your Google Sheets. You'll be redirected back to AgentLabs automatically.
Select Your Spreadsheet
After connecting, you'll see a dropdown to choose which Google Spreadsheet to sync call data to. You can select an existing spreadsheet or create a new one.
Part 3 — Connect in Flow Builder
Open the Tools Panel in Flow Builder
Go to your flow and open the Tools panel on the left side of the Flow Builder. Find Google Sheets in the list and click Connect. This links the Google account you authorized in Part 2 to the flow.
Assign a Spreadsheet to a Form Node
Inside your flow, open any Form node (the node that collects data from the caller). Go to the Integrations tab within the node settings. Select your connected Google Sheets account from the dropdown and choose which spreadsheet to write data to. Data is written to the sheet each time that form node is completed during a call.
Troubleshooting
| Problem | Solution |
|---|---|
| "Google Sheets API not enabled" | Enable the API in your GCP project → APIs & Services → Library |
| Redirect URI mismatch error | Ensure the redirect URI in GCP exactly matches {APP_URL}/auth/google/callback |
| App not verified warning | Add your email as a test user in OAuth consent screen, or publish your app |
| Data not appearing in sheet | Check call logs — errors appear in Admin → Logs. Verify the correct spreadsheet is selected. |
23Google Calendar SyncNew
Automatically sync AI-booked appointments to Google Calendar. When an appointment is created, confirmed, updated, or cancelled, the corresponding Google Calendar event is created, updated, or deleted — keeping your calendar always in sync.
How Calendar Events Map to Appointments
Each calendar event includes: the appointment status and contact name as the title, and the description contains contact phone, email, service name, duration, notes, and "Booked by AI agent via AgentLabs". When status changes to Completed, a completion timestamp is automatically appended.
Part 1 — Enable the Google Calendar API in GCP
You need to enable the Calendar API separately from the Sheets API, even if you're using the same GCP project.
Enable Google Calendar API
- Go to console.cloud.google.com and select your project
- Navigate to APIs & Services → Library
- Search for "Google Calendar API"
- Click on it and click Enable
- Wait 1–2 minutes for the API to propagate — attempting to use it immediately may result in a 403 error even after enabling
https://console.developers.google.com/apis/api/calendar-json.googleapis.com/overview?project=YOUR_PROJECT_IDUpdate OAuth Consent Screen Scopes
If you're reusing an existing GCP project, add the Calendar scope:
- Go to OAuth consent screen → Edit App
- Under Scopes, add:
https://www.googleapis.com/auth/calendar - Save the changes
Verify OAuth Credentials
Ensure your OAuth credentials (Client ID + Client Secret) are already entered in Admin → Settings → Google Integration. The same credentials are used for both Sheets and Calendar OAuth flows.
Part 2 — Connect Google Calendar in Appointments Settings
Open Appointments Settings
Go to Appointments → Settings tab. You'll see a Google Calendar section showing your current connection status.
Connect Your Google Account
Click Connect Google Calendar. You'll be redirected to Google's OAuth screen. Sign in and click Allow. Once connected, your email address will appear as the connected account.
Enable Auto-Sync
Toggle Auto-sync to Google Calendar on. When enabled, every new appointment and status change is automatically synced to your primary Google Calendar without any manual action.
Part 3 — How Sync Behaves
| Appointment Action | Calendar Event Action |
|---|---|
| New appointment booked (AI or manual) | New event created on primary calendar |
| Status changes (e.g., Pending → Confirmed) | Event title and description updated |
| Appointment cancelled | Event deleted from calendar |
| Appointment completed | Event updated with "Completed at: [timestamp]" in description |
| Notes or details changed | Event description updated |
Manual Sync
For appointments that haven't been synced yet (created before connecting Calendar, or when auto-sync was off), each appointment card shows a Sync to Calendar button. Clicking it creates or updates the calendar event immediately.
Appointment cards that are already synced show a Calendar badge instead of the Sync button.
Disconnecting Google Calendar
Go to Appointments → Settings. In the Google Calendar section, click Disconnect. This removes stored credentials. Future appointment changes will not sync. Existing calendar events are not deleted — they remain in your Google Calendar.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
| 403 API disabled | Google Calendar API not enabled in GCP | Enable at GCP Console → APIs & Library → Google Calendar API |
| 401 Unauthorized | OAuth token expired or revoked | Disconnect and reconnect Google Calendar in Settings |
| Sync button not appearing | No Google account connected | Connect an account in Appointments → Settings first |
| Events created at wrong time | Timezone mismatch | Events are stored in UTC. Ensure your Google Calendar timezone is set correctly. |
24Webhook System
Subscribe to platform events and receive real-time HTTP POST notifications to your external services. All webhook payloads are signed with HMAC-SHA256 for security.
Supported Events
| Event | Description |
|---|---|
call.started | A call has been initiated |
call.completed | A call ended — includes transcript and duration |
call.failed | A call failed to connect or errored mid-call |
campaign.started | A campaign began executing |
campaign.completed | All calls in a campaign finished |
contact.created | A new contact was added |
credits.low | Account credit balance fell below the threshold |
appointment.booked | An AI agent booked a new appointment |
Setting Up Webhooks
Create a Webhook Subscription
Navigate to Dashboard → Webhooks and click Add Webhook:
- Enter your HTTPS endpoint URL (HTTP is rejected)
- Select the events you want to receive
- A unique signing secret is generated automatically — copy and store it
Verify Signatures on Your Server
// Node.js — verify incoming webhook signature
const crypto = require('crypto');
function verifyWebhook(rawBody, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}
Retry Policy
- Up to 3 retry attempts on failure (non-2xx response or timeout)
- Exponential backoff between retries
- Retry scheduler runs every 5 minutes
- Delivery logs with status codes available in the dashboard
25Plugin System — Overview & Installation
AgentLabs v5.3.7 features a modular plugin architecture. Plugins extend the platform with additional capabilities and can be installed, updated, or removed independently without touching the core code.
Available Plugins
SIP Engine Plugin
Use your own SIP trunks with ElevenLabs and OpenAI engines. Supports 13 providers.
PremiumTeam Management Plugin
Team creation, role assignment, granular permissions, admin sub-accounts.
PremiumREST API Plugin
Programmatic access via API keys with Swagger and Redoc interactive documentation.
PremiumMethod 1: Install via Admin UI (Recommended)
Go to the Plugin Manager
Log in as admin and navigate to Admin → Settings → Plugins.
Upload the Plugin Zip
Click Upload Plugin and select the plugin zip file. The installer automatically:
- Validates the zip structure and plugin manifest
- Extracts files to the
plugins/directory - Runs any database migrations included in the plugin
- Triggers a server restart to load the plugin
Verify Plugin is Loaded
After restart, check the server logs for confirmation:
[Plugin Loader] Using compiled JS for 'sip-engine'
[SIP Engine] Plugin registered (v2.0)
[OK] SIP Engine Plugin initialized
Method 2: Manual Installation (SSH/SFTP)
# Ensure plugins directory exists
mkdir -p plugins
# Upload and extract plugin zips
unzip AgentLabs-SIPEngine-Plugin-v2.0.0.zip -d plugins/
unzip AgentLabs-TeamManagement-Plugin-v2.0.0.zip -d plugins/
unzip AgentLabs-RESTAPI-Plugin-v1.0.0.zip -d plugins/
# Restart to load plugins
pm2 restart agentlabs
Upgrading Plugins
Upload the new plugin zip via Admin → Settings → Plugins — the old version is automatically backed up before replacement. Or manually extract the new zip and restart.
Plugin Directory Structure
plugins/
├── sip-engine/
│ ├── index.js # Compiled ESM entry point
│ ├── package.json # Plugin manifest and version
│ ├── dist/bundle.js # UI component bundle (IIFE)
│ ├── routes/ # API route handlers
│ ├── services/ # Business logic
│ └── migrations/ # SQL migrations for plugin-specific tables
├── team-management/
├── rest-api/
└── .gitkeep
26SIP Engine Plugin
The SIP Engine Plugin lets your customers use their own SIP trunks for AI-powered calls instead of — or alongside — Twilio/Plivo. It supports two AI engines and 13 SIP providers.
Supported SIP Providers
Engine Comparison
| Feature | ElevenLabs SIP | OpenAI SIP |
|---|---|---|
| Outbound Calls | Yes | No |
| Inbound Calls | Yes | Yes |
| Voice Quality | Premium (ElevenLabs TTS) | Good (OpenAI Realtime) |
| Provider Support | All 13 providers | All 13 providers |
| Knowledge Base | Yes (via RAG injection) | Yes |
Setting Up ElevenLabs SIP Engine
Create a SIP Trunk
Users go to My SIP Trunks → Add Trunk:
- Select SIP provider from the dropdown
- Enter SIP host/server (e.g.,
sip.telnyx.com) - Enter SIP username and password
- Select engine: ElevenLabs SIP
Import Phone Numbers
Add E.164 format phone numbers (+14155551234) associated with the trunk. Each number is assigned an AI agent for inbound handling.
Test the Connection
Click Test Connection to verify SIP trunk reachability. The system validates hostname format, port range, and DNS resolution.
Setting Up OpenAI SIP Engine
Get Your OpenAI Project ID
At platform.openai.com, go to Settings → Project → General and copy your Project ID.
Configure in Admin Panel
Go to Admin → Settings → SIP Engine → OpenAI SIP and enter the Project ID.
Set Up OpenAI Webhook
In OpenAI Dashboard → Settings → Project → Webhooks:
- Create a webhook with URL:
{APP_URL}/api/openai-sip/webhook - Event type:
realtime.call.incoming - Copy the Webhook Secret and enter it in the admin panel
Admin Management
Admins can manage all SIP trunks and phone numbers across all users via Admin → SIP Engine: view call logs, configure per-plan SIP settings (enable/disable, max concurrent calls, allowed engines), and view statistics.
27Team Management Plugin
The Team Management Plugin enables team creation, role-based access control, and admin sub-accounts with granular permission systems.
User Teams
Create a Team
Users go to Team in their dashboard and click Create Team. Each user account can have one team.
Define Custom Roles
Create roles with specific permissions per feature section:
- Manager: Full access to all features in the account
- Agent: Can run campaigns and view calls, but not billing
- Viewer: Read-only access across all sections
- Custom: Select exactly which sections and actions (Create/Read/Update/Delete) each role can perform
Invite Team Members
Enter team member email addresses and assign roles. Members receive an invitation and log in with their own credentials.
Admin Sub-Accounts
Platform administrators can create sub-admin accounts with restricted access to the admin panel. Four pre-built admin roles are available:
| Role | Access Level |
|---|---|
| Super Admin | Full access to all admin features — same as the primary admin |
| Admin | Most admin features, excluding system settings and security config |
| Support | User management, viewing logs, and support-oriented features |
| Viewer | Read-only access to the admin dashboard and analytics |
Sub-admins authenticate using 64-character session tokens and access /admin with their assigned restricted permissions.
28REST API Plugin
The REST API Plugin provides programmatic access to all platform features via API key authentication. It includes interactive Swagger and read-only Redoc documentation.
API Documentation URLs
| Documentation Type | URL | Access |
|---|---|---|
| Redoc (Read-only) | {APP_URL}/api/docs | Public |
| Swagger UI (Interactive) | {APP_URL}/api/docs/playground | Public |
Creating and Using API Keys
Create an API Key (User)
Users go to Dashboard → API Keys → Create Key. Configure:
- A descriptive name for the key
- Scope: read-only, write, or full access per resource type
- Optional rate limiting override
Copy the key immediately — it is shown only once.
Authenticate API Requests
curl -H "X-API-Key: your_api_key_here" \
https://yourdomain.com/api/v1/agents
Available Endpoints
| Endpoint | Description |
|---|---|
GET /api/v1/agents | List and manage AI agents |
GET /api/v1/calls | View call history and transcripts |
POST /api/v1/campaigns | Create and launch campaigns |
GET /api/v1/contacts | CRUD operations on contacts |
GET /api/v1/credits | View credit balance and transactions |
GET /api/v1/analytics | Access analytics and reports |
GET /api/v1/webhooks | Manage webhook subscriptions |
Rate Limiting
| Plan Tier | Requests / Minute |
|---|---|
| Free | 30 |
| Standard | 60 |
| Pro | 120 |
| Enterprise | 300+ |
29Production — Server Requirements
| Component | Minimum | Recommended | High Volume |
|---|---|---|---|
| OS | Ubuntu 20.04 | Ubuntu 22.04 LTS | Ubuntu 22.04 LTS |
| Node.js | 18.x | 20.x LTS | 20.x LTS |
| PostgreSQL | 14+ | 15+ | 15+ with connection pooler |
| RAM | 2 GB | 4 GB | 8+ GB |
| CPU | 2 cores | 4 cores | 8+ cores |
| Storage | 20 GB | 50 GB SSD | 100+ GB SSD |
30Production — Step-by-Step Deployment
A complete deployment walkthrough covering dependencies, application setup, and process management.
Install System Dependencies
# System updates and build tools
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y build-essential curl git unzip
# Node.js 20.x LTS
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# PM2 process manager
sudo npm install -g pm2
# PostgreSQL
sudo apt-get install -y postgresql postgresql-contrib
sudo systemctl enable postgresql
Set Up Database
sudo -u postgres psql <<EOF
CREATE DATABASE agentlabs;
CREATE USER agentlabs_user WITH ENCRYPTED PASSWORD 'strong_password_here';
GRANT ALL PRIVILEGES ON DATABASE agentlabs TO agentlabs_user;
ALTER DATABASE agentlabs OWNER TO agentlabs_user;
\q
EOF
Deploy Application Files
sudo mkdir -p /root/agentlabs
cd /root/agentlabs
unzip AgentLabs-v5.3.7.zip -d .
mkdir -p plugins && touch plugins/.gitkeep
Create Production .env
NODE_ENV=production
PORT=5000
APP_URL=https://yourdomain.com
BASE_URL=https://yourdomain.com
DATABASE_URL=postgresql://agentlabs_user:strong_password_here@localhost:5432/agentlabs
SESSION_SECRET=$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
JWT_SECRET=$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
Install, Build, and Initialize
npm install
npm run build
npm run db:push
Launch with PM2
pm2 start npm --name "agentlabs" -- start
pm2 save
pm2 startup # Run the output command to enable auto-start on reboot
Health Check on Startup
After startup, check logs for the health check summary:
pm2 logs agentlabs --lines 30
Look for:
[Startup] Health check PASSED
Database: OK - All tables present
Environment: All required variables present
✓ Server fully initialized on port 5000
31Production — Nginx & SSL
Install Nginx
sudo apt-get install -y nginx
sudo systemctl enable nginx
Nginx Configuration
Create /etc/nginx/sites-available/agentlabs:
# Redirect HTTP to HTTPS
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
return 301 https://$server_name$request_uri;
}
# HTTPS reverse proxy
server {
listen 443 ssl http2;
server_name yourdomain.com www.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
# Increase upload limit for plugin zips and file uploads
client_max_body_size 100M;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
# WebSocket support (required for real-time calls)
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Extended timeout for long-running calls
proxy_read_timeout 86400;
proxy_send_timeout 86400;
}
}
# Enable the site and test configuration
sudo ln -s /etc/nginx/sites-available/agentlabs /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
SSL Certificate (Let's Encrypt — Free)
# Install Certbot
sudo apt-get install -y certbot python3-certbot-nginx
# Obtain certificate (auto-configures Nginx)
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
# Auto-renewal test
sudo certbot renew --dry-run
APP_URL and BASE_URL use https:// in your .env.32Production — PM2 Management
Common PM2 Commands
| Command | Description |
|---|---|
pm2 status | View all running processes and their status |
pm2 logs agentlabs | Stream live application logs |
pm2 logs agentlabs --lines 100 | View the last 100 log lines |
pm2 restart agentlabs | Restart the application (zero-downtime if cluster mode) |
pm2 reload agentlabs | Graceful reload (in cluster mode) |
pm2 stop agentlabs | Stop the application |
pm2 monit | Real-time CPU and memory dashboard |
pm2 save | Save current process list for auto-restart on reboot |
pm2 startup | Generate systemd startup command |
PM2 Ecosystem File (Optional)
For advanced configuration, create ecosystem.config.cjs in your application root:
module.exports = {
apps: [{
name: 'agentlabs',
script: 'npm',
args: 'start',
instances: 1, // Use 'max' for cluster mode
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'production',
PORT: 5000
},
log_date_format: 'YYYY-MM-DD HH:mm:ss',
error_file: './logs/err.log',
out_file: './logs/out.log'
}]
};
pm2 start ecosystem.config.cjs
33Setup Checklist
Track your setup progress. Click each item to mark it complete — progress is saved in your browser.
Required — Core Platform
- PostgreSQL database created and
DATABASE_URLconfigured - Secure
SESSION_SECRETandJWT_SECRETgenerated (64+ chars each) APP_URLandBASE_URLset to your HTTPS domain- Database schema initialized (
npm run db:push) - Super admin account created via the installer wizard
- At least one telephony provider configured (Twilio or Plivo)
- ElevenLabs API key added to the credential pool
- At least one payment gateway configured and enabled
Recommended Setup
- SMTP configured and test email sent successfully
- Branding configured (logo, app name, primary color)
- SEO meta tags and OG image configured
- Twilio/Plivo webhooks pointing to your domain
- Nginx reverse proxy with SSL certificate (Let's Encrypt) configured
- PM2 configured and auto-start on reboot enabled (
pm2 startup) - First AI agent created and test call completed successfully
New Features (v5.3.7)
- Appointments working hours and buffer settings configured
- Appointment booking enabled on at least one agent
- Google Cloud Project created with OAuth credentials configured
- Google Sheets account connected and sync enabled per agent
- Google Calendar API enabled in GCP project (
calendar-json.googleapis.com) - Google Calendar account connected in Appointments Settings
Optional / Enterprise
- OpenAI API key configured for Knowledge Base and/or Realtime voice
- Knowledge base documents uploaded and assigned to agents
- Multiple ElevenLabs keys added for load balancing
- Multiple payment gateways enabled
- SIP Engine Plugin installed and SIP trunk configured
- Team Management Plugin installed and team roles defined
- REST API Plugin installed and API keys created for integrations
- Outbound webhook subscriptions configured for your integrations