Phone & SMS

Overview

Each Identity can be provisioned with a dedicated phone number. Your agent receives real SMS messages — verification codes, OTPs, notifications — without using your personal number.

Get your phone number

ravi get phone --json
{
  "phone_number": "+15551234567"
}

Read SMS messages

List SMS conversations

SMS messages are grouped by sender into conversations:

# All conversations
ravi inbox sms --json

# Only conversations with unread messages
ravi inbox sms --unread --json
[
  {
    "conversation_id": "1_+15559876543",
    "from_number": "+15559876543",
    "phone_number": "+15551234567",
    "preview": "Your verification code is 847291",
    "message_count": 3,
    "unread_count": 1,
    "latest_message_dt": "2026-02-25T10:30:00Z"
  }
]

Read a specific conversation

ravi inbox sms <conversation_id> --json
{
  "conversation_id": "1_+15559876543",
  "from_number": "+15559876543",
  "messages": [
    {
      "id": 42,
      "body": "Your verification code is 847291",
      "direction": "incoming",
      "is_read": false,
      "created_dt": "2026-02-25T10:30:00Z"
    }
  ]
}

Individual messages

# List all SMS messages (flat, not grouped)
ravi message sms --json

# Unread only
ravi message sms --unread --json

# Specific message by ID
ravi message sms <message_id> --json

Combined inbox

View both SMS and email together:

# All messages
ravi inbox list --json

# Unread only
ravi inbox list --unread --json

# Filter by type
ravi inbox list --type sms --json
ravi inbox list --type email --json

# Filter by direction
ravi inbox list --direction incoming --json

Common recipes

Extract an OTP code

ravi inbox sms --unread --json | jq -r '.[].preview' | grep -oE '[0-9]{4,8}'

Wait for a verification SMS

# After triggering a verification on a website
sleep 5
CODE=$(ravi inbox sms --unread --json | jq -r '.[0].preview' | grep -oE '[0-9]{4,8}' | head -1)
echo "$CODE"

Poll for new messages

# Check for recent SMS in JSON format
ravi inbox list --type sms --unread --json

Tips

  • Poll with delays — SMS delivery takes 2–10 seconds. Use sleep 5 before checking after triggering a verification.
  • OTP codes — most verification codes are 4–8 digits. The grep -oE '[0-9]{4,8}' pattern catches them reliably.

Next steps