BestDealOn

Handbook › Callbots

Settings reference

Sources:

  • tenant validation: src/tenants.js:12-76 [bdo]
  • defaults: src/tenants.js DEFAULTS [bdo]
  • live-editable fields: ALLOWED at src/app.js:201 [bdo]
  • owner briefing: src/owner/config.js

"Editable" means the field is in ALLOWED, so PATCH /admin/tenants/<id>/config can change it.

Tenant JSON fields

FieldType / ruleDefaultNotes
idlowercase slug, required—
namerequired—Spoken in the greeting and instructions
numbersarray of E.164—The first one is the texting sender (src/twilio.js:57)
link_allowlistbare domains, required—The only links the bot may send
owner_emailemail—Owner notices. Editable
support_emailemail—Editable
hours{tz, open "HH:MM", close, days}none (always open)Drives after-hours wording. Editable
transfer_targettel:+E164 or sip:…noneWithout it, transfers are off. Editable
transfer_hours_onlybool—Transfer only during hours (src/tools.js:88 [bdo])
voiceGrok voice nameeveEditable
disclosuretext"Hi, you have reached {name}. This call may be recorded and is answered by an AI assistant."Editable
keytermsstring[]—Transcription hints. Editable
extra_instructionstext—Owner guide added to the prompt. Live switches override it (src/xai.js:86-91). Editable
blocked_topicsstring[][]Editable
max_call_secondsnumber900The call ends at this cap
approval_modebooltrueQueues outbound actions for approval (src/tools.js:240)
kb{dirs:[…]} or {collection_id}—Editable
sms_enabledboolforced false at creation (src/app.js:177)Only setSms turns it on (see texting.md)
email_enabledbool—Adds email tools. Editable, also from /admin/channels
instant_link_replybool—Editable
order_lookup_enabledboolfalseShopify order lookup. Editable
shopify{shop, mode, public_domain}—Not used by Best Deal On (out of scope). Editable
sar_lookupobject—Not used by Best Deal On (out of scope). Editable
known_callers{ "+E164": {name≤40, role?≤120, greeting?≤200} }—Changes the greeting only. Editable
returning_caller_greetingboolon (unless false)Editable
returning_caller_include_unconfirmedboolfalse[bdo]
welcome_backtext with {name}, ≤200built-in text[bdo]
callback_offerboolfalse[bdo] Offers "call you back or email you"
bdo_caller_lookupbool, only for tenant bestdealonfalse[bdo]
bdo_claimsbool—[bdo] Needs BDO_INBOUND_CLAIM=on
bizinator_phonelisting id—[bdo] Links the owner dashboard to a Best Deal On listing
brand{team_name, email_from, site, trademark_line?, kb_allow_domains?}none (framework default text)[bdo] src/brand.js
take_message`{enabled, record_audio, deliver: outbox\email}`enabled[bdo] deliver: email needs brand.email_from
twilio.account_sidAC+32 hexenv[bdo]
twilio.api_key_sidSK+32 hex—[bdo] Needs secrets.twilio_api_key_secret
twilio.webhook_keys{ webhooks_sharedkey_…: secretName }—[bdo]
twilio.require_shared_keybool—[bdo] Refuses auth-token-signed webhooks
twilio.messaging_service_sidMG+32 hex—Set by setSms
secrets.*env:NAME or store:key—Never a value. Names used: xai_webhook_secret, twilio_auth_token, twilio_api_key_secret, twilio_webhook_key, shopify_storefront_token
owner_briefingobject, see belowoffEditable
payments_enabled——Always rejected

owner_briefing (src/owner/config.js:5-10)

KeyDefault
enabledfalse
daily_calltrue
daily_time"18:00"
timezoneAmerica/New_York
copy_smsfalse
copy_emailfalse
emergency_alertstrue
alert_max_per_day3
alert_min_gap_minutes30
quiet_hours21:00–08:00
quiet_hours_allow["safety"]
error_threshold5
error_window_minutes15
on_demandtrue
transfer_fallbacktrue
voicegrok
twilio_voicePolly.Joanna
grok_sip_domainsip.voice.x.ai

owner_numbers, daily_numbers and alert_numbers each take up to 5 E.164 numbers. If owner_numbers is empty, the owners are the known callers whose role mentions admin or owner.

Environment variables (names only)

NamePurpose
PA_MODElive or demo. Anything else means demo (bin/server.js:10)
PORT, PUBLIC_BASE_URL, DATA_DIR, TENANTS_DIR, PA_LOG_FILERuntime, paths, and logs
PA_ADMIN_TOKEN, PA_STATE_SECRET, PA_MASTER_KEY, ADMIN_LOGIN_EMAILAdmin auth, signed state, and the secret-store key. ADMIN_LOGIN_EMAIL is where login links go
XAI_API_KEY, XAI_TEXT_MODEL (default grok-4.7)xAI voice and text
BDO_XAI_WEBHOOK_SECRETxAI webhook secrets for each tenant
TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_PHONE_NUMBER, TWILIO_CONNECT_APP_SIDTwilio (framework defaults; Best Deal On uses the BDO_TWILIO_* names)
BDO_TWILIO_ACCOUNT_SID, BDO_TWILIO_API_KEY_SID, BDO_TWILIO_API_KEY_SECRET, BDO_TWILIO_WEBHOOK_KEYTwilio, Best Deal On [bdo]
RESEND_API_KEY, PA_EMAIL_ALLOW_ONLYEmail, plus the test allowlist (comma-separated)
NEWSLETTER_SECRETNewsletter tokens
RENDER_API_KEYUsage page
BDO_VERIFY_CALLS (default off; on in production), BDO_INBOUND_CLAIM (default off; off in production), BDO_CALLBOT_SHARED_SECRET, BDO_SITE_URL[bdo] verify-by-call and claims
BIZINATOR_URL (default https://bestdealon.app)[bdo] Owner API (src/ownerapi.js:32)
PA_DRAIN_MAX_MS (default 280000)Only in [PR #42], which is unmerged

Example: turn texting off and switch on email take-a-message (placeholders)

curl -X PATCH "$PUBLIC_BASE_URL/admin/tenants/acme-bakery/config" \
  -H "Authorization: Bearer $PA_ADMIN_TOKEN" -H 'content-type: application/json' \
  -d '{"email_enabled": true, "extra_instructions": "We do not quote prices; take a message."}'

Only run a call like this after the owner approves the exact change.