elevenlabs-webhook-nodejs 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +27 -0
- package/.dockerignore +6 -0
- package/.env.example +43 -0
- package/BEFORE-PRODUCTION.md +32 -0
- package/Dockerfile +23 -0
- package/SYSTEM_OVERVIEW.md +942 -0
- package/SYSTEM_STATUS.md +332 -0
- package/backup_script/main.py +146 -0
- package/baileys/.dockerignore +7 -0
- package/baileys/Dockerfile +13 -0
- package/baileys/README.md +412 -0
- package/baileys/index.js +499 -0
- package/baileys/package-lock.json +2532 -0
- package/baileys/package.json +25 -0
- package/baileys/server.js +96 -0
- package/baileys/src/config.js +55 -0
- package/baileys/src/middleware/api-key.js +16 -0
- package/baileys/src/routes/accounts.js +51 -0
- package/baileys/src/routes/chats.js +103 -0
- package/baileys/src/routes/webhooks.js +34 -0
- package/baileys/src/services/account-store.js +259 -0
- package/baileys/src/services/webhook-dispatcher.js +161 -0
- package/baileys/src/services/worker-manager.js +597 -0
- package/baileys/src/utils/jid.js +79 -0
- package/baileys/src/utils/logger.js +16 -0
- package/baileys/src/utils/use-mongodb-auth-state.js +122 -0
- package/baileys/worker.js +721 -0
- package/dist/app.d.ts +1 -0
- package/dist/app.js +84 -0
- package/dist/app.js.map +1 -0
- package/dist/config/agentPrompts.json +19 -0
- package/dist/config/database.d.ts +1 -0
- package/dist/config/database.js +26 -0
- package/dist/config/database.js.map +1 -0
- package/dist/config/env.d.ts +41 -0
- package/dist/config/env.js +81 -0
- package/dist/config/env.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +73 -0
- package/dist/config/index.js.map +1 -0
- package/dist/controllers/webhook.controller.d.ts +10 -0
- package/dist/controllers/webhook.controller.js +128 -0
- package/dist/controllers/webhook.controller.js.map +1 -0
- package/dist/errors/index.d.ts +4 -0
- package/dist/errors/index.js +13 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/hooks/webhookValidator.d.ts +2 -0
- package/dist/hooks/webhookValidator.js +47 -0
- package/dist/hooks/webhookValidator.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/001_session-architecture.d.ts +3 -0
- package/dist/migrations/001_session-architecture.js +119 -0
- package/dist/migrations/001_session-architecture.js.map +1 -0
- package/dist/migrations/002_agent-ref.d.ts +3 -0
- package/dist/migrations/002_agent-ref.js +55 -0
- package/dist/migrations/002_agent-ref.js.map +1 -0
- package/dist/migrations/003_shift-schedule.d.ts +3 -0
- package/dist/migrations/003_shift-schedule.js +48 -0
- package/dist/migrations/003_shift-schedule.js.map +1 -0
- package/dist/migrations/004_invert-shift-to-clinic-hours.d.ts +3 -0
- package/dist/migrations/004_invert-shift-to-clinic-hours.js +27 -0
- package/dist/migrations/004_invert-shift-to-clinic-hours.js.map +1 -0
- package/dist/migrations/005_composite-baileys-chat-ids.d.ts +3 -0
- package/dist/migrations/005_composite-baileys-chat-ids.js +47 -0
- package/dist/migrations/005_composite-baileys-chat-ids.js.map +1 -0
- package/dist/migrations/migration.model.d.ts +18 -0
- package/dist/migrations/migration.model.js +45 -0
- package/dist/migrations/migration.model.js.map +1 -0
- package/dist/migrations/migration.routes.d.ts +2 -0
- package/dist/migrations/migration.routes.js +37 -0
- package/dist/migrations/migration.routes.js.map +1 -0
- package/dist/migrations/migration.runner.d.ts +19 -0
- package/dist/migrations/migration.runner.js +74 -0
- package/dist/migrations/migration.runner.js.map +1 -0
- package/dist/models/ConversationClaim.d.ts +13 -0
- package/dist/models/ConversationClaim.js +44 -0
- package/dist/models/ConversationClaim.js.map +1 -0
- package/dist/models/ConversationEvaluation.d.ts +23 -0
- package/dist/models/ConversationEvaluation.js +92 -0
- package/dist/models/ConversationEvaluation.js.map +1 -0
- package/dist/models/Summary.d.ts +37 -0
- package/dist/models/Summary.js +78 -0
- package/dist/models/Summary.js.map +1 -0
- package/dist/models/Transcription.d.ts +34 -0
- package/dist/models/Transcription.js +71 -0
- package/dist/models/Transcription.js.map +1 -0
- package/dist/models/WhatsAppRecipient.d.ts +23 -0
- package/dist/models/WhatsAppRecipient.js +53 -0
- package/dist/models/WhatsAppRecipient.js.map +1 -0
- package/dist/modules/admin/admin.routes.d.ts +2 -0
- package/dist/modules/admin/admin.routes.js +1966 -0
- package/dist/modules/admin/admin.routes.js.map +1 -0
- package/dist/modules/admin/elevenlabs-test-chat.routes.d.ts +2 -0
- package/dist/modules/admin/elevenlabs-test-chat.routes.js +158 -0
- package/dist/modules/admin/elevenlabs-test-chat.routes.js.map +1 -0
- package/dist/modules/admin/whatsapp-test-chat.routes.d.ts +2 -0
- package/dist/modules/admin/whatsapp-test-chat.routes.js +204 -0
- package/dist/modules/admin/whatsapp-test-chat.routes.js.map +1 -0
- package/dist/modules/agents/agent.model.d.ts +38 -0
- package/dist/modules/agents/agent.model.js +92 -0
- package/dist/modules/agents/agent.model.js.map +1 -0
- package/dist/modules/agents/agent.routes.d.ts +2 -0
- package/dist/modules/agents/agent.routes.js +61 -0
- package/dist/modules/agents/agent.routes.js.map +1 -0
- package/dist/modules/appointment-validation/appointment-validation.model.d.ts +76 -0
- package/dist/modules/appointment-validation/appointment-validation.model.js +118 -0
- package/dist/modules/appointment-validation/appointment-validation.model.js.map +1 -0
- package/dist/modules/appointment-validation/appointment-validation.routes.d.ts +2 -0
- package/dist/modules/appointment-validation/appointment-validation.routes.js +202 -0
- package/dist/modules/appointment-validation/appointment-validation.routes.js.map +1 -0
- package/dist/modules/appointment-validation/appointment-validation.service.d.ts +53 -0
- package/dist/modules/appointment-validation/appointment-validation.service.js +827 -0
- package/dist/modules/appointment-validation/appointment-validation.service.js.map +1 -0
- package/dist/modules/auth/auth.model.d.ts +17 -0
- package/dist/modules/auth/auth.model.js +64 -0
- package/dist/modules/auth/auth.model.js.map +1 -0
- package/dist/modules/auth/auth.routes.d.ts +2 -0
- package/dist/modules/auth/auth.routes.js +202 -0
- package/dist/modules/auth/auth.routes.js.map +1 -0
- package/dist/modules/auth/auth.service.d.ts +28 -0
- package/dist/modules/auth/auth.service.js +183 -0
- package/dist/modules/auth/auth.service.js.map +1 -0
- package/dist/modules/auth/refresh-token.model.d.ts +13 -0
- package/dist/modules/auth/refresh-token.model.js +52 -0
- package/dist/modules/auth/refresh-token.model.js.map +1 -0
- package/dist/modules/billing/billing-alert.model.d.ts +16 -0
- package/dist/modules/billing/billing-alert.model.js +47 -0
- package/dist/modules/billing/billing-alert.model.js.map +1 -0
- package/dist/modules/billing/billing-period-snapshot.model.d.ts +35 -0
- package/dist/modules/billing/billing-period-snapshot.model.js +68 -0
- package/dist/modules/billing/billing-period-snapshot.model.js.map +1 -0
- package/dist/modules/billing/billing.model.d.ts +18 -0
- package/dist/modules/billing/billing.model.js +62 -0
- package/dist/modules/billing/billing.model.js.map +1 -0
- package/dist/modules/billing/billing.routes.d.ts +2 -0
- package/dist/modules/billing/billing.routes.js +63 -0
- package/dist/modules/billing/billing.routes.js.map +1 -0
- package/dist/modules/billing/billing.service.d.ts +69 -0
- package/dist/modules/billing/billing.service.js +498 -0
- package/dist/modules/billing/billing.service.js.map +1 -0
- package/dist/modules/billing/payment.model.d.ts +24 -0
- package/dist/modules/billing/payment.model.js +57 -0
- package/dist/modules/billing/payment.model.js.map +1 -0
- package/dist/modules/calls/call.model.d.ts +41 -0
- package/dist/modules/calls/call.model.js +97 -0
- package/dist/modules/calls/call.model.js.map +1 -0
- package/dist/modules/calls/call.routes.d.ts +2 -0
- package/dist/modules/calls/call.routes.js +103 -0
- package/dist/modules/calls/call.routes.js.map +1 -0
- package/dist/modules/campaigns/campaign.model.d.ts +45 -0
- package/dist/modules/campaigns/campaign.model.js +98 -0
- package/dist/modules/campaigns/campaign.model.js.map +1 -0
- package/dist/modules/campaigns/campaign.routes.d.ts +2 -0
- package/dist/modules/campaigns/campaign.routes.js +323 -0
- package/dist/modules/campaigns/campaign.routes.js.map +1 -0
- package/dist/modules/campaigns/campaign.service.d.ts +11 -0
- package/dist/modules/campaigns/campaign.service.js +86 -0
- package/dist/modules/campaigns/campaign.service.js.map +1 -0
- package/dist/modules/google-calendar/google-calendar.routes.d.ts +2 -0
- package/dist/modules/google-calendar/google-calendar.routes.js +32 -0
- package/dist/modules/google-calendar/google-calendar.routes.js.map +1 -0
- package/dist/modules/inbound-call/inbound-call-config.model.d.ts +20 -0
- package/dist/modules/inbound-call/inbound-call-config.model.js +68 -0
- package/dist/modules/inbound-call/inbound-call-config.model.js.map +1 -0
- package/dist/modules/inbound-call/inbound-call.routes.d.ts +2 -0
- package/dist/modules/inbound-call/inbound-call.routes.js +243 -0
- package/dist/modules/inbound-call/inbound-call.routes.js.map +1 -0
- package/dist/modules/leads/lead.model.d.ts +24 -0
- package/dist/modules/leads/lead.model.js +54 -0
- package/dist/modules/leads/lead.model.js.map +1 -0
- package/dist/modules/leads/lead.routes.d.ts +2 -0
- package/dist/modules/leads/lead.routes.js +201 -0
- package/dist/modules/leads/lead.routes.js.map +1 -0
- package/dist/modules/plans/plan.model.d.ts +25 -0
- package/dist/modules/plans/plan.model.js +59 -0
- package/dist/modules/plans/plan.model.js.map +1 -0
- package/dist/modules/surveys/survey.model.d.ts +30 -0
- package/dist/modules/surveys/survey.model.js +75 -0
- package/dist/modules/surveys/survey.model.js.map +1 -0
- package/dist/modules/surveys/survey.routes.d.ts +2 -0
- package/dist/modules/surveys/survey.routes.js +153 -0
- package/dist/modules/surveys/survey.routes.js.map +1 -0
- package/dist/modules/tenants/tenant.model.d.ts +86 -0
- package/dist/modules/tenants/tenant.model.js +127 -0
- package/dist/modules/tenants/tenant.model.js.map +1 -0
- package/dist/modules/tenants/tenant.routes.d.ts +2 -0
- package/dist/modules/tenants/tenant.routes.js +65 -0
- package/dist/modules/tenants/tenant.routes.js.map +1 -0
- package/dist/modules/users/user.routes.d.ts +2 -0
- package/dist/modules/users/user.routes.js +106 -0
- package/dist/modules/users/user.routes.js.map +1 -0
- package/dist/modules/webhooks/elevenlabs-tool.routes.d.ts +20 -0
- package/dist/modules/webhooks/elevenlabs-tool.routes.js +85 -0
- package/dist/modules/webhooks/elevenlabs-tool.routes.js.map +1 -0
- package/dist/modules/webhooks/elevenlabs-tool.service.d.ts +11 -0
- package/dist/modules/webhooks/elevenlabs-tool.service.js +360 -0
- package/dist/modules/webhooks/elevenlabs-tool.service.js.map +1 -0
- package/dist/modules/webhooks/elevenlabs.routes.d.ts +2 -0
- package/dist/modules/webhooks/elevenlabs.routes.js +34 -0
- package/dist/modules/webhooks/elevenlabs.routes.js.map +1 -0
- package/dist/modules/webhooks/elevenlabs.service.d.ts +6 -0
- package/dist/modules/webhooks/elevenlabs.service.js +512 -0
- package/dist/modules/webhooks/elevenlabs.service.js.map +1 -0
- package/dist/modules/webhooks/unipile.routes.d.ts +2 -0
- package/dist/modules/webhooks/unipile.routes.js +780 -0
- package/dist/modules/webhooks/unipile.routes.js.map +1 -0
- package/dist/modules/whatsapp/appointment.model.d.ts +27 -0
- package/dist/modules/whatsapp/appointment.model.js +58 -0
- package/dist/modules/whatsapp/appointment.model.js.map +1 -0
- package/dist/modules/whatsapp/operator-request.model.d.ts +29 -0
- package/dist/modules/whatsapp/operator-request.model.js +65 -0
- package/dist/modules/whatsapp/operator-request.model.js.map +1 -0
- package/dist/modules/whatsapp/stt-usage.model.d.ts +16 -0
- package/dist/modules/whatsapp/stt-usage.model.js +53 -0
- package/dist/modules/whatsapp/stt-usage.model.js.map +1 -0
- package/dist/modules/whatsapp/whatsapp-chat.model.d.ts +23 -0
- package/dist/modules/whatsapp/whatsapp-chat.model.js +55 -0
- package/dist/modules/whatsapp/whatsapp-chat.model.js.map +1 -0
- package/dist/modules/whatsapp/whatsapp-contact-profile.model.d.ts +23 -0
- package/dist/modules/whatsapp/whatsapp-contact-profile.model.js +54 -0
- package/dist/modules/whatsapp/whatsapp-contact-profile.model.js.map +1 -0
- package/dist/modules/whatsapp/whatsapp-message.model.d.ts +30 -0
- package/dist/modules/whatsapp/whatsapp-message.model.js +52 -0
- package/dist/modules/whatsapp/whatsapp-message.model.js.map +1 -0
- package/dist/modules/whatsapp/whatsapp-session.model.d.ts +33 -0
- package/dist/modules/whatsapp/whatsapp-session.model.js +65 -0
- package/dist/modules/whatsapp/whatsapp-session.model.js.map +1 -0
- package/dist/modules/whatsapp/whatsapp.routes.d.ts +2 -0
- package/dist/modules/whatsapp/whatsapp.routes.js +1237 -0
- package/dist/modules/whatsapp/whatsapp.routes.js.map +1 -0
- package/dist/plugins/cors.d.ts +3 -0
- package/dist/plugins/cors.js +11 -0
- package/dist/plugins/cors.js.map +1 -0
- package/dist/plugins/jwt.d.ts +3 -0
- package/dist/plugins/jwt.js +22 -0
- package/dist/plugins/jwt.js.map +1 -0
- package/dist/plugins/rawBody.d.ts +3 -0
- package/dist/plugins/rawBody.js +16 -0
- package/dist/plugins/rawBody.js.map +1 -0
- package/dist/plugins/rbac.d.ts +5 -0
- package/dist/plugins/rbac.js +29 -0
- package/dist/plugins/rbac.js.map +1 -0
- package/dist/routes/admin.routes.d.ts +2 -0
- package/dist/routes/admin.routes.js +169 -0
- package/dist/routes/admin.routes.js.map +1 -0
- package/dist/routes/health.routes.d.ts +2 -0
- package/dist/routes/health.routes.js +16 -0
- package/dist/routes/health.routes.js.map +1 -0
- package/dist/routes/webhook.routes.d.ts +2 -0
- package/dist/routes/webhook.routes.js +17 -0
- package/dist/routes/webhook.routes.js.map +1 -0
- package/dist/services/ai/base.ai.d.ts +19 -0
- package/dist/services/ai/base.ai.js +120 -0
- package/dist/services/ai/base.ai.js.map +1 -0
- package/dist/services/ai/gemini.service.d.ts +11 -0
- package/dist/services/ai/gemini.service.js +43 -0
- package/dist/services/ai/gemini.service.js.map +1 -0
- package/dist/services/ai/index.d.ts +2 -0
- package/dist/services/ai/index.js +26 -0
- package/dist/services/ai/index.js.map +1 -0
- package/dist/services/ai/openai.service.d.ts +11 -0
- package/dist/services/ai/openai.service.js +50 -0
- package/dist/services/ai/openai.service.js.map +1 -0
- package/dist/services/elevenlabs.service.d.ts +52 -0
- package/dist/services/elevenlabs.service.js +447 -0
- package/dist/services/elevenlabs.service.js.map +1 -0
- package/dist/services/google-calendar.service.d.ts +60 -0
- package/dist/services/google-calendar.service.js +494 -0
- package/dist/services/google-calendar.service.js.map +1 -0
- package/dist/services/inbound-call-schedule.service.d.ts +11 -0
- package/dist/services/inbound-call-schedule.service.js +162 -0
- package/dist/services/inbound-call-schedule.service.js.map +1 -0
- package/dist/services/netgsm.service.d.ts +41 -0
- package/dist/services/netgsm.service.js +89 -0
- package/dist/services/netgsm.service.js.map +1 -0
- package/dist/services/unipile.service.d.ts +41 -0
- package/dist/services/unipile.service.js +149 -0
- package/dist/services/unipile.service.js.map +1 -0
- package/dist/services/whatsapp-agent.service.d.ts +139 -0
- package/dist/services/whatsapp-agent.service.js +2055 -0
- package/dist/services/whatsapp-agent.service.js.map +1 -0
- package/dist/services/whatsapp.service.d.ts +26 -0
- package/dist/services/whatsapp.service.js +206 -0
- package/dist/services/whatsapp.service.js.map +1 -0
- package/dist/templates/index.d.ts +39 -0
- package/dist/templates/index.js +35 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/receptionist.d.ts +2 -0
- package/dist/templates/receptionist.js +39 -0
- package/dist/templates/receptionist.js.map +1 -0
- package/dist/templates/survey.d.ts +2 -0
- package/dist/templates/survey.js +41 -0
- package/dist/templates/survey.js.map +1 -0
- package/dist/types/index.d.ts +173 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/logger.js +105 -0
- package/dist/utils/logger.js.map +1 -0
- package/docker-compose.nestjs.yml +89 -0
- package/docker-compose.yml +78 -0
- package/docs/AI_AGENT_ENHANCEMENT_PLAN.md +164 -0
- package/docs/API.md +1193 -0
- package/docs/API_ENDPOINTS.md +344 -0
- package/docs/ARCHITECTURE.md +305 -0
- package/docs/AUTH_API.md +252 -0
- package/docs/BILLING_SMS_ALERTS.md +94 -0
- package/docs/CHAT_ASSIGNMENT_SYSTEM.md +118 -0
- package/docs/CLIENT_TOOLS_AND_FEATURES.md +337 -0
- package/docs/ELEVENLABS_WEBHOOK_TOOLS.md +644 -0
- package/docs/FRONTEND_CHECKLIST.md +227 -0
- package/docs/IMPLEMENTATION_STATUS.md +470 -0
- package/docs/MIGRATION_GUIDE.md +96 -0
- package/docs/MISSINGS_REPORT.md +507 -0
- package/docs/NESTJS_MIGRATION_REFERENCE.md +5136 -0
- package/docs/PROJECT_DESCRIPTION.md +1038 -0
- package/docs/SCALING.md +148 -0
- package/docs/SESSION_SUMMARY_2026_03_17.md +135 -0
- package/docs/WHATSAPP_AGENT.md +1086 -0
- package/docs/architecture/00-SYSTEM-OVERVIEW.md +318 -0
- package/docs/architecture/01-DATABASE-SCHEMA.md +2564 -0
- package/docs/architecture/02-AUTHENTICATION.md +1040 -0
- package/docs/architecture/03-MULTI-CLINIC.md +742 -0
- package/docs/architecture/04-WHATSAPP-AGENT.md +608 -0
- package/docs/architecture/05-OPERATOR-WORKFLOW.md +444 -0
- package/docs/architecture/06-BAILEYS-MICROSERVICE.md +616 -0
- package/docs/architecture/07-APPOINTMENTS.md +849 -0
- package/docs/architecture/08-VOICE-CALLS.md +470 -0
- package/docs/architecture/09-OUTBOUND-CAMPAIGNS.md +542 -0
- package/docs/architecture/10-CLIENT-TOOLS.md +665 -0
- package/docs/architecture/11-BILLING.md +458 -0
- package/docs/architecture/12-SECURITY.md +216 -0
- package/docs/architecture/13-LOGGING-AUDIT.md +549 -0
- package/docs/architecture/14-META-BUSINESS-API.md +454 -0
- package/docs/architecture/15-AI-MODULE.md +479 -0
- package/docs/architecture/16-BACKGROUND-JOBS.md +469 -0
- package/docs/architecture/17-REALTIME-LIVECHAT.md +447 -0
- package/docs/architecture/18-FILE-STORAGE.md +410 -0
- package/docs/architecture/19-PATIENTS.md +1034 -0
- package/docs/architecture/20-TREATMENTS-AND-PLANS.md +774 -0
- package/docs/architecture/21-BEFORE-AFTER-PHOTOS.md +519 -0
- package/docs/database.md +456 -0
- package/docs/ornek-randevu-onay.csv +3 -0
- package/ecosystem.config.js +16 -0
- package/elevenlabs-convai-api-reference.md +1171 -0
- package/frontend/.dockerignore +2 -0
- package/frontend/Dockerfile +24 -0
- package/frontend/README.md +75 -0
- package/frontend/components.json +25 -0
- package/frontend/eslint.config.js +23 -0
- package/frontend/index.html +13 -0
- package/frontend/nginx.conf +37 -0
- package/frontend/package-lock.json +8709 -0
- package/frontend/package.json +71 -0
- package/frontend/public/favicon.svg +1 -0
- package/frontend/public/icons.svg +24 -0
- package/frontend/src/App.tsx +125 -0
- package/frontend/src/components/error-boundary.tsx +50 -0
- package/frontend/src/components/shared/activity-timeline.tsx +66 -0
- package/frontend/src/components/shared/appointment-calendar.css +80 -0
- package/frontend/src/components/shared/appointment-calendar.tsx +245 -0
- package/frontend/src/components/shared/chat-bubble.tsx +72 -0
- package/frontend/src/components/shared/combobox.tsx +119 -0
- package/frontend/src/components/shared/confirm-dialog.tsx +57 -0
- package/frontend/src/components/shared/data-table-pagination.tsx +97 -0
- package/frontend/src/components/shared/data-table-toolbar.tsx +39 -0
- package/frontend/src/components/shared/empty-state.tsx +27 -0
- package/frontend/src/components/shared/file-upload.tsx +140 -0
- package/frontend/src/components/shared/index.ts +20 -0
- package/frontend/src/components/shared/language-switcher.tsx +29 -0
- package/frontend/src/components/shared/notification-dropdown.tsx +115 -0
- package/frontend/src/components/shared/page-header.tsx +23 -0
- package/frontend/src/components/shared/stat-card.tsx +37 -0
- package/frontend/src/components/shared/status-badge.tsx +70 -0
- package/frontend/src/components/shared/status-dot.tsx +43 -0
- package/frontend/src/components/ui/alert-dialog.tsx +187 -0
- package/frontend/src/components/ui/alert.tsx +76 -0
- package/frontend/src/components/ui/avatar.tsx +109 -0
- package/frontend/src/components/ui/badge.tsx +52 -0
- package/frontend/src/components/ui/breadcrumb.tsx +125 -0
- package/frontend/src/components/ui/button.tsx +60 -0
- package/frontend/src/components/ui/calendar.tsx +219 -0
- package/frontend/src/components/ui/card.tsx +103 -0
- package/frontend/src/components/ui/chart.tsx +371 -0
- package/frontend/src/components/ui/checkbox.tsx +29 -0
- package/frontend/src/components/ui/collapsible.tsx +19 -0
- package/frontend/src/components/ui/command.tsx +194 -0
- package/frontend/src/components/ui/dialog.tsx +158 -0
- package/frontend/src/components/ui/dropdown-menu.tsx +268 -0
- package/frontend/src/components/ui/input-group.tsx +156 -0
- package/frontend/src/components/ui/input.tsx +20 -0
- package/frontend/src/components/ui/label.tsx +20 -0
- package/frontend/src/components/ui/pagination.tsx +130 -0
- package/frontend/src/components/ui/popover.tsx +90 -0
- package/frontend/src/components/ui/progress.tsx +83 -0
- package/frontend/src/components/ui/radio-group.tsx +36 -0
- package/frontend/src/components/ui/scroll-area.tsx +54 -0
- package/frontend/src/components/ui/select.tsx +199 -0
- package/frontend/src/components/ui/separator.tsx +23 -0
- package/frontend/src/components/ui/sheet.tsx +138 -0
- package/frontend/src/components/ui/sidebar.tsx +723 -0
- package/frontend/src/components/ui/skeleton.tsx +13 -0
- package/frontend/src/components/ui/sonner.tsx +47 -0
- package/frontend/src/components/ui/switch.tsx +30 -0
- package/frontend/src/components/ui/table.tsx +114 -0
- package/frontend/src/components/ui/tabs.tsx +82 -0
- package/frontend/src/components/ui/textarea.tsx +18 -0
- package/frontend/src/components/ui/toggle-group.tsx +89 -0
- package/frontend/src/components/ui/toggle.tsx +43 -0
- package/frontend/src/components/ui/tooltip.tsx +64 -0
- package/frontend/src/hooks/use-mobile.ts +19 -0
- package/frontend/src/i18n/index.ts +20 -0
- package/frontend/src/i18n/locales/en.json +786 -0
- package/frontend/src/i18n/locales/tr.json +786 -0
- package/frontend/src/index.css +134 -0
- package/frontend/src/layouts/admin-layout.tsx +111 -0
- package/frontend/src/layouts/app-header.tsx +130 -0
- package/frontend/src/layouts/app-layout.tsx +19 -0
- package/frontend/src/layouts/app-sidebar.tsx +212 -0
- package/frontend/src/layouts/auth-guard.tsx +31 -0
- package/frontend/src/layouts/mobile-sidebar.tsx +120 -0
- package/frontend/src/lib/api.ts +68 -0
- package/frontend/src/lib/hooks/use-appointments.ts +224 -0
- package/frontend/src/lib/hooks/use-availability-blocks.ts +83 -0
- package/frontend/src/lib/hooks/use-chats.ts +236 -0
- package/frontend/src/lib/hooks/use-clinic-detail.ts +171 -0
- package/frontend/src/lib/hooks/use-clinics.ts +37 -0
- package/frontend/src/lib/hooks/use-doctor-calendar.ts +80 -0
- package/frontend/src/lib/hooks/use-examinations.ts +89 -0
- package/frontend/src/lib/hooks/use-medical-history.ts +52 -0
- package/frontend/src/lib/hooks/use-patients.ts +296 -0
- package/frontend/src/lib/hooks/use-photo-sets.ts +118 -0
- package/frontend/src/lib/hooks/use-treatment-plans.ts +152 -0
- package/frontend/src/lib/hooks/use-treatments.ts +125 -0
- package/frontend/src/lib/hooks/use-users.ts +172 -0
- package/frontend/src/lib/utils.ts +6 -0
- package/frontend/src/main.tsx +17 -0
- package/frontend/src/pages/admin/agents/detail.tsx +774 -0
- package/frontend/src/pages/admin/agents/import.tsx +280 -0
- package/frontend/src/pages/admin/agents/index.tsx +245 -0
- package/frontend/src/pages/admin/ai-playground.tsx +543 -0
- package/frontend/src/pages/appointments/create-appointment-dialog.tsx +390 -0
- package/frontend/src/pages/appointments/index.tsx +860 -0
- package/frontend/src/pages/audit/index.tsx +24 -0
- package/frontend/src/pages/auth/login.tsx +194 -0
- package/frontend/src/pages/billing/index.tsx +24 -0
- package/frontend/src/pages/calendar/index.tsx +704 -0
- package/frontend/src/pages/calendar-connections/index.tsx +295 -0
- package/frontend/src/pages/calls/index.tsx +24 -0
- package/frontend/src/pages/campaigns/index.tsx +24 -0
- package/frontend/src/pages/chats/index.tsx +981 -0
- package/frontend/src/pages/clinics/index.tsx +224 -0
- package/frontend/src/pages/clinics/settings.tsx +412 -0
- package/frontend/src/pages/components-showcase.tsx +773 -0
- package/frontend/src/pages/connections/index.tsx +328 -0
- package/frontend/src/pages/dashboard.tsx +50 -0
- package/frontend/src/pages/leads/index.tsx +24 -0
- package/frontend/src/pages/my-schedule/index.tsx +496 -0
- package/frontend/src/pages/patients/create-patient-dialog.tsx +358 -0
- package/frontend/src/pages/patients/detail.tsx +1195 -0
- package/frontend/src/pages/patients/edit-patient-dialog.tsx +387 -0
- package/frontend/src/pages/patients/examinations-tab.tsx +460 -0
- package/frontend/src/pages/patients/index.tsx +381 -0
- package/frontend/src/pages/patients/medical-history-dialog.tsx +207 -0
- package/frontend/src/pages/patients/photo-sets-tab.tsx +616 -0
- package/frontend/src/pages/patients/timeline-tab.tsx +164 -0
- package/frontend/src/pages/patients/treatment-plans-tab.tsx +598 -0
- package/frontend/src/pages/phone-numbers/detail.tsx +427 -0
- package/frontend/src/pages/phone-numbers/index.tsx +455 -0
- package/frontend/src/pages/platform/index.tsx +454 -0
- package/frontend/src/pages/settings/index.tsx +126 -0
- package/frontend/src/pages/treatments/index.tsx +487 -0
- package/frontend/src/pages/users/doctor-profile.tsx +672 -0
- package/frontend/src/pages/users/edit.tsx +329 -0
- package/frontend/src/pages/users/index.tsx +407 -0
- package/frontend/src/pages/validation/index.tsx +24 -0
- package/frontend/src/stores/auth.store.ts +108 -0
- package/frontend/src/stores/ui.store.ts +41 -0
- package/frontend/tsconfig.app.json +32 -0
- package/frontend/tsconfig.json +13 -0
- package/frontend/tsconfig.node.json +26 -0
- package/frontend/vite.config.ts +29 -0
- package/nestjs/.dockerignore +5 -0
- package/nestjs/.env.docker +64 -0
- package/nestjs/.prettierrc +4 -0
- package/nestjs/Dockerfile +36 -0
- package/nestjs/README.md +98 -0
- package/nestjs/eslint.config.mjs +35 -0
- package/nestjs/nest-cli.json +8 -0
- package/nestjs/package-lock.json +13390 -0
- package/nestjs/package.json +114 -0
- package/nestjs/prisma/migrations/20260409161536_add_message_metadata_fields/migration.sql +1746 -0
- package/nestjs/prisma/migrations/20260410140436_add_agent_ai_fields/migration.sql +36 -0
- package/nestjs/prisma/migrations/20260410175519_add_agent_clinic_assignments/migration.sql +21 -0
- package/nestjs/prisma/migrations/20260412094344_make_agent_tenant_optional/migration.sql +2 -0
- package/nestjs/prisma/migrations/20260412110008_add_admin_chat_sessions/migration.sql +47 -0
- package/nestjs/prisma/migrations/migration_lock.toml +3 -0
- package/nestjs/prisma/schema.prisma +1843 -0
- package/nestjs/prisma/seed.ts +375 -0
- package/nestjs/prisma.config.ts +14 -0
- package/nestjs/src/admin/admin.controller.ts +27 -0
- package/nestjs/src/admin/admin.module.ts +16 -0
- package/nestjs/src/admin/admin.service.ts +91 -0
- package/nestjs/src/admin/ai-chat-session.service.ts +454 -0
- package/nestjs/src/admin/ai-test.controller.ts +191 -0
- package/nestjs/src/admin/superadmin.controller.ts +106 -0
- package/nestjs/src/agents/agents.controller.ts +262 -0
- package/nestjs/src/agents/agents.module.ts +13 -0
- package/nestjs/src/agents/agents.service.ts +733 -0
- package/nestjs/src/agents/dto/create-agent.dto.ts +99 -0
- package/nestjs/src/agents/dto/index.ts +2 -0
- package/nestjs/src/agents/dto/update-agent.dto.ts +148 -0
- package/nestjs/src/app.module.ts +115 -0
- package/nestjs/src/appointment-validation/appointment-validation.controller.ts +194 -0
- package/nestjs/src/appointment-validation/appointment-validation.module.ts +16 -0
- package/nestjs/src/appointment-validation/appointment-validation.service.ts +450 -0
- package/nestjs/src/appointment-validation/dto/create-batch.dto.ts +105 -0
- package/nestjs/src/appointment-validation/dto/index.ts +1 -0
- package/nestjs/src/appointment-validation/processors/validation-dispatch.processor.ts +26 -0
- package/nestjs/src/appointment-validation/processors/validation-sync.processor.ts +23 -0
- package/nestjs/src/appointments/appointments.controller.ts +268 -0
- package/nestjs/src/appointments/appointments.module.ts +13 -0
- package/nestjs/src/appointments/appointments.service.ts +773 -0
- package/nestjs/src/appointments/dto/create-appointment.dto.ts +72 -0
- package/nestjs/src/appointments/dto/index.ts +4 -0
- package/nestjs/src/appointments/dto/query-appointments.dto.ts +60 -0
- package/nestjs/src/appointments/dto/update-appointment.dto.ts +43 -0
- package/nestjs/src/appointments/dto/update-status.dto.ts +18 -0
- package/nestjs/src/appointments/processors/reminder.processor.ts +243 -0
- package/nestjs/src/audit/audit.controller.ts +84 -0
- package/nestjs/src/audit/audit.decorator.ts +20 -0
- package/nestjs/src/audit/audit.interceptor.ts +67 -0
- package/nestjs/src/audit/audit.interfaces.ts +15 -0
- package/nestjs/src/audit/audit.module.ts +12 -0
- package/nestjs/src/audit/audit.service.ts +177 -0
- package/nestjs/src/auth/auth.controller.ts +116 -0
- package/nestjs/src/auth/auth.module.ts +25 -0
- package/nestjs/src/auth/auth.service.ts +612 -0
- package/nestjs/src/auth/dto/change-password.dto.ts +13 -0
- package/nestjs/src/auth/dto/forgot-password.dto.ts +8 -0
- package/nestjs/src/auth/dto/index.ts +6 -0
- package/nestjs/src/auth/dto/login.dto.ts +13 -0
- package/nestjs/src/auth/dto/refresh.dto.ts +8 -0
- package/nestjs/src/auth/dto/register.dto.ts +28 -0
- package/nestjs/src/auth/dto/reset-password.dto.ts +13 -0
- package/nestjs/src/auth/permissions.config.ts +85 -0
- package/nestjs/src/availability-blocks/availability-blocks.controller.ts +83 -0
- package/nestjs/src/availability-blocks/availability-blocks.module.ts +10 -0
- package/nestjs/src/availability-blocks/availability-blocks.service.ts +202 -0
- package/nestjs/src/billing/billing.controller.ts +104 -0
- package/nestjs/src/billing/billing.module.ts +12 -0
- package/nestjs/src/billing/billing.service.ts +398 -0
- package/nestjs/src/billing/dto/index.ts +2 -0
- package/nestjs/src/billing/dto/query-billing.dto.ts +29 -0
- package/nestjs/src/billing/dto/record-payment.dto.ts +60 -0
- package/nestjs/src/billing/processors/alerts.processor.ts +216 -0
- package/nestjs/src/billing/processors/snapshot.processor.ts +181 -0
- package/nestjs/src/calls/calls.controller.ts +92 -0
- package/nestjs/src/calls/calls.module.ts +10 -0
- package/nestjs/src/calls/calls.service.ts +359 -0
- package/nestjs/src/calls/dto/index.ts +1 -0
- package/nestjs/src/calls/dto/query-calls.dto.ts +46 -0
- package/nestjs/src/clinics/clinics.controller.ts +226 -0
- package/nestjs/src/clinics/clinics.module.ts +11 -0
- package/nestjs/src/clinics/clinics.service.ts +203 -0
- package/nestjs/src/clinics/dto/create-clinic.dto.ts +40 -0
- package/nestjs/src/clinics/dto/create-meta-connection.dto.ts +44 -0
- package/nestjs/src/clinics/dto/index.ts +4 -0
- package/nestjs/src/clinics/dto/update-clinic.dto.ts +133 -0
- package/nestjs/src/clinics/dto/update-meta-connection.dto.ts +22 -0
- package/nestjs/src/clinics/meta-connections.service.ts +210 -0
- package/nestjs/src/common/decorators/accessible-clinics.decorator.ts +9 -0
- package/nestjs/src/common/decorators/current-user.decorator.ts +10 -0
- package/nestjs/src/common/decorators/features.decorator.ts +7 -0
- package/nestjs/src/common/decorators/index.ts +4 -0
- package/nestjs/src/common/decorators/permissions.decorator.ts +13 -0
- package/nestjs/src/common/gateways/events.gateway.ts +157 -0
- package/nestjs/src/common/guards/clinic-access.guard.ts +40 -0
- package/nestjs/src/common/guards/features.guard.ts +38 -0
- package/nestjs/src/common/guards/index.ts +5 -0
- package/nestjs/src/common/guards/jwt-auth.guard.ts +54 -0
- package/nestjs/src/common/guards/permissions.guard.ts +50 -0
- package/nestjs/src/common/guards/superadmin.guard.ts +35 -0
- package/nestjs/src/common/interceptors/request-context.interceptor.ts +32 -0
- package/nestjs/src/common/interceptors/superadmin-tenant.interceptor.ts +42 -0
- package/nestjs/src/common/interfaces/jwt-payload.interface.ts +11 -0
- package/nestjs/src/config/config.module.ts +13 -0
- package/nestjs/src/database/database.module.ts +9 -0
- package/nestjs/src/database/prisma.service.ts +20 -0
- package/nestjs/src/database/tenant-context.ts +27 -0
- package/nestjs/src/google-calendar/google-calendar.controller.ts +259 -0
- package/nestjs/src/google-calendar/google-calendar.module.ts +10 -0
- package/nestjs/src/google-calendar/google-calendar.service.ts +811 -0
- package/nestjs/src/integrations/ai/ai.interface.ts +74 -0
- package/nestjs/src/integrations/ai/ai.module.ts +11 -0
- package/nestjs/src/integrations/ai/ai.service.ts +148 -0
- package/nestjs/src/integrations/ai/providers/anthropic.provider.ts +146 -0
- package/nestjs/src/integrations/ai/providers/openai.provider.ts +158 -0
- package/nestjs/src/integrations/elevenlabs/elevenlabs.module.ts +8 -0
- package/nestjs/src/integrations/elevenlabs/elevenlabs.service.ts +226 -0
- package/nestjs/src/integrations/encryption/encryption.module.ts +9 -0
- package/nestjs/src/integrations/encryption/encryption.service.ts +31 -0
- package/nestjs/src/integrations/image/image.module.ts +9 -0
- package/nestjs/src/integrations/image/image.service.ts +61 -0
- package/nestjs/src/integrations/meta-business/meta-business.module.ts +10 -0
- package/nestjs/src/integrations/meta-business/meta-instagram.service.ts +94 -0
- package/nestjs/src/integrations/meta-business/meta-webhook.service.ts +52 -0
- package/nestjs/src/integrations/meta-business/meta-whatsapp.service.ts +254 -0
- package/nestjs/src/integrations/minio/minio.module.ts +9 -0
- package/nestjs/src/integrations/minio/minio.service.ts +88 -0
- package/nestjs/src/integrations/netgsm/netgsm.module.ts +8 -0
- package/nestjs/src/integrations/netgsm/netgsm.service.ts +17 -0
- package/nestjs/src/integrations/tektippay/tektippay.module.ts +8 -0
- package/nestjs/src/integrations/tektippay/tektippay.service.ts +23 -0
- package/nestjs/src/leads/dto/index.ts +2 -0
- package/nestjs/src/leads/dto/query-leads.dto.ts +50 -0
- package/nestjs/src/leads/dto/update-lead.dto.ts +26 -0
- package/nestjs/src/leads/leads.controller.ts +184 -0
- package/nestjs/src/leads/leads.module.ts +10 -0
- package/nestjs/src/leads/leads.service.ts +375 -0
- package/nestjs/src/logging/logging.controller.ts +82 -0
- package/nestjs/src/logging/logging.module.ts +11 -0
- package/nestjs/src/logging/logging.service.ts +180 -0
- package/nestjs/src/main.ts +86 -0
- package/nestjs/src/outbound-campaigns/dto/create-campaign.dto.ts +47 -0
- package/nestjs/src/outbound-campaigns/dto/index.ts +3 -0
- package/nestjs/src/outbound-campaigns/dto/update-campaign.dto.ts +31 -0
- package/nestjs/src/outbound-campaigns/dto/upload-entries.dto.ts +35 -0
- package/nestjs/src/outbound-campaigns/outbound-campaigns.controller.ts +307 -0
- package/nestjs/src/outbound-campaigns/outbound-campaigns.module.ts +13 -0
- package/nestjs/src/outbound-campaigns/outbound-campaigns.service.ts +471 -0
- package/nestjs/src/outbound-campaigns/processors/campaign-dispatch.processor.ts +366 -0
- package/nestjs/src/patients/documents.service.ts +231 -0
- package/nestjs/src/patients/dto/create-examination.dto.ts +34 -0
- package/nestjs/src/patients/dto/create-note.dto.ts +14 -0
- package/nestjs/src/patients/dto/create-patient.dto.ts +86 -0
- package/nestjs/src/patients/dto/create-photo-set.dto.ts +32 -0
- package/nestjs/src/patients/dto/index.ts +10 -0
- package/nestjs/src/patients/dto/update-examination.dto.ts +29 -0
- package/nestjs/src/patients/dto/update-medical-history.dto.ts +47 -0
- package/nestjs/src/patients/dto/update-patient.dto.ts +87 -0
- package/nestjs/src/patients/dto/update-photo-set.dto.ts +28 -0
- package/nestjs/src/patients/dto/upload-document.dto.ts +31 -0
- package/nestjs/src/patients/dto/upload-photo.dto.ts +27 -0
- package/nestjs/src/patients/examinations.service.ts +271 -0
- package/nestjs/src/patients/medical-history.service.ts +149 -0
- package/nestjs/src/patients/notes.service.ts +172 -0
- package/nestjs/src/patients/patients.controller.ts +485 -0
- package/nestjs/src/patients/patients.module.ts +22 -0
- package/nestjs/src/patients/patients.service.ts +412 -0
- package/nestjs/src/patients/photo-sets.service.ts +389 -0
- package/nestjs/src/phone-numbers/dto/create-phone-number.dto.ts +57 -0
- package/nestjs/src/phone-numbers/dto/index.ts +3 -0
- package/nestjs/src/phone-numbers/dto/update-phone-number.dto.ts +38 -0
- package/nestjs/src/phone-numbers/dto/update-schedule.dto.ts +39 -0
- package/nestjs/src/phone-numbers/phone-numbers.controller.ts +125 -0
- package/nestjs/src/phone-numbers/phone-numbers.module.ts +10 -0
- package/nestjs/src/phone-numbers/phone-numbers.service.ts +209 -0
- package/nestjs/src/plans/dto/create-plan.dto.ts +70 -0
- package/nestjs/src/plans/dto/index.ts +2 -0
- package/nestjs/src/plans/dto/update-plan.dto.ts +80 -0
- package/nestjs/src/plans/plans.controller.ts +50 -0
- package/nestjs/src/plans/plans.module.ts +10 -0
- package/nestjs/src/plans/plans.service.ts +115 -0
- package/nestjs/src/platform/dto/create-tenant.dto.ts +36 -0
- package/nestjs/src/platform/dto/index.ts +2 -0
- package/nestjs/src/platform/dto/update-tenant-platform.dto.ts +44 -0
- package/nestjs/src/platform/platform.controller.ts +79 -0
- package/nestjs/src/platform/platform.module.ts +10 -0
- package/nestjs/src/platform/platform.service.ts +301 -0
- package/nestjs/src/queue/queue.module.ts +56 -0
- package/nestjs/src/redis/redis.module.ts +20 -0
- package/nestjs/src/tenants/dto/index.ts +1 -0
- package/nestjs/src/tenants/dto/update-tenant.dto.ts +15 -0
- package/nestjs/src/tenants/tenants.controller.ts +45 -0
- package/nestjs/src/tenants/tenants.module.ts +10 -0
- package/nestjs/src/tenants/tenants.service.ts +41 -0
- package/nestjs/src/tools/adapters/elevenlabs-http.adapter.ts +51 -0
- package/nestjs/src/tools/adapters/elevenlabs-ws.adapter.ts +59 -0
- package/nestjs/src/tools/handlers/calendar.tools.ts +441 -0
- package/nestjs/src/tools/handlers/notification.tools.ts +34 -0
- package/nestjs/src/tools/handlers/operator.tools.ts +303 -0
- package/nestjs/src/tools/handlers/patient.tools.ts +242 -0
- package/nestjs/src/tools/handlers/payment.tools.ts +43 -0
- package/nestjs/src/tools/handlers/validation.tools.ts +152 -0
- package/nestjs/src/tools/tool-registry.service.ts +221 -0
- package/nestjs/src/tools/tool.decorator.ts +16 -0
- package/nestjs/src/tools/tool.interfaces.ts +26 -0
- package/nestjs/src/tools/tools.module.ts +50 -0
- package/nestjs/src/treatments/dto/create-plan-item.dto.ts +27 -0
- package/nestjs/src/treatments/dto/create-treatment-plan.dto.ts +69 -0
- package/nestjs/src/treatments/dto/create-treatment.dto.ts +59 -0
- package/nestjs/src/treatments/dto/index.ts +6 -0
- package/nestjs/src/treatments/dto/update-plan-item.dto.ts +23 -0
- package/nestjs/src/treatments/dto/update-treatment-plan.dto.ts +22 -0
- package/nestjs/src/treatments/dto/update-treatment.dto.ts +70 -0
- package/nestjs/src/treatments/treatment-plans.service.ts +362 -0
- package/nestjs/src/treatments/treatments.controller.ts +265 -0
- package/nestjs/src/treatments/treatments.module.ts +14 -0
- package/nestjs/src/treatments/treatments.service.ts +165 -0
- package/nestjs/src/users/doctor-profiles.service.ts +202 -0
- package/nestjs/src/users/dto/index.ts +4 -0
- package/nestjs/src/users/dto/invite-user.dto.ts +52 -0
- package/nestjs/src/users/dto/update-clinic-assignments.dto.ts +9 -0
- package/nestjs/src/users/dto/update-doctor-profile.dto.ts +49 -0
- package/nestjs/src/users/dto/update-user.dto.ts +41 -0
- package/nestjs/src/users/users.controller.ts +142 -0
- package/nestjs/src/users/users.module.ts +11 -0
- package/nestjs/src/users/users.service.ts +250 -0
- package/nestjs/src/webhooks/elevenlabs-tool.controller.ts +66 -0
- package/nestjs/src/webhooks/elevenlabs-webhook.controller.ts +60 -0
- package/nestjs/src/webhooks/meta-webhook.controller.ts +178 -0
- package/nestjs/src/webhooks/processors/elevenlabs-webhook.processor.ts +28 -0
- package/nestjs/src/webhooks/webhooks.module.ts +17 -0
- package/nestjs/src/whatsapp/chat-context.service.ts +281 -0
- package/nestjs/src/whatsapp/dto/add-blacklist.dto.ts +13 -0
- package/nestjs/src/whatsapp/dto/index.ts +2 -0
- package/nestjs/src/whatsapp/dto/send-message.dto.ts +14 -0
- package/nestjs/src/whatsapp/listeners/meta-message.listener.ts +579 -0
- package/nestjs/src/whatsapp/meta-auth.controller.ts +268 -0
- package/nestjs/src/whatsapp/meta-instagram-auth.controller.ts +244 -0
- package/nestjs/src/whatsapp/operator.service.ts +692 -0
- package/nestjs/src/whatsapp/processors/cost-sweep.processor.ts +130 -0
- package/nestjs/src/whatsapp/processors/grace.processor.ts +191 -0
- package/nestjs/src/whatsapp/processors/message-buffer.processor.ts +138 -0
- package/nestjs/src/whatsapp/processors/message-cleanup.processor.ts +148 -0
- package/nestjs/src/whatsapp/processors/meta-token-refresh.processor.ts +114 -0
- package/nestjs/src/whatsapp/processors/operator-expiry.processor.ts +105 -0
- package/nestjs/src/whatsapp/processors/profile-update.processor.ts +234 -0
- package/nestjs/src/whatsapp/processors/session-cleanup.processor.ts +178 -0
- package/nestjs/src/whatsapp/processors/session-labels.processor.ts +248 -0
- package/nestjs/src/whatsapp/whatsapp-agent.service.ts +2506 -0
- package/nestjs/src/whatsapp/whatsapp-recovery.service.ts +117 -0
- package/nestjs/src/whatsapp/whatsapp.controller.ts +398 -0
- package/nestjs/src/whatsapp/whatsapp.module.ts +51 -0
- package/nestjs/src/whatsapp/whatsapp.service.ts +592 -0
- package/nestjs/test/app.e2e-spec.ts +25 -0
- package/nestjs/test/jest-e2e.json +9 -0
- package/nestjs/tsconfig.build.json +4 -0
- package/nestjs/tsconfig.json +25 -0
- package/nginx.example.conf +18 -0
- package/package.json +47 -0
- package/scripts/addRecipient.ts +48 -0
- package/scripts/listRecipients.ts +31 -0
- package/scripts/migrate-agent-ref.ts +86 -0
- package/scripts/migrate-sessions.ts +183 -0
- package/scripts/promote.ts +27 -0
- package/scripts/retrigger.ts +84 -0
- package/scripts/seed.ts +435 -0
- package/scripts/testSend.ts +63 -0
- package/src/app.ts +85 -0
- package/src/config/agentPrompts.json +19 -0
- package/src/config/database.ts +21 -0
- package/src/config/env.ts +94 -0
- package/src/config/index.ts +86 -0
- package/src/controllers/webhook.controller.ts +150 -0
- package/src/errors/index.ts +9 -0
- package/src/hooks/webhookValidator.ts +55 -0
- package/src/index.ts +68 -0
- package/src/migrations/001_session-architecture.ts +138 -0
- package/src/migrations/002_agent-ref.ts +65 -0
- package/src/migrations/003_shift-schedule.ts +55 -0
- package/src/migrations/004_invert-shift-to-clinic-hours.ts +30 -0
- package/src/migrations/005_composite-baileys-chat-ids.ts +60 -0
- package/src/migrations/migration.model.ts +27 -0
- package/src/migrations/migration.routes.ts +40 -0
- package/src/migrations/migration.runner.ts +112 -0
- package/src/models/ConversationClaim.ts +17 -0
- package/src/models/ConversationEvaluation.ts +91 -0
- package/src/models/Summary.ts +77 -0
- package/src/models/Transcription.ts +68 -0
- package/src/models/WhatsAppRecipient.ts +37 -0
- package/src/modules/admin/admin.routes.ts +2385 -0
- package/src/modules/admin/elevenlabs-test-chat.routes.ts +193 -0
- package/src/modules/admin/whatsapp-test-chat.routes.ts +244 -0
- package/src/modules/agents/agent.model.ts +93 -0
- package/src/modules/agents/agent.routes.ts +65 -0
- package/src/modules/appointment-validation/appointment-validation.model.ts +163 -0
- package/src/modules/appointment-validation/appointment-validation.routes.ts +275 -0
- package/src/modules/appointment-validation/appointment-validation.service.ts +1028 -0
- package/src/modules/auth/auth.model.ts +42 -0
- package/src/modules/auth/auth.routes.ts +199 -0
- package/src/modules/auth/auth.service.ts +210 -0
- package/src/modules/auth/refresh-token.model.ts +26 -0
- package/src/modules/billing/billing-alert.model.ts +28 -0
- package/src/modules/billing/billing-period-snapshot.model.ts +68 -0
- package/src/modules/billing/billing.model.ts +42 -0
- package/src/modules/billing/billing.routes.ts +67 -0
- package/src/modules/billing/billing.service.ts +562 -0
- package/src/modules/billing/payment.model.ts +42 -0
- package/src/modules/calls/call.model.ts +102 -0
- package/src/modules/calls/call.routes.ts +118 -0
- package/src/modules/campaigns/campaign.model.ts +111 -0
- package/src/modules/campaigns/campaign.routes.ts +402 -0
- package/src/modules/campaigns/campaign.service.ts +99 -0
- package/src/modules/google-calendar/google-calendar.routes.ts +31 -0
- package/src/modules/inbound-call/inbound-call-config.model.ts +49 -0
- package/src/modules/inbound-call/inbound-call.routes.ts +289 -0
- package/src/modules/leads/lead.model.ts +40 -0
- package/src/modules/leads/lead.routes.ts +246 -0
- package/src/modules/logs/log.model.ts +27 -0
- package/src/modules/logs/log.routes.ts +102 -0
- package/src/modules/plans/plan.model.ts +45 -0
- package/src/modules/surveys/survey.model.ts +70 -0
- package/src/modules/surveys/survey.routes.ts +187 -0
- package/src/modules/tenants/tenant.model.ts +181 -0
- package/src/modules/tenants/tenant.routes.ts +78 -0
- package/src/modules/users/user.routes.ts +126 -0
- package/src/modules/webhooks/elevenlabs-tool.routes.ts +94 -0
- package/src/modules/webhooks/elevenlabs-tool.service.ts +491 -0
- package/src/modules/webhooks/elevenlabs.routes.ts +34 -0
- package/src/modules/webhooks/elevenlabs.service.ts +565 -0
- package/src/modules/webhooks/unipile.routes.ts +917 -0
- package/src/modules/whatsapp/appointment.model.ts +47 -0
- package/src/modules/whatsapp/operator-request.model.ts +58 -0
- package/src/modules/whatsapp/stt-usage.model.ts +30 -0
- package/src/modules/whatsapp/whatsapp-chat.model.ts +39 -0
- package/src/modules/whatsapp/whatsapp-contact-profile.model.ts +41 -0
- package/src/modules/whatsapp/whatsapp-message.model.ts +41 -0
- package/src/modules/whatsapp/whatsapp-session.model.ts +60 -0
- package/src/modules/whatsapp/whatsapp.routes.ts +1435 -0
- package/src/plugins/cors.ts +7 -0
- package/src/plugins/jwt.ts +18 -0
- package/src/plugins/rawBody.ts +12 -0
- package/src/plugins/rbac.ts +24 -0
- package/src/routes/admin.routes.ts +208 -0
- package/src/routes/health.routes.ts +12 -0
- package/src/routes/webhook.routes.ts +12 -0
- package/src/services/ai/base.ai.ts +132 -0
- package/src/services/ai/gemini.service.ts +41 -0
- package/src/services/ai/index.ts +24 -0
- package/src/services/ai/openai.service.ts +48 -0
- package/src/services/elevenlabs.service.ts +532 -0
- package/src/services/google-calendar.service.ts +656 -0
- package/src/services/inbound-call-schedule.service.ts +174 -0
- package/src/services/netgsm.service.ts +128 -0
- package/src/services/unipile.service.ts +200 -0
- package/src/services/whatsapp-agent.service.ts +2479 -0
- package/src/services/whatsapp.service.ts +245 -0
- package/src/templates/index.ts +71 -0
- package/src/templates/receptionist.ts +44 -0
- package/src/templates/survey.ts +44 -0
- package/src/types/index.ts +218 -0
- package/src/utils/logger.ts +83 -0
- package/tsconfig.json +19 -0
- package/web/.dockerignore +4 -0
- package/web/Dockerfile +18 -0
- package/web/README.md +73 -0
- package/web/components.json +23 -0
- package/web/eslint.config.js +23 -0
- package/web/index.html +14 -0
- package/web/nginx.conf +18 -0
- package/web/package-lock.json +10292 -0
- package/web/package.json +48 -0
- package/web/public/favicon.ico +0 -0
- package/web/public/vite.svg +1 -0
- package/web/src/App.tsx +191 -0
- package/web/src/assets/react.svg +1 -0
- package/web/src/components/Layout.tsx +261 -0
- package/web/src/components/LeadConversation.tsx +251 -0
- package/web/src/components/ProtectedRoute.tsx +20 -0
- package/web/src/components/conversation-review/CardAudioPlayer.tsx +200 -0
- package/web/src/components/conversation-review/CardEvaluation.tsx +351 -0
- package/web/src/components/conversation-review/CardMetadata.tsx +44 -0
- package/web/src/components/conversation-review/ConversationCard.tsx +95 -0
- package/web/src/components/conversation-review/ReviewContainer.tsx +120 -0
- package/web/src/components/conversation-review/ReviewFilters.tsx +88 -0
- package/web/src/components/empty-state.tsx +15 -0
- package/web/src/components/page-header.tsx +19 -0
- package/web/src/components/page-loader.tsx +32 -0
- package/web/src/components/pagination.tsx +38 -0
- package/web/src/components/stat-card.tsx +27 -0
- package/web/src/components/status-badge.tsx +125 -0
- package/web/src/components/ui/alert.tsx +66 -0
- package/web/src/components/ui/badge.tsx +48 -0
- package/web/src/components/ui/button.tsx +64 -0
- package/web/src/components/ui/card.tsx +92 -0
- package/web/src/components/ui/checkbox.tsx +32 -0
- package/web/src/components/ui/dialog.tsx +158 -0
- package/web/src/components/ui/dropdown-menu.tsx +255 -0
- package/web/src/components/ui/input.tsx +21 -0
- package/web/src/components/ui/label.tsx +22 -0
- package/web/src/components/ui/progress.tsx +29 -0
- package/web/src/components/ui/select.tsx +188 -0
- package/web/src/components/ui/separator.tsx +28 -0
- package/web/src/components/ui/sheet.tsx +123 -0
- package/web/src/components/ui/skeleton.tsx +13 -0
- package/web/src/components/ui/sonner.tsx +35 -0
- package/web/src/components/ui/table.tsx +116 -0
- package/web/src/components/ui/tabs.tsx +89 -0
- package/web/src/components/ui/textarea.tsx +18 -0
- package/web/src/components/ui/tooltip.tsx +57 -0
- package/web/src/components/whatsapp/ChatDetail.tsx +417 -0
- package/web/src/components/whatsapp/ChatHeader.tsx +78 -0
- package/web/src/components/whatsapp/ChatList.tsx +107 -0
- package/web/src/components/whatsapp/ChatListItem.tsx +60 -0
- package/web/src/components/whatsapp/MessageBubble.tsx +46 -0
- package/web/src/components/whatsapp/MessageInput.tsx +63 -0
- package/web/src/components/whatsapp/MessageStream.tsx +135 -0
- package/web/src/components/whatsapp/SessionDivider.tsx +65 -0
- package/web/src/components/whatsapp/SessionHistory.tsx +119 -0
- package/web/src/components/whatsapp/settings/AiSettingsTab.tsx +268 -0
- package/web/src/components/whatsapp/settings/CalendarTab.tsx +339 -0
- package/web/src/components/whatsapp/settings/ConnectionTab.tsx +236 -0
- package/web/src/components/whatsapp/settings/NotificationsTab.tsx +109 -0
- package/web/src/components/whatsapp/settings/OperatorTab.tsx +303 -0
- package/web/src/contexts/AuthContext.tsx +103 -0
- package/web/src/index.css +130 -0
- package/web/src/lib/api.ts +92 -0
- package/web/src/lib/utils.ts +6 -0
- package/web/src/main.tsx +10 -0
- package/web/src/pages/AppointmentDetail.tsx +206 -0
- package/web/src/pages/AppointmentValidation.tsx +157 -0
- package/web/src/pages/AppointmentValidationDetail.tsx +617 -0
- package/web/src/pages/AppointmentValidationNew.tsx +1005 -0
- package/web/src/pages/Appointments.tsx +283 -0
- package/web/src/pages/Billing.tsx +126 -0
- package/web/src/pages/CallDetail.tsx +293 -0
- package/web/src/pages/CallSettings.tsx +313 -0
- package/web/src/pages/Calls.tsx +188 -0
- package/web/src/pages/CampaignDetail.tsx +216 -0
- package/web/src/pages/CampaignNew.tsx +277 -0
- package/web/src/pages/CampaignResults.tsx +185 -0
- package/web/src/pages/Campaigns.tsx +171 -0
- package/web/src/pages/Dashboard.tsx +336 -0
- package/web/src/pages/InboundSchedule.tsx +246 -0
- package/web/src/pages/LeadDetail.tsx +183 -0
- package/web/src/pages/Leads.tsx +258 -0
- package/web/src/pages/Login.tsx +99 -0
- package/web/src/pages/Register.tsx +129 -0
- package/web/src/pages/Settings.tsx +133 -0
- package/web/src/pages/SurveyDetail.tsx +232 -0
- package/web/src/pages/SurveyPreview.tsx +179 -0
- package/web/src/pages/Surveys.tsx +207 -0
- package/web/src/pages/Users.tsx +199 -0
- package/web/src/pages/WhatsApp.tsx +147 -0
- package/web/src/pages/WhatsAppSettings.tsx +215 -0
- package/web/src/pages/admin/AdminBaileysMessageLog.tsx +331 -0
- package/web/src/pages/admin/AdminBaileysRawMessages.tsx +318 -0
- package/web/src/pages/admin/AdminConversationReview.tsx +116 -0
- package/web/src/pages/admin/AdminCredits.tsx +467 -0
- package/web/src/pages/admin/AdminElevenLabsAgentDetail.tsx +332 -0
- package/web/src/pages/admin/AdminElevenLabsAgents.tsx +164 -0
- package/web/src/pages/admin/AdminElevenLabsBatchCallDetail.tsx +214 -0
- package/web/src/pages/admin/AdminElevenLabsBatchCalls.tsx +293 -0
- package/web/src/pages/admin/AdminElevenLabsConversationDetail.tsx +230 -0
- package/web/src/pages/admin/AdminElevenLabsConversations.tsx +228 -0
- package/web/src/pages/admin/AdminElevenLabsInboundCalls.tsx +293 -0
- package/web/src/pages/admin/AdminElevenLabsPhoneNumbers.tsx +506 -0
- package/web/src/pages/admin/AdminElevenLabsTestChat.tsx +258 -0
- package/web/src/pages/admin/AdminElevenLabsWebhooks.tsx +289 -0
- package/web/src/pages/admin/AdminEvaluationDashboard.tsx +520 -0
- package/web/src/pages/admin/AdminLeads.tsx +339 -0
- package/web/src/pages/admin/AdminLogs.tsx +283 -0
- package/web/src/pages/admin/AdminMigrations.tsx +247 -0
- package/web/src/pages/admin/AdminPlans.tsx +313 -0
- package/web/src/pages/admin/AdminSystem.tsx +391 -0
- package/web/src/pages/admin/AdminTenantBillableItems.tsx +464 -0
- package/web/src/pages/admin/AdminTenantDetail.tsx +1317 -0
- package/web/src/pages/admin/AdminTenants.tsx +274 -0
- package/web/src/pages/admin/AdminWhatsApp.tsx +618 -0
- package/web/src/pages/admin/AdminWhatsAppTestChat.tsx +328 -0
- package/web/src/types/index.ts +242 -0
- package/web/tsconfig.app.json +32 -0
- package/web/tsconfig.json +13 -0
- package/web/tsconfig.node.json +26 -0
- package/web/vite.config.ts +23 -0
|
@@ -0,0 +1,1171 @@
|
|
|
1
|
+
# ElevenLabs Conversational AI API Reference
|
|
2
|
+
|
|
3
|
+
> Extracted from [ElevenLabs Documentation](https://elevenlabs.io/docs/api-reference)
|
|
4
|
+
> Base URL: `https://api.elevenlabs.io`
|
|
5
|
+
|
|
6
|
+
## Table of Contents
|
|
7
|
+
|
|
8
|
+
- [Authentication](#authentication)
|
|
9
|
+
- [Agents](#agents)
|
|
10
|
+
- [List Agents](#list-agents)
|
|
11
|
+
- [Create Agent](#create-agent)
|
|
12
|
+
- [Get Agent](#get-agent)
|
|
13
|
+
- [Update Agent](#update-agent)
|
|
14
|
+
- [Delete Agent](#delete-agent)
|
|
15
|
+
- [Get Agent Link](#get-agent-link)
|
|
16
|
+
- [Simulate Conversation](#simulate-conversation)
|
|
17
|
+
- [Stream Simulate Conversation](#stream-simulate-conversation)
|
|
18
|
+
- [Calculate LLM Usage](#calculate-llm-usage)
|
|
19
|
+
- [Conversations](#conversations)
|
|
20
|
+
- [List Conversations](#list-conversations)
|
|
21
|
+
- [Get Conversation Details](#get-conversation-details)
|
|
22
|
+
- [Delete Conversation](#delete-conversation)
|
|
23
|
+
- [Get Conversation Audio](#get-conversation-audio)
|
|
24
|
+
- [Send Conversation Feedback](#send-conversation-feedback)
|
|
25
|
+
- [Get Conversation Token (WebRTC)](#get-conversation-token-webrtc)
|
|
26
|
+
- [Get Signed URL](#get-signed-url)
|
|
27
|
+
- [Batch Calling](#batch-calling)
|
|
28
|
+
- [Submit Batch Calling Job](#submit-batch-calling-job)
|
|
29
|
+
- [List Workspace Batch Calling Jobs](#list-workspace-batch-calling-jobs)
|
|
30
|
+
- [Get Batch Call Information](#get-batch-call-information)
|
|
31
|
+
- [Cancel Batch Calling Job](#cancel-batch-calling-job)
|
|
32
|
+
- [Retry Batch Calling Job](#retry-batch-calling-job)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Authentication
|
|
37
|
+
|
|
38
|
+
All endpoints accept an optional `xi-api-key` header for authentication.
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
xi-api-key: YOUR_API_KEY
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Agents
|
|
47
|
+
|
|
48
|
+
### List Agents
|
|
49
|
+
|
|
50
|
+
Returns a list of your agents and their metadata.
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
GET /v1/convai/agents
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### Query Parameters
|
|
57
|
+
|
|
58
|
+
| Parameter | Type | Required | Default | Description |
|
|
59
|
+
|-----------|------|----------|---------|-------------|
|
|
60
|
+
| `page_size` | integer | No | 30 | Maximum agents to return (max 100) |
|
|
61
|
+
| `search` | string | No | — | Filter agents by name |
|
|
62
|
+
| `archived` | boolean | No | — | Filter by archived status |
|
|
63
|
+
| `show_only_owned_agents` | boolean | No | false | Omit agents shared with you by others |
|
|
64
|
+
| `sort_direction` | string | No | — | `asc` or `desc` |
|
|
65
|
+
| `sort_by` | string | No | — | `name` or `created_at` |
|
|
66
|
+
| `cursor` | string | No | — | Pagination cursor from previous response |
|
|
67
|
+
|
|
68
|
+
#### Response `200`
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"agents": [
|
|
73
|
+
{
|
|
74
|
+
"agent_id": "string",
|
|
75
|
+
"name": "string",
|
|
76
|
+
"tags": ["string"],
|
|
77
|
+
"created_at_unix_secs": 0,
|
|
78
|
+
"access_info": {
|
|
79
|
+
"is_creator": true,
|
|
80
|
+
"creator_name": "string",
|
|
81
|
+
"creator_email": "string",
|
|
82
|
+
"role": "admin | editor | commenter | viewer"
|
|
83
|
+
},
|
|
84
|
+
"last_call_time_unix_secs": 0,
|
|
85
|
+
"archived": false
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"next_cursor": "string",
|
|
89
|
+
"has_more": false
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### Create Agent
|
|
96
|
+
|
|
97
|
+
Create an agent from a config object.
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
POST /v1/convai/agents/create
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### Request Body
|
|
104
|
+
|
|
105
|
+
| Field | Type | Required | Description |
|
|
106
|
+
|-------|------|----------|-------------|
|
|
107
|
+
| `conversation_config` | ConversationalConfig | **Yes** | Conversation configuration for the agent |
|
|
108
|
+
| `platform_settings` | AgentPlatformSettings | No | Non-conversation platform settings |
|
|
109
|
+
| `workflow` | AgentWorkflow | No | Conversation flow definition |
|
|
110
|
+
| `name` | string | No | Agent name for easier discovery |
|
|
111
|
+
| `tags` | string[] | No | Classification and filtering tags |
|
|
112
|
+
|
|
113
|
+
#### ConversationalConfig
|
|
114
|
+
|
|
115
|
+
| Field | Type | Description |
|
|
116
|
+
|-------|------|-------------|
|
|
117
|
+
| `asr` | AsrConversationalConfig | Transcription: provider, quality, audio format, keywords |
|
|
118
|
+
| `turn` | TurnConfig | Turn detection: timeout, eagerness, spelling patience |
|
|
119
|
+
| `tts` | TtsConversationalConfig | TTS: model, voice, stability, speed, similarity |
|
|
120
|
+
| `conversation` | ConversationConfig | Event config, monitoring, max duration |
|
|
121
|
+
| `language_presets` | object | Language-specific overrides |
|
|
122
|
+
| `vad` | VadConfig | Voice activity detection |
|
|
123
|
+
| `agent` | AgentConfig | First message, language, prompt, dynamic variables |
|
|
124
|
+
|
|
125
|
+
#### AgentConfig
|
|
126
|
+
|
|
127
|
+
| Field | Type | Default | Description |
|
|
128
|
+
|-------|------|---------|-------------|
|
|
129
|
+
| `first_message` | string | `""` | Initial agent greeting |
|
|
130
|
+
| `language` | string | `"en"` | Language for ASR and TTS |
|
|
131
|
+
| `hinglish_mode` | boolean | `false` | Hindi-English mixed mode |
|
|
132
|
+
| `dynamic_variables` | DynamicVariablesConfig | — | Runtime variable placeholders |
|
|
133
|
+
| `disable_first_message_interruptions` | boolean | `false` | Prevent interruptions during greeting |
|
|
134
|
+
| `prompt` | PromptAgentConfig | — | LLM prompt and tool configuration |
|
|
135
|
+
|
|
136
|
+
#### PromptAgentConfig
|
|
137
|
+
|
|
138
|
+
| Field | Type | Default | Description |
|
|
139
|
+
|-------|------|---------|-------------|
|
|
140
|
+
| `prompt` | string | — | Agent system prompt |
|
|
141
|
+
| `llm` | enum | — | Model: `gpt-4o`, `gpt-4o-mini`, `claude-sonnet-4`, `gemini-2.5-flash`, etc. |
|
|
142
|
+
| `temperature` | number | `0` | LLM response randomness |
|
|
143
|
+
| `max_tokens` | integer | `-1` | Token limit (-1 = unlimited) |
|
|
144
|
+
| `tool_ids` | string[] | — | Custom tool references |
|
|
145
|
+
| `built_in_tools` | BuiltInTools | — | System tools: `end_call`, `transfer_to_agent`, etc. |
|
|
146
|
+
| `knowledge_base` | KnowledgeBaseLocator[] | — | Document sources |
|
|
147
|
+
| `custom_llm` | CustomLlm | — | Custom LLM endpoint configuration |
|
|
148
|
+
| `rag` | RagConfig | — | Retrieval-augmented generation settings |
|
|
149
|
+
|
|
150
|
+
#### Tool Types
|
|
151
|
+
|
|
152
|
+
Agents support multiple tool types via the `tools` array:
|
|
153
|
+
|
|
154
|
+
| Type | Description |
|
|
155
|
+
|------|-------------|
|
|
156
|
+
| `webhook` | Custom HTTP endpoints with request/response schemas |
|
|
157
|
+
| `client` | Browser/application-side operations |
|
|
158
|
+
| `system` | Built-in (call termination, transfers, DTMF) |
|
|
159
|
+
| `api_integration_webhook` | Pre-configured API integrations |
|
|
160
|
+
| `mcp` | Model Context Protocol servers |
|
|
161
|
+
|
|
162
|
+
Each tool includes:
|
|
163
|
+
- `response_timeout_secs` (integer, default: 20)
|
|
164
|
+
- `disable_interruptions` (boolean)
|
|
165
|
+
- `force_pre_tool_speech` (boolean)
|
|
166
|
+
- `execution_mode`: `immediate`, `post_tool_speech`, `async`
|
|
167
|
+
|
|
168
|
+
#### Platform Settings
|
|
169
|
+
|
|
170
|
+
| Field | Type | Description |
|
|
171
|
+
|-------|------|-------------|
|
|
172
|
+
| `evaluation` | EvaluationSettings | Conversation quality criteria |
|
|
173
|
+
| `widget` | WidgetConfig | Embedded UI: colors, placement, feedback |
|
|
174
|
+
| `data_collection` | object | Custom data fields |
|
|
175
|
+
| `auth` | AuthSettings | Token requirements and allowlists |
|
|
176
|
+
| `call_limits` | AgentCallLimits | Concurrency and daily caps |
|
|
177
|
+
| `privacy` | PrivacyConfig | Recording, retention, PII deletion |
|
|
178
|
+
|
|
179
|
+
#### Example Request
|
|
180
|
+
|
|
181
|
+
```json
|
|
182
|
+
{
|
|
183
|
+
"name": "Customer Support Agent",
|
|
184
|
+
"tags": ["support", "production"],
|
|
185
|
+
"conversation_config": {
|
|
186
|
+
"agent": {
|
|
187
|
+
"prompt": {
|
|
188
|
+
"prompt": "You are a helpful support agent",
|
|
189
|
+
"llm": "gpt-4o",
|
|
190
|
+
"temperature": 0.7
|
|
191
|
+
},
|
|
192
|
+
"first_message": "Hello! How can I assist you?",
|
|
193
|
+
"language": "en"
|
|
194
|
+
},
|
|
195
|
+
"tts": {
|
|
196
|
+
"model_id": "eleven_turbo_v2_5",
|
|
197
|
+
"voice_id": "cjVigY5qzO86Huf0OWal"
|
|
198
|
+
},
|
|
199
|
+
"turn": {
|
|
200
|
+
"turn_timeout": 7
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"platform_settings": {
|
|
204
|
+
"widget": {
|
|
205
|
+
"variant": "compact",
|
|
206
|
+
"placement": "bottom-right"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### Response `200`
|
|
213
|
+
|
|
214
|
+
Returns `CreateAgentResponseModel` with the created agent configuration plus:
|
|
215
|
+
- `agent_id`
|
|
216
|
+
- Creation timestamp
|
|
217
|
+
- Agent status
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### Get Agent
|
|
222
|
+
|
|
223
|
+
Retrieve config for an agent.
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
GET /v1/convai/agents/{agent_id}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
#### Path Parameters
|
|
230
|
+
|
|
231
|
+
| Parameter | Type | Required | Description |
|
|
232
|
+
|-----------|------|----------|-------------|
|
|
233
|
+
| `agent_id` | string | Yes | Agent ID (returned on creation) |
|
|
234
|
+
|
|
235
|
+
#### Response `200`
|
|
236
|
+
|
|
237
|
+
Returns `GetAgentResponseModel` containing:
|
|
238
|
+
|
|
239
|
+
| Field | Type | Description |
|
|
240
|
+
|-------|------|-------------|
|
|
241
|
+
| `agent_id` | string | Unique identifier |
|
|
242
|
+
| `agent_name` | string | Name of the agent |
|
|
243
|
+
| `created_at_unix_secs` | integer | Creation timestamp |
|
|
244
|
+
| `updated_at_unix_secs` | integer | Last update timestamp |
|
|
245
|
+
| `asr` | object | Speech recognition settings |
|
|
246
|
+
| `turn` | object | Turn detection settings |
|
|
247
|
+
| `tts` | object | Text-to-speech configuration |
|
|
248
|
+
| `conversation` | object | Event configuration and monitoring |
|
|
249
|
+
| `language_presets` | object | Language-specific overrides |
|
|
250
|
+
| `vad` | object | Voice activity detection config |
|
|
251
|
+
| `agent` | object | Agent settings (first message, language, prompt) |
|
|
252
|
+
| `prompt` | object | LLM configuration (model, temperature, tools) |
|
|
253
|
+
| `built_in_tools` | object | System tools (end_call, transfer_to_number, etc.) |
|
|
254
|
+
| `tools` | array | Custom webhook and client tools |
|
|
255
|
+
| `knowledge_base` | array | Referenced knowledge bases |
|
|
256
|
+
| `dynamic_variables` | object | Variable placeholder definitions |
|
|
257
|
+
| `widget` | object | Embed widget configuration |
|
|
258
|
+
| `evaluation` | object | Conversation evaluation criteria |
|
|
259
|
+
| `auth` | object | Authentication requirements |
|
|
260
|
+
| `call_limits` | object | Concurrency and daily limits |
|
|
261
|
+
| `privacy` | object | Recording and retention policies |
|
|
262
|
+
| `safety` | object | Safety evaluation settings |
|
|
263
|
+
| `phone_numbers` | array | Assigned phone numbers (SIP/Twilio) |
|
|
264
|
+
| `whatsapp_accounts` | array | WhatsApp business account assignments |
|
|
265
|
+
|
|
266
|
+
#### Example
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
curl -X GET "https://api.elevenlabs.io/v1/convai/agents/YOUR_AGENT_ID" \
|
|
270
|
+
-H "xi-api-key: YOUR_API_KEY"
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
### Update Agent
|
|
276
|
+
|
|
277
|
+
Patches an agent's settings. Accepts partial updates — only specified fields are modified.
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
PATCH /v1/convai/agents/{agent_id}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
#### Path Parameters
|
|
284
|
+
|
|
285
|
+
| Parameter | Type | Required | Description |
|
|
286
|
+
|-----------|------|----------|-------------|
|
|
287
|
+
| `agent_id` | string | Yes | Agent ID |
|
|
288
|
+
|
|
289
|
+
#### Request Body
|
|
290
|
+
|
|
291
|
+
| Field | Type | Required | Description |
|
|
292
|
+
|-------|------|----------|-------------|
|
|
293
|
+
| `conversation_config` | object | No | Conversation orchestration settings |
|
|
294
|
+
| `platform_settings` | object | No | Non-conversation configuration |
|
|
295
|
+
| `workflow` | object | No | Conversation flow and tool interaction logic |
|
|
296
|
+
| `name` | string | No | Agent name |
|
|
297
|
+
| `tags` | string[] | No | Classification tags |
|
|
298
|
+
| `version_description` | string | No | Change notes for versioned agents |
|
|
299
|
+
| `procedure_refs` | array | No | Procedure references for this version |
|
|
300
|
+
|
|
301
|
+
#### Response `200`
|
|
302
|
+
|
|
303
|
+
Returns full `GetAgentResponseModel` with complete agent state post-modification.
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
### Delete Agent
|
|
308
|
+
|
|
309
|
+
Delete an agent.
|
|
310
|
+
|
|
311
|
+
```
|
|
312
|
+
DELETE /v1/convai/agents/{agent_id}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
#### Path Parameters
|
|
316
|
+
|
|
317
|
+
| Parameter | Type | Required | Description |
|
|
318
|
+
|-----------|------|----------|-------------|
|
|
319
|
+
| `agent_id` | string | Yes | Agent ID |
|
|
320
|
+
|
|
321
|
+
#### Response `200`
|
|
322
|
+
|
|
323
|
+
Successful deletion (empty response).
|
|
324
|
+
|
|
325
|
+
#### Example
|
|
326
|
+
|
|
327
|
+
```typescript
|
|
328
|
+
// TypeScript
|
|
329
|
+
await client.conversationalAi.agents.delete("agent_3701k3ttaq12ewp8b7qv5rfyszkz");
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
```python
|
|
333
|
+
# Python
|
|
334
|
+
client.conversational_ai.agents.delete(agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz")
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
### Get Agent Link
|
|
340
|
+
|
|
341
|
+
Get the current link used to share the agent with others.
|
|
342
|
+
|
|
343
|
+
```
|
|
344
|
+
GET /v1/convai/agents/{agent_id}/link
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
#### Path Parameters
|
|
348
|
+
|
|
349
|
+
| Parameter | Type | Required | Description |
|
|
350
|
+
|-----------|------|----------|-------------|
|
|
351
|
+
| `agent_id` | string | Yes | Agent ID |
|
|
352
|
+
|
|
353
|
+
#### Response `200`
|
|
354
|
+
|
|
355
|
+
```json
|
|
356
|
+
{
|
|
357
|
+
"agent_id": "string",
|
|
358
|
+
"token": {
|
|
359
|
+
"agent_id": "string",
|
|
360
|
+
"conversation_token": "string",
|
|
361
|
+
"expiration_time_unix_secs": 0,
|
|
362
|
+
"conversation_id": "string",
|
|
363
|
+
"purpose": "signed_url | shareable_link",
|
|
364
|
+
"token_requester_user_id": "string"
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
#### Example
|
|
370
|
+
|
|
371
|
+
```typescript
|
|
372
|
+
await client.conversationalAi.agents.link.get("agent_3701k3ttaq12ewp8b7qv5rfyszkz");
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
### Simulate Conversation
|
|
378
|
+
|
|
379
|
+
Run a conversation between the agent and a simulated user.
|
|
380
|
+
|
|
381
|
+
```
|
|
382
|
+
POST /v1/convai/agents/{agent_id}/simulate-conversation
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
#### Path Parameters
|
|
386
|
+
|
|
387
|
+
| Parameter | Type | Required | Description |
|
|
388
|
+
|-----------|------|----------|-------------|
|
|
389
|
+
| `agent_id` | string | Yes | Agent ID |
|
|
390
|
+
|
|
391
|
+
#### Request Body
|
|
392
|
+
|
|
393
|
+
| Field | Type | Required | Description |
|
|
394
|
+
|-------|------|----------|-------------|
|
|
395
|
+
| `simulation_specification` | object | **Yes** | Simulation configuration |
|
|
396
|
+
| `simulation_specification.simulated_user_config` | AgentConfig | **Yes** | Simulated user behavior config |
|
|
397
|
+
| `simulation_specification.tool_mock_config` | object | No | Mock configurations for tools |
|
|
398
|
+
| `simulation_specification.partial_conversation_history` | array | No | Partial history to start from |
|
|
399
|
+
| `simulation_specification.dynamic_variables` | object | No | Dynamic variable values |
|
|
400
|
+
| `extra_evaluation_criteria` | array | No | Additional evaluation criteria |
|
|
401
|
+
| `new_turns_limit` | integer | No (default: 10000) | Maximum new turns to generate |
|
|
402
|
+
|
|
403
|
+
#### Tool Mock Config
|
|
404
|
+
|
|
405
|
+
```json
|
|
406
|
+
{
|
|
407
|
+
"tool_name": {
|
|
408
|
+
"default_return_value": "Tool Called.",
|
|
409
|
+
"default_is_error": false
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
#### Response `200`
|
|
415
|
+
|
|
416
|
+
```json
|
|
417
|
+
{
|
|
418
|
+
"simulated_conversation": [
|
|
419
|
+
{
|
|
420
|
+
"role": "user | agent",
|
|
421
|
+
"message": "string",
|
|
422
|
+
"time_in_call_secs": 0,
|
|
423
|
+
"tool_calls": [],
|
|
424
|
+
"tool_results": [],
|
|
425
|
+
"interrupted": false,
|
|
426
|
+
"llm_usage": {}
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
"analysis": {
|
|
430
|
+
"evaluation_criteria_results": {},
|
|
431
|
+
"data_collection_results": {},
|
|
432
|
+
"call_successful": "success | failure | unknown",
|
|
433
|
+
"transcript_summary": "string",
|
|
434
|
+
"call_summary_title": "string"
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
#### Example
|
|
440
|
+
|
|
441
|
+
```python
|
|
442
|
+
client.conversational_ai.agents.simulate_conversation(
|
|
443
|
+
agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
|
|
444
|
+
simulation_specification={
|
|
445
|
+
"simulated_user_config": {
|
|
446
|
+
"first_message": "Hello, how can I help?",
|
|
447
|
+
"language": "en"
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
)
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
### Stream Simulate Conversation
|
|
456
|
+
|
|
457
|
+
Run a conversation between the agent and a simulated user, streaming back the response. Responses are partial lists of messages that should be concatenated. A final message with conversation analysis is sent on completion.
|
|
458
|
+
|
|
459
|
+
```
|
|
460
|
+
POST /v1/convai/agents/{agent_id}/simulate-conversation/stream
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
#### Path Parameters
|
|
464
|
+
|
|
465
|
+
| Parameter | Type | Required | Description |
|
|
466
|
+
|-----------|------|----------|-------------|
|
|
467
|
+
| `agent_id` | string | Yes | Agent ID |
|
|
468
|
+
|
|
469
|
+
#### Request Body
|
|
470
|
+
|
|
471
|
+
Same as [Simulate Conversation](#simulate-conversation).
|
|
472
|
+
|
|
473
|
+
#### Response `200` (Streamed JSON)
|
|
474
|
+
|
|
475
|
+
Partial message lists followed by a final analysis message:
|
|
476
|
+
|
|
477
|
+
```json
|
|
478
|
+
{
|
|
479
|
+
"messages": [
|
|
480
|
+
{
|
|
481
|
+
"role": "user | agent",
|
|
482
|
+
"message": "string",
|
|
483
|
+
"time_in_call_secs": 0,
|
|
484
|
+
"tool_calls": [],
|
|
485
|
+
"tool_results": []
|
|
486
|
+
}
|
|
487
|
+
],
|
|
488
|
+
"conversation_analysis": {
|
|
489
|
+
"evaluation_results": [],
|
|
490
|
+
"metrics": {}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
#### Example
|
|
496
|
+
|
|
497
|
+
```typescript
|
|
498
|
+
await client.conversationalAi.agents.simulateConversationStream(
|
|
499
|
+
"agent_3701k3ttaq12ewp8b7qv5rfyszkz",
|
|
500
|
+
{
|
|
501
|
+
simulationSpecification: {
|
|
502
|
+
simulatedUserConfig: {
|
|
503
|
+
firstMessage: "Hello, how can I help you today?",
|
|
504
|
+
language: "en",
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
}
|
|
508
|
+
);
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
### Calculate LLM Usage
|
|
514
|
+
|
|
515
|
+
Calculates expected number of LLM tokens needed for the specified agent.
|
|
516
|
+
|
|
517
|
+
```
|
|
518
|
+
POST /v1/convai/agent/{agent_id}/llm-usage/calculate
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
#### Path Parameters
|
|
522
|
+
|
|
523
|
+
| Parameter | Type | Required | Description |
|
|
524
|
+
|-----------|------|----------|-------------|
|
|
525
|
+
| `agent_id` | string | Yes | Agent ID |
|
|
526
|
+
|
|
527
|
+
#### Request Body
|
|
528
|
+
|
|
529
|
+
| Field | Type | Description |
|
|
530
|
+
|-------|------|-------------|
|
|
531
|
+
| `prompt_length` | integer | Length of the prompt in characters |
|
|
532
|
+
| `number_of_pages` | integer | Pages of PDF content or URLs in Knowledge Base |
|
|
533
|
+
| `rag_enabled` | boolean | Whether RAG is enabled |
|
|
534
|
+
|
|
535
|
+
#### Response `200`
|
|
536
|
+
|
|
537
|
+
```json
|
|
538
|
+
{
|
|
539
|
+
"llm_prices": [
|
|
540
|
+
{
|
|
541
|
+
"llm": "gpt-4o | claude-sonnet-4 | gemini-2.5-flash | ...",
|
|
542
|
+
"price_per_minute": 0.0
|
|
543
|
+
}
|
|
544
|
+
]
|
|
545
|
+
}
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
---
|
|
549
|
+
|
|
550
|
+
## Conversations
|
|
551
|
+
|
|
552
|
+
### List Conversations
|
|
553
|
+
|
|
554
|
+
Get all conversations of agents that a user owns. With option to restrict to a specific agent.
|
|
555
|
+
|
|
556
|
+
```
|
|
557
|
+
GET /v1/convai/conversations
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
#### Query Parameters
|
|
561
|
+
|
|
562
|
+
| Parameter | Type | Required | Default | Description |
|
|
563
|
+
|-----------|------|----------|---------|-------------|
|
|
564
|
+
| `cursor` | string | No | — | Pagination cursor from previous response |
|
|
565
|
+
| `agent_id` | string | No | — | Filter by agent ID |
|
|
566
|
+
| `call_successful` | enum | No | — | `success`, `failure`, `unknown` |
|
|
567
|
+
| `call_start_before_unix` | integer | No | — | Filter conversations before this unix timestamp |
|
|
568
|
+
| `call_start_after_unix` | integer | No | — | Filter conversations after this unix timestamp |
|
|
569
|
+
| `call_duration_min_secs` | integer | No | — | Minimum call duration in seconds |
|
|
570
|
+
| `call_duration_max_secs` | integer | No | — | Maximum call duration in seconds |
|
|
571
|
+
| `rating_min` | integer | No | — | Minimum overall rating (1-5) |
|
|
572
|
+
| `rating_max` | integer | No | — | Maximum overall rating (1-5) |
|
|
573
|
+
| `has_feedback_comment` | boolean | No | — | Filter by presence of user feedback comments |
|
|
574
|
+
| `user_id` | string | No | — | Filter by initiating user ID |
|
|
575
|
+
| `evaluation_params` | string | No | — | Evaluation filters: `criteria_id:result` |
|
|
576
|
+
| `data_collection_params` | string | No | — | Data collection filters using operators: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `in`, `exists`, `missing` |
|
|
577
|
+
| `tool_names` | string | No | — | Filter by tool names used during the call |
|
|
578
|
+
| `main_languages` | string | No | — | Filter by detected main language code |
|
|
579
|
+
| `page_size` | integer | No | 30 | Max results (max 100) |
|
|
580
|
+
| `summary_mode` | enum | No | `exclude` | `exclude` or `include` transcript summaries |
|
|
581
|
+
| `search` | string | No | — | Full-text or fuzzy search over transcript messages |
|
|
582
|
+
| `conversation_initiation_source` | enum | No | — | Source: `unknown`, `android_sdk`, `node_js_sdk`, `react_native_sdk`, `react_sdk`, `js_sdk`, `python_sdk`, `widget`, `sip_trunk`, `twilio`, `genesys`, `swift_sdk`, `whatsapp`, `flutter_sdk`, `zendesk_integration`, `slack_integration` |
|
|
583
|
+
| `branch_id` | string | No | — | Filter by branch ID |
|
|
584
|
+
|
|
585
|
+
#### Response `200`
|
|
586
|
+
|
|
587
|
+
```json
|
|
588
|
+
{
|
|
589
|
+
"conversations": [
|
|
590
|
+
{
|
|
591
|
+
"agent_id": "string",
|
|
592
|
+
"branch_id": "string",
|
|
593
|
+
"version_id": "string",
|
|
594
|
+
"agent_name": "string",
|
|
595
|
+
"conversation_id": "string",
|
|
596
|
+
"start_time_unix_secs": 0,
|
|
597
|
+
"call_duration_secs": 0,
|
|
598
|
+
"message_count": 0,
|
|
599
|
+
"status": "initiated | in-progress | processing | done | failed",
|
|
600
|
+
"call_successful": "success | failure | unknown",
|
|
601
|
+
"transcript_summary": "string",
|
|
602
|
+
"call_summary_title": "string",
|
|
603
|
+
"direction": "inbound | outbound",
|
|
604
|
+
"rating": 0.0
|
|
605
|
+
}
|
|
606
|
+
],
|
|
607
|
+
"next_cursor": "string",
|
|
608
|
+
"has_more": false
|
|
609
|
+
}
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
#### Example
|
|
613
|
+
|
|
614
|
+
```typescript
|
|
615
|
+
await client.conversationalAi.conversations.list({
|
|
616
|
+
agentId: "agent_id",
|
|
617
|
+
pageSize: 30,
|
|
618
|
+
summaryMode: "exclude"
|
|
619
|
+
});
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
```python
|
|
623
|
+
client.conversational_ai.conversations.list(
|
|
624
|
+
agent_id="agent_id",
|
|
625
|
+
page_size=30,
|
|
626
|
+
summary_mode="exclude"
|
|
627
|
+
)
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
---
|
|
631
|
+
|
|
632
|
+
### Get Conversation Details
|
|
633
|
+
|
|
634
|
+
Get the details of a particular conversation.
|
|
635
|
+
|
|
636
|
+
```
|
|
637
|
+
GET /v1/convai/conversations/{conversation_id}
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
#### Path Parameters
|
|
641
|
+
|
|
642
|
+
| Parameter | Type | Required | Description |
|
|
643
|
+
|-----------|------|----------|-------------|
|
|
644
|
+
| `conversation_id` | string | Yes | Conversation ID |
|
|
645
|
+
|
|
646
|
+
#### Response `200`
|
|
647
|
+
|
|
648
|
+
```json
|
|
649
|
+
{
|
|
650
|
+
"agent_id": "string",
|
|
651
|
+
"agent_name": "string",
|
|
652
|
+
"conversation_id": "string",
|
|
653
|
+
"status": "initiated | in-progress | processing | done | failed",
|
|
654
|
+
"user_id": "string",
|
|
655
|
+
"branch_id": "string",
|
|
656
|
+
"version_id": "string",
|
|
657
|
+
"transcript": [
|
|
658
|
+
{
|
|
659
|
+
"role": "user | agent",
|
|
660
|
+
"message": "string",
|
|
661
|
+
"tool_calls": [],
|
|
662
|
+
"tool_results": [],
|
|
663
|
+
"feedback": {}
|
|
664
|
+
}
|
|
665
|
+
],
|
|
666
|
+
"metadata": {
|
|
667
|
+
"start_time": 0,
|
|
668
|
+
"duration": 0,
|
|
669
|
+
"cost": 0.0,
|
|
670
|
+
"deletion_settings": {},
|
|
671
|
+
"feedback": {},
|
|
672
|
+
"charging_details": {}
|
|
673
|
+
},
|
|
674
|
+
"analysis": {
|
|
675
|
+
"evaluation_criteria_results": {},
|
|
676
|
+
"data_collection_results": {},
|
|
677
|
+
"summaries": {}
|
|
678
|
+
},
|
|
679
|
+
"conversation_initiation_client_data": {
|
|
680
|
+
"config_overrides": {},
|
|
681
|
+
"dynamic_variables": {}
|
|
682
|
+
},
|
|
683
|
+
"has_audio": true,
|
|
684
|
+
"has_user_audio": true,
|
|
685
|
+
"has_response_audio": true
|
|
686
|
+
}
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
#### Example
|
|
690
|
+
|
|
691
|
+
```typescript
|
|
692
|
+
await client.conversationalAi.conversations.get("conversation_id");
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
```python
|
|
696
|
+
client.conversational_ai.conversations.get(conversation_id="conversation_id")
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
---
|
|
700
|
+
|
|
701
|
+
### Delete Conversation
|
|
702
|
+
|
|
703
|
+
Delete a particular conversation.
|
|
704
|
+
|
|
705
|
+
```
|
|
706
|
+
DELETE /v1/convai/conversations/{conversation_id}
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
#### Path Parameters
|
|
710
|
+
|
|
711
|
+
| Parameter | Type | Required | Description |
|
|
712
|
+
|-----------|------|----------|-------------|
|
|
713
|
+
| `conversation_id` | string | Yes | Conversation ID |
|
|
714
|
+
|
|
715
|
+
#### Response `200`
|
|
716
|
+
|
|
717
|
+
Successful deletion.
|
|
718
|
+
|
|
719
|
+
#### Example
|
|
720
|
+
|
|
721
|
+
```typescript
|
|
722
|
+
await client.conversationalAi.conversations.delete("conversation_id");
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
```python
|
|
726
|
+
client.conversational_ai.conversations.delete(conversation_id="conversation_id")
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
---
|
|
730
|
+
|
|
731
|
+
### Get Conversation Audio
|
|
732
|
+
|
|
733
|
+
Get the audio recording of a particular conversation.
|
|
734
|
+
|
|
735
|
+
```
|
|
736
|
+
GET /v1/convai/conversations/{conversation_id}/audio
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
#### Path Parameters
|
|
740
|
+
|
|
741
|
+
| Parameter | Type | Required | Description |
|
|
742
|
+
|-----------|------|----------|-------------|
|
|
743
|
+
| `conversation_id` | string | Yes | Conversation ID |
|
|
744
|
+
|
|
745
|
+
#### Response `200`
|
|
746
|
+
|
|
747
|
+
- **Content-Type:** `application/octet-stream`
|
|
748
|
+
- Returns binary audio file data.
|
|
749
|
+
|
|
750
|
+
#### Example
|
|
751
|
+
|
|
752
|
+
```typescript
|
|
753
|
+
await client.conversationalAi.conversations.audio.get("conversation_id");
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
```python
|
|
757
|
+
client.conversational_ai.conversations.audio.get(conversation_id="conversation_id")
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
---
|
|
761
|
+
|
|
762
|
+
### Send Conversation Feedback
|
|
763
|
+
|
|
764
|
+
Send feedback for a given conversation.
|
|
765
|
+
|
|
766
|
+
```
|
|
767
|
+
POST /v1/convai/conversations/{conversation_id}/feedback
|
|
768
|
+
```
|
|
769
|
+
|
|
770
|
+
#### Path Parameters
|
|
771
|
+
|
|
772
|
+
| Parameter | Type | Required | Description |
|
|
773
|
+
|-----------|------|----------|-------------|
|
|
774
|
+
| `conversation_id` | string | Yes | Conversation ID |
|
|
775
|
+
|
|
776
|
+
#### Request Body
|
|
777
|
+
|
|
778
|
+
```json
|
|
779
|
+
{
|
|
780
|
+
"feedback": "like | dislike"
|
|
781
|
+
}
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
#### Response `200`
|
|
785
|
+
|
|
786
|
+
Successful response.
|
|
787
|
+
|
|
788
|
+
#### Example
|
|
789
|
+
|
|
790
|
+
```typescript
|
|
791
|
+
await client.conversationalAi.conversations.feedback.create("conversation_id", {
|
|
792
|
+
feedback: "like"
|
|
793
|
+
});
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
```python
|
|
797
|
+
client.conversational_ai.conversations.feedback.create(
|
|
798
|
+
conversation_id="conversation_id",
|
|
799
|
+
feedback="like"
|
|
800
|
+
)
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
---
|
|
804
|
+
|
|
805
|
+
### Get Conversation Token (WebRTC)
|
|
806
|
+
|
|
807
|
+
Get a WebRTC session token for real-time communication.
|
|
808
|
+
|
|
809
|
+
```
|
|
810
|
+
GET /v1/convai/conversation/token
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
#### Query Parameters
|
|
814
|
+
|
|
815
|
+
| Parameter | Type | Required | Description |
|
|
816
|
+
|-----------|------|----------|-------------|
|
|
817
|
+
| `agent_id` | string | **Yes** | Agent ID |
|
|
818
|
+
| `participant_name` | string | No | Custom participant name (defaults to user ID) |
|
|
819
|
+
| `branch_id` | string | No | Branch ID to use |
|
|
820
|
+
|
|
821
|
+
#### Response `200`
|
|
822
|
+
|
|
823
|
+
```json
|
|
824
|
+
{
|
|
825
|
+
"token": "string"
|
|
826
|
+
}
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
---
|
|
830
|
+
|
|
831
|
+
### Get Signed URL
|
|
832
|
+
|
|
833
|
+
Get a signed URL to start a conversation with an agent that requires authorization.
|
|
834
|
+
|
|
835
|
+
```
|
|
836
|
+
GET /v1/convai/conversation/get-signed-url
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
#### Query Parameters
|
|
840
|
+
|
|
841
|
+
| Parameter | Type | Required | Default | Description |
|
|
842
|
+
|-----------|------|----------|---------|-------------|
|
|
843
|
+
| `agent_id` | string | **Yes** | — | Agent ID |
|
|
844
|
+
| `include_conversation_id` | boolean | No | `false` | Include a conversation_id (makes the signature single-use) |
|
|
845
|
+
| `branch_id` | string | No | — | Branch ID to use |
|
|
846
|
+
|
|
847
|
+
#### Response `200`
|
|
848
|
+
|
|
849
|
+
```json
|
|
850
|
+
{
|
|
851
|
+
"signed_url": "string"
|
|
852
|
+
}
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
#### Example
|
|
856
|
+
|
|
857
|
+
```typescript
|
|
858
|
+
await client.conversationalAi.conversations.getSignedUrl({
|
|
859
|
+
agentId: "agent_id",
|
|
860
|
+
includeConversationId: true,
|
|
861
|
+
branchId: "branch_id"
|
|
862
|
+
});
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
```python
|
|
866
|
+
client.conversational_ai.conversations.get_signed_url(
|
|
867
|
+
agent_id="agent_id",
|
|
868
|
+
include_conversation_id=True,
|
|
869
|
+
branch_id="branch_id"
|
|
870
|
+
)
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
---
|
|
874
|
+
|
|
875
|
+
## Batch Calling
|
|
876
|
+
|
|
877
|
+
### Submit Batch Calling Job
|
|
878
|
+
|
|
879
|
+
Submit a batch call request to schedule calls for multiple recipients.
|
|
880
|
+
|
|
881
|
+
```
|
|
882
|
+
POST /v1/convai/batch-calling/submit
|
|
883
|
+
```
|
|
884
|
+
|
|
885
|
+
#### Request Body
|
|
886
|
+
|
|
887
|
+
| Field | Type | Required | Description |
|
|
888
|
+
|-------|------|----------|-------------|
|
|
889
|
+
| `call_name` | string | **Yes** | Name identifier for the batch call |
|
|
890
|
+
| `agent_id` | string | **Yes** | Agent ID to handle the calls |
|
|
891
|
+
| `recipients` | array | **Yes** | Collection of call recipients |
|
|
892
|
+
| `scheduled_time_unix` | integer | No | Unix timestamp to schedule calls |
|
|
893
|
+
| `agent_phone_number_id` | string | No | Phone number ID for agent |
|
|
894
|
+
| `timezone` | string | No | Timezone for scheduling |
|
|
895
|
+
| `whatsapp_params` | object | No | WhatsApp configuration |
|
|
896
|
+
|
|
897
|
+
#### Recipient Object
|
|
898
|
+
|
|
899
|
+
| Field | Type | Description |
|
|
900
|
+
|-------|------|-------------|
|
|
901
|
+
| `id` | string | Recipient identifier |
|
|
902
|
+
| `phone_number` | string | Phone number to call |
|
|
903
|
+
| `whatsapp_user_id` | string | WhatsApp user identifier |
|
|
904
|
+
| `conversation_initiation_client_data` | object | Config overrides and dynamic variables |
|
|
905
|
+
|
|
906
|
+
#### WhatsApp Params
|
|
907
|
+
|
|
908
|
+
| Field | Type | Required | Description |
|
|
909
|
+
|-------|------|----------|-------------|
|
|
910
|
+
| `whatsapp_phone_number_id` | string | No | WhatsApp phone number ID |
|
|
911
|
+
| `whatsapp_call_permission_request_template_name` | string | **Yes** | Template name |
|
|
912
|
+
| `whatsapp_call_permission_request_template_language_code` | string | **Yes** | Template language code |
|
|
913
|
+
|
|
914
|
+
#### Response `200`
|
|
915
|
+
|
|
916
|
+
```json
|
|
917
|
+
{
|
|
918
|
+
"id": "string",
|
|
919
|
+
"name": "string",
|
|
920
|
+
"agent_id": "string",
|
|
921
|
+
"agent_name": "string",
|
|
922
|
+
"status": "pending | in_progress | completed | failed | cancelled",
|
|
923
|
+
"created_at_unix": 0,
|
|
924
|
+
"scheduled_time_unix": 0,
|
|
925
|
+
"last_updated_at_unix": 0,
|
|
926
|
+
"total_calls_dispatched": 0,
|
|
927
|
+
"total_calls_scheduled": 0,
|
|
928
|
+
"total_calls_finished": 0
|
|
929
|
+
}
|
|
930
|
+
```
|
|
931
|
+
|
|
932
|
+
#### Example
|
|
933
|
+
|
|
934
|
+
```typescript
|
|
935
|
+
await client.conversationalAi.batchCalls.submit({
|
|
936
|
+
callName: "Survey Batch",
|
|
937
|
+
agentId: "agent_id",
|
|
938
|
+
recipients: [
|
|
939
|
+
{ phoneNumber: "+1234567890" }
|
|
940
|
+
]
|
|
941
|
+
});
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
```python
|
|
945
|
+
client.conversational_ai.batch_calls.submit(
|
|
946
|
+
call_name="Survey Batch",
|
|
947
|
+
agent_id="agent_id",
|
|
948
|
+
recipients=[{"phone_number": "+1234567890"}]
|
|
949
|
+
)
|
|
950
|
+
```
|
|
951
|
+
|
|
952
|
+
---
|
|
953
|
+
|
|
954
|
+
### List Workspace Batch Calling Jobs
|
|
955
|
+
|
|
956
|
+
Get all batch calls for the current workspace.
|
|
957
|
+
|
|
958
|
+
```
|
|
959
|
+
GET /v1/convai/batch-calling/workspace
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
#### Query Parameters
|
|
963
|
+
|
|
964
|
+
| Parameter | Type | Required | Default | Description |
|
|
965
|
+
|-----------|------|----------|---------|-------------|
|
|
966
|
+
| `limit` | integer | No | 100 | Maximum number of results |
|
|
967
|
+
| `last_doc` | string | No | — | Pagination cursor |
|
|
968
|
+
|
|
969
|
+
#### Response `200`
|
|
970
|
+
|
|
971
|
+
```json
|
|
972
|
+
{
|
|
973
|
+
"batch_calls": [
|
|
974
|
+
{
|
|
975
|
+
"id": "string",
|
|
976
|
+
"name": "string",
|
|
977
|
+
"agent_id": "string",
|
|
978
|
+
"agent_name": "string",
|
|
979
|
+
"phone_number_id": "string",
|
|
980
|
+
"phone_provider": "twilio | sip_trunk",
|
|
981
|
+
"whatsapp_params": {},
|
|
982
|
+
"created_at_unix": 0,
|
|
983
|
+
"scheduled_time_unix": 0,
|
|
984
|
+
"timezone": "string",
|
|
985
|
+
"total_calls_dispatched": 0,
|
|
986
|
+
"total_calls_scheduled": 0,
|
|
987
|
+
"total_calls_finished": 0,
|
|
988
|
+
"last_updated_at_unix": 0,
|
|
989
|
+
"status": "pending | in_progress | completed | failed | cancelled",
|
|
990
|
+
"retry_count": 0
|
|
991
|
+
}
|
|
992
|
+
],
|
|
993
|
+
"next_doc": "string",
|
|
994
|
+
"has_more": false
|
|
995
|
+
}
|
|
996
|
+
```
|
|
997
|
+
|
|
998
|
+
#### Example
|
|
999
|
+
|
|
1000
|
+
```typescript
|
|
1001
|
+
await client.conversationalAi.batchCalls.list({ limit: 100 });
|
|
1002
|
+
```
|
|
1003
|
+
|
|
1004
|
+
```python
|
|
1005
|
+
client.conversational_ai.batch_calls.list(limit=100)
|
|
1006
|
+
```
|
|
1007
|
+
|
|
1008
|
+
---
|
|
1009
|
+
|
|
1010
|
+
### Get Batch Call Information
|
|
1011
|
+
|
|
1012
|
+
Get detailed information about a batch call including all recipients.
|
|
1013
|
+
|
|
1014
|
+
```
|
|
1015
|
+
GET /v1/convai/batch-calling/{batch_id}
|
|
1016
|
+
```
|
|
1017
|
+
|
|
1018
|
+
#### Path Parameters
|
|
1019
|
+
|
|
1020
|
+
| Parameter | Type | Required | Description |
|
|
1021
|
+
|-----------|------|----------|-------------|
|
|
1022
|
+
| `batch_id` | string | Yes | Batch call ID |
|
|
1023
|
+
|
|
1024
|
+
#### Response `200`
|
|
1025
|
+
|
|
1026
|
+
Returns `BatchCallDetailedResponse`:
|
|
1027
|
+
|
|
1028
|
+
```json
|
|
1029
|
+
{
|
|
1030
|
+
"id": "string",
|
|
1031
|
+
"name": "string",
|
|
1032
|
+
"agent_id": "string",
|
|
1033
|
+
"agent_name": "string",
|
|
1034
|
+
"phone_number_id": "string",
|
|
1035
|
+
"phone_provider": "twilio | sip_trunk",
|
|
1036
|
+
"whatsapp_params": {},
|
|
1037
|
+
"created_at_unix": 0,
|
|
1038
|
+
"scheduled_time_unix": 0,
|
|
1039
|
+
"timezone": "string",
|
|
1040
|
+
"total_calls_dispatched": 0,
|
|
1041
|
+
"total_calls_scheduled": 0,
|
|
1042
|
+
"total_calls_finished": 0,
|
|
1043
|
+
"last_updated_at_unix": 0,
|
|
1044
|
+
"status": "pending | in_progress | completed | failed | cancelled",
|
|
1045
|
+
"retry_count": 0,
|
|
1046
|
+
"recipients": [
|
|
1047
|
+
{
|
|
1048
|
+
"id": "string",
|
|
1049
|
+
"phone_number": "string",
|
|
1050
|
+
"whatsapp_user_id": "string",
|
|
1051
|
+
"status": "string (BatchCallRecipientStatus)",
|
|
1052
|
+
"created_at_unix": 0,
|
|
1053
|
+
"updated_at_unix": 0,
|
|
1054
|
+
"conversation_id": "string",
|
|
1055
|
+
"conversation_initiation_client_data": {}
|
|
1056
|
+
}
|
|
1057
|
+
]
|
|
1058
|
+
}
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
#### Example
|
|
1062
|
+
|
|
1063
|
+
```typescript
|
|
1064
|
+
await client.conversationalAi.batchCalls.get("batch_id");
|
|
1065
|
+
```
|
|
1066
|
+
|
|
1067
|
+
```python
|
|
1068
|
+
client.conversational_ai.batch_calls.get(batch_id="batch_id")
|
|
1069
|
+
```
|
|
1070
|
+
|
|
1071
|
+
---
|
|
1072
|
+
|
|
1073
|
+
### Cancel Batch Calling Job
|
|
1074
|
+
|
|
1075
|
+
Cancel a running batch call and set all recipients to cancelled status.
|
|
1076
|
+
|
|
1077
|
+
```
|
|
1078
|
+
POST /v1/convai/batch-calling/{batch_id}/cancel
|
|
1079
|
+
```
|
|
1080
|
+
|
|
1081
|
+
#### Path Parameters
|
|
1082
|
+
|
|
1083
|
+
| Parameter | Type | Required | Description |
|
|
1084
|
+
|-----------|------|----------|-------------|
|
|
1085
|
+
| `batch_id` | string | Yes | Batch call ID |
|
|
1086
|
+
|
|
1087
|
+
#### Response `200`
|
|
1088
|
+
|
|
1089
|
+
Returns `BatchCallResponse` with updated status (see [Submit Batch Calling Job](#submit-batch-calling-job) response schema).
|
|
1090
|
+
|
|
1091
|
+
#### Example
|
|
1092
|
+
|
|
1093
|
+
```typescript
|
|
1094
|
+
await client.conversationalAi.batchCalls.cancel("batch_id");
|
|
1095
|
+
```
|
|
1096
|
+
|
|
1097
|
+
```python
|
|
1098
|
+
client.conversational_ai.batch_calls.cancel(batch_id="batch_id")
|
|
1099
|
+
```
|
|
1100
|
+
|
|
1101
|
+
---
|
|
1102
|
+
|
|
1103
|
+
### Retry Batch Calling Job
|
|
1104
|
+
|
|
1105
|
+
Retry a batch call, calling failed and no-response recipients again.
|
|
1106
|
+
|
|
1107
|
+
```
|
|
1108
|
+
POST /v1/convai/batch-calling/{batch_id}/retry
|
|
1109
|
+
```
|
|
1110
|
+
|
|
1111
|
+
#### Path Parameters
|
|
1112
|
+
|
|
1113
|
+
| Parameter | Type | Required | Description |
|
|
1114
|
+
|-----------|------|----------|-------------|
|
|
1115
|
+
| `batch_id` | string | Yes | Batch call ID |
|
|
1116
|
+
|
|
1117
|
+
#### Response `200`
|
|
1118
|
+
|
|
1119
|
+
Returns `BatchCallResponse` with updated status and incremented `retry_count`.
|
|
1120
|
+
|
|
1121
|
+
#### Example
|
|
1122
|
+
|
|
1123
|
+
```typescript
|
|
1124
|
+
await client.conversationalAi.batchCalls.retry("batch_id");
|
|
1125
|
+
```
|
|
1126
|
+
|
|
1127
|
+
```python
|
|
1128
|
+
client.conversational_ai.batch_calls.retry(batch_id="batch_id")
|
|
1129
|
+
```
|
|
1130
|
+
|
|
1131
|
+
---
|
|
1132
|
+
|
|
1133
|
+
## SDK Support
|
|
1134
|
+
|
|
1135
|
+
All endpoints are available in official SDKs:
|
|
1136
|
+
|
|
1137
|
+
| Language | Package |
|
|
1138
|
+
|----------|---------|
|
|
1139
|
+
| TypeScript/JavaScript | `@elevenlabs/elevenlabs-js` |
|
|
1140
|
+
| Python | `elevenlabs` |
|
|
1141
|
+
| Go | HTTP client |
|
|
1142
|
+
| Ruby | HTTP client |
|
|
1143
|
+
| Java | HTTP client |
|
|
1144
|
+
| PHP | HTTP client |
|
|
1145
|
+
| C# | HTTP client |
|
|
1146
|
+
| Swift | HTTP client |
|
|
1147
|
+
|
|
1148
|
+
---
|
|
1149
|
+
|
|
1150
|
+
## Common Enums
|
|
1151
|
+
|
|
1152
|
+
### BatchCallStatus
|
|
1153
|
+
`pending` | `in_progress` | `completed` | `failed` | `cancelled`
|
|
1154
|
+
|
|
1155
|
+
### ConversationStatus
|
|
1156
|
+
`initiated` | `in-progress` | `processing` | `done` | `failed`
|
|
1157
|
+
|
|
1158
|
+
### CallSuccessful
|
|
1159
|
+
`success` | `failure` | `unknown`
|
|
1160
|
+
|
|
1161
|
+
### TelephonyProvider
|
|
1162
|
+
`twilio` | `sip_trunk`
|
|
1163
|
+
|
|
1164
|
+
### ConversationDirection
|
|
1165
|
+
`inbound` | `outbound`
|
|
1166
|
+
|
|
1167
|
+
### AgentAccessRole
|
|
1168
|
+
`admin` | `editor` | `commenter` | `viewer`
|
|
1169
|
+
|
|
1170
|
+
### LLM Models
|
|
1171
|
+
`gpt-4o-mini` | `gpt-4o` | `claude-sonnet-4` | `gemini-2.5-flash` | and others
|