relay

relay create

Create a new conversation instance. Supports WhatsApp, Telegram, and phone calls (via ElevenLabs).

relay create \
  --contact="+56912345678" \
  --objective="confirm delivery time" \
  --todos="ask ETA,confirm address" \
  --heartbeat-interval=1800000 \
  --max-followups=5

Flags

FlagRequiredDescription
--objective <text>YesConversation objective
--contact <phone>YesTarget contact phone number (international format)
--todos <items>YesComma-separated list of todo items
--heartbeat-interval <ms>NoHeartbeat interval in milliseconds (default: 1800000 / 30 min)
--max-followups <n>NoMaximum number of follow-up attempts (default: 5)
--channel <type>Nowhatsapp (default), telegram, or phone (ElevenLabs voice call)
--telegram-chat-id <id>NoTelegram chat ID (for telegram channel, if known)

Phone channel flags

These flags are required when --channel phone is set:

FlagRequiredDescription
--phone-number-id <id>YesElevenLabs agent phone number ID (Twilio)
--first-message <text>YesFirst message the agent speaks when the call connects
--elevenlabs-api-key <key>NoElevenLabs API key (or set ELEVENLABS_API_KEY env var)
--voice-id <id>NoElevenLabs voice ID (defaults to Rachel)
--language <lang>NoLanguage code (default: en)

Returns a unique instance ID. If another instance for the same contact is already active, the new instance enters QUEUED state.

WhatsApp example

relay create \
  --contact="+56912345678" \
  --objective="confirm delivery time" \
  --todos="ask ETA,confirm address"

Telegram example

relay create \
  --contact="+56912345678" \
  --objective="confirm delivery time" \
  --todos="ask ETA,confirm address" \
  --channel=telegram

The contact must message the bot on Telegram first. You can optionally provide --telegram-chat-id if you already know the chat ID.

Phone call example

relay create \
  --contact="+56912345678" \
  --objective="confirm delivery time" \
  --todos="ask ETA,confirm address" \
  --channel=phone \
  --phone-number-id=PN123abc \
  --first-message="Hi, I'm calling about your delivery."

When using the phone channel, relay creates an ElevenLabs voice agent with a system prompt derived from the objective and todos, places the call via Twilio, and polls for completion. The call transcript is stored automatically when the call ends.

On this page