AgentLabs Setup Guide
v5.3.7
Documentation

AgentLabs Setup Guide

Complete installation, configuration, and feature reference for your AI-powered voice agent platform. Follow this guide to go from zero to a fully-running production system.

Version 5.3.7 Multi-Provider Enterprise Ready White-Label
Setup Progress: 0%0/0 items complete

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

AI Voice Agents

Deploy ElevenLabs or OpenAI-powered conversational agents for inbound and outbound calling.

Core
CAL

Appointment Booking

Agents book appointments during calls automatically. Sync to Google Calendar.

New
GS

Google Integrations

Sync call data to Google Sheets and appointments to Google Calendar via OAuth.

New
SIP

SIP Engine

Use your own SIP trunks with 13 supported providers for full telephony control.

Plugin
WL

White-Label

Full branding control — custom logo, domain, app name, colors, and footer.

Optional
API

REST API & Webhooks

Programmatic access via API keys and real-time event delivery via signed webhooks.

Plugin

Quick Start — Minimum Viable Setup

  1. Database: Set up PostgreSQL and set DATABASE_URL
  2. Secrets: Generate and set SESSION_SECRET and JWT_SECRET
  3. Build & Initialize: Run npm install, npm run build, npm run db:push
  4. Telephony: Configure at least one provider (Twilio recommended)
  5. AI Provider: Add an ElevenLabs API key to the credential pool
  6. Payments: Enable at least one payment gateway for credit purchases
  7. Email: Configure SMTP for notifications and password resets
  8. Admin Account: Create your super admin via the installer on first visit

02System Requirements

ComponentMinimumRecommendedNotes
Node.js18.x20.x LTSESM required
PostgreSQL14+15+pgvector extension optional (for RAG)
RAM2 GB4+ GB8 GB+ for high call volumes
Storage20 GB50+ GBFor recordings and uploads
CPU2 cores4+ coresFor concurrent call handling
OSUbuntu 20.04+Ubuntu 22.04 LTSDebian-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'))"
Security: Never commit your .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.

Once the server is running, navigate to 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.

Before you start: Take a database backup (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
Migration vs 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:

WebhookURLMethod
Voice (Incoming){APP_URL}/api/twilio/voicePOST
Status Callback{APP_URL}/api/twilio/statusPOST
Recording Callback{APP_URL}/api/twilio/recordingPOST
Note: When users purchase phone numbers through the AgentLabs platform, webhooks are automatically configured. You only need to set webhooks manually for numbers imported from outside the platform.

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:

SettingURL
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

FeatureDescription
Auto Load BalancingRoutes new calls to the credential with the most available capacity
Automatic FailoverIf a key hits rate limits or errors, calls are moved to the next available key
Priority RoutingLower-priority keys are only used when higher-priority ones are full
Usage TrackingReal-time concurrent call count per credential shown in the Admin panel
Per-Agent AssignmentOptionally 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).

RAG Note: The Knowledge Base feature requires the 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:

FieldExampleNotes
SMTP Hostsmtp.sendgrid.netYour provider's SMTP server
SMTP Port587587 (STARTTLS) or 465 (SSL)
SMTP UsernameapikeyOften "apikey" for SendGrid
SMTP PasswordSG.xxxxxYour API key or password
From Emailnoreply@yourdomain.comMust be verified with your provider
From NameYour Platform NameShown in email clients
Use TLSYesEnable 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:

WEL

Welcome Email

Sent on new user registration

RST

Password Reset

Recovery link with 5-minute expiry

OTP

OTP Verification

Two-factor authentication code

LOW

Low Credits Alert

Triggered when balance falls below threshold

RCP

Payment Receipt

Sent after successful credit purchase

CMP

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:

SettingDescriptionRecommended
App NameShown in the header, emails, and page titleYour company/product name
App TaglineSubtitle shown on the landing pageShort, descriptive phrase
Logo URLMain logo image URLSVG or PNG, 200x50px
Favicon URLBrowser tab iconICO or 32x32 PNG
Primary ColorMain brand color used for buttons and accentsHex code, e.g., #6366f1
Footer TextCopyright and legal notice in the footer© 2026 Your Company
Support EmailShown in error pages and contact sectionssupport@yourdomain.com
Custom Domain: Point your domain to your server via DNS and configure Nginx with your domain name. The platform URL is set via the 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)

SettingDescription
Default TitlePage title template — e.g., {Page} | YourBrand
Meta DescriptionDefault description for search results
Meta KeywordsComma-separated keywords (limited SEO impact today)
OG Image URLSocial share preview image (1200x630px recommended)
Twitter Card Typesummary_large_image recommended
Canonical URLPrevents duplicate content penalties

Analytics Scripts

Inject tracking scripts without editing source code. Go to Admin → Settings → Analytics Scripts:

  • Google Analytics 4: Paste your gtag.js snippet 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.txt rules
  • 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

SettingDefaultDescription
jwt_expiry_days7How long JWT tokens stay valid
otp_expiry_minutes5Two-factor OTP code lifetime
password_reset_expiry_minutes5Password reset link lifetime

Credit & Billing

SettingDefaultDescription
credit_price_per_minute0.1Credits consumed per call minute
phone_number_monthly_credits50Monthly credits charged for each phone number
low_credits_threshold50Credit level that triggers the low-balance alert email
min_credit_purchase10Minimum credit package size in currency units

Connection & Performance Limits

SettingDefaultDescription
max_ws_connections_per_process1000Total WebSocket connections per server process
max_ws_connections_per_user5Max concurrent connections per user account
max_openai_connections_per_credential50Max OpenAI Realtime sessions per API key
db_pool_min_connections2Minimum database connection pool size
db_pool_max_connections20Maximum database connection pool size
campaign_batch_concurrency10Maximum concurrent outbound calls per campaign batch

Resource Monitoring & Auto-Restart

SettingDefaultDescription
auto_restart_enabledfalseRestart the process automatically if resource limits are exceeded
auto_restart_ram_percent75RAM usage percentage threshold for auto-restart
auto_restart_cpu_percent85CPU 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.

Requirement: Knowledge Base requires OPENAI_API_KEY set in your environment. OpenAI generates the vector embeddings. ElevenLabs handles the conversation using retrieved context.

Supported Document Types

PDF

PDF Documents

Product manuals, FAQs, policies, guides

TXT

Plain Text

Knowledge articles, scripts

DOC

Word Documents

DOCX format supported

URL

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 Confirmed Completed
Pending / Confirmed Cancelled
Confirmed No-Show
  • 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:

TabShows
UpcomingAll pending and confirmed appointments sorted by date
AllEvery appointment regardless of status, with filters
CompletedHistorical completed appointments
CancelledCancelled 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:

SettingDescription
Working DaysToggle which days of the week are available (Mon–Sun)
Working HoursStart and end time per working day (e.g., 09:00–17:00)
Buffer MinutesMinimum gap required between appointments (default: 30 min)
Allow OverlappingWhether 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.

What gets synced: At the end of each call, AgentLabs appends a new row to your chosen sheet with: caller phone, call date & time, duration, agent name, call outcome, transcript summary, and any custom variables captured during the call.

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

  1. In your project, go to APIs & Services → Library
  2. Search for "Google Sheets API"
  3. Click on it and click Enable
  4. Wait about 30 seconds for the API to activate

Configure the OAuth Consent Screen

  1. Go to APIs & Services → OAuth consent screen
  2. Choose External (unless you have a Google Workspace account)
  3. Fill in App name, user support email, and developer contact email
  4. Under Scopes, add: https://www.googleapis.com/auth/spreadsheets
  5. Under Test users, add your Google account email
  6. Click Save and Continue through all steps
Publishing: Your OAuth app starts in "Testing" mode, which means only test users you added can connect. For production use with multiple users, click Publish App to request verification from Google (or keep it in Testing if only you will connect).

Create OAuth 2.0 Credentials

  1. Go to APIs & Services → Credentials
  2. Click Create Credentials → OAuth client ID
  3. Application type: Web application
  4. Name: e.g., "AgentLabs OAuth Client"
  5. 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.

Per-node assignment: Each form node in a flow can write to a different spreadsheet or the same one. This lets you route different types of captured data to separate sheets within your workflow.

Troubleshooting

ProblemSolution
"Google Sheets API not enabled"Enable the API in your GCP project → APIs & Services → Library
Redirect URI mismatch errorEnsure the redirect URI in GCP exactly matches {APP_URL}/auth/google/callback
App not verified warningAdd your email as a test user in OAuth consent screen, or publish your app
Data not appearing in sheetCheck 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

  1. Go to console.cloud.google.com and select your project
  2. Navigate to APIs & Services → Library
  3. Search for "Google Calendar API"
  4. Click on it and click Enable
  5. Wait 1–2 minutes for the API to propagate — attempting to use it immediately may result in a 403 error even after enabling
Important: If you see a 403 error with message "Google Calendar API has not been used in project N", it means the API is not yet enabled. Enable it at: https://console.developers.google.com/apis/api/calendar-json.googleapis.com/overview?project=YOUR_PROJECT_ID

Update OAuth Consent Screen Scopes

If you're reusing an existing GCP project, add the Calendar scope:

  1. Go to OAuth consent screen → Edit App
  2. Under Scopes, add: https://www.googleapis.com/auth/calendar
  3. 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 ActionCalendar 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 cancelledEvent deleted from calendar
Appointment completedEvent updated with "Completed at: [timestamp]" in description
Notes or details changedEvent 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

ErrorCauseFix
403 API disabledGoogle Calendar API not enabled in GCPEnable at GCP Console → APIs & Library → Google Calendar API
401 UnauthorizedOAuth token expired or revokedDisconnect and reconnect Google Calendar in Settings
Sync button not appearingNo Google account connectedConnect an account in Appointments → Settings first
Events created at wrong timeTimezone mismatchEvents 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

EventDescription
call.startedA call has been initiated
call.completedA call ended — includes transcript and duration
call.failedA call failed to connect or errored mid-call
campaign.startedA campaign began executing
campaign.completedAll calls in a campaign finished
contact.createdA new contact was added
credits.lowAccount credit balance fell below the threshold
appointment.bookedAn 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.

Sold Separately: Plugins are distributed as zip files alongside the core platform. Purchase plugins through the official channel and install them via the Admin UI or manually via SSH.

Available Plugins

SIP

SIP Engine Plugin

Use your own SIP trunks with ElevenLabs and OpenAI engines. Supports 13 providers.

Premium
TM

Team Management Plugin

Team creation, role assignment, granular permissions, admin sub-accounts.

Premium
API

REST API Plugin

Programmatic access via API keys with Swagger and Redoc interactive documentation.

Premium

Method 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

TW
Twilio
PL
Plivo
TX
Telnyx
VX
Vonage
BW
Bandwidth
SW
SignalWire
FR
Flowroute
VM
VoIP.ms
AS
Asterisk
FS
FreeSWITCH
NX
Nexmo
LK
LiveKit
CS
Custom

Engine Comparison

FeatureElevenLabs SIPOpenAI SIP
Outbound CallsYesNo
Inbound CallsYesYes
Voice QualityPremium (ElevenLabs TTS)Good (OpenAI Realtime)
Provider SupportAll 13 providersAll 13 providers
Knowledge BaseYes (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:

RoleAccess Level
Super AdminFull access to all admin features — same as the primary admin
AdminMost admin features, excluding system settings and security config
SupportUser management, viewing logs, and support-oriented features
ViewerRead-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 TypeURLAccess
Redoc (Read-only){APP_URL}/api/docsPublic
Swagger UI (Interactive){APP_URL}/api/docs/playgroundPublic

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

EndpointDescription
GET /api/v1/agentsList and manage AI agents
GET /api/v1/callsView call history and transcripts
POST /api/v1/campaignsCreate and launch campaigns
GET /api/v1/contactsCRUD operations on contacts
GET /api/v1/creditsView credit balance and transactions
GET /api/v1/analyticsAccess analytics and reports
GET /api/v1/webhooksManage webhook subscriptions

Rate Limiting

Plan TierRequests / Minute
Free30
Standard60
Pro120
Enterprise300+

29Production — Server Requirements

ComponentMinimumRecommendedHigh Volume
OSUbuntu 20.04Ubuntu 22.04 LTSUbuntu 22.04 LTS
Node.js18.x20.x LTS20.x LTS
PostgreSQL14+15+15+ with connection pooler
RAM2 GB4 GB8+ GB
CPU2 cores4 cores8+ cores
Storage20 GB50 GB SSD100+ 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
HTTPS Required: Always use HTTPS in production. WebSocket connections for real-time AI calls require a secure context. Ensure both APP_URL and BASE_URL use https:// in your .env.

32Production — PM2 Management

Common PM2 Commands

CommandDescription
pm2 statusView all running processes and their status
pm2 logs agentlabsStream live application logs
pm2 logs agentlabs --lines 100View the last 100 log lines
pm2 restart agentlabsRestart the application (zero-downtime if cluster mode)
pm2 reload agentlabsGraceful reload (in cluster mode)
pm2 stop agentlabsStop the application
pm2 monitReal-time CPU and memory dashboard
pm2 saveSave current process list for auto-restart on reboot
pm2 startupGenerate 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_URL configured
  • Secure SESSION_SECRET and JWT_SECRET generated (64+ chars each)
  • APP_URL and BASE_URL set 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

© 2025–2026 AgentLabs — AI-Powered Voice Agent Platform

Version 5.3.7 — Distributed under the Envato/CodeCanyon License Agreement