An identity can own a real phone number for both SMS and voice. Your agent can text from it, read what arrives, block until a one-time code lands, and place calls — the same number works over the CLI, the Python SDK, and the TypeScript SDK. Every example below runs against one identity. Grab it once (or set it as the active identity in the CLI) and the rest follow. Need one first? See [Identities](/core-concepts/identities/). CLI: ```bash ravi identity use ``` Python: ```python from ravi import Ravi ravi = Ravi(api_key="ravi_id_...") identity = ravi.identities.get("") ``` TypeScript: ```typescript import { Ravi } from "@ravi-hq/sdk"; const ravi = new Ravi({ apiKey: process.env.RAVI_API_KEY! }); const identity = await ravi.identities.get(""); ``` The phone is optional — `identity.phone` may be null until you provision one. Add a number with `provision_phone` (see [Identities](/core-concepts/identities/)). In TypeScript the field is nullable, so the examples use `identity.phone?.…`. ## Send an SMS Text any number from the identity's own line. CLI: ```bash ravi sms send --to +15551234567 --body "Hi from my agent" ``` Python: ```python sms = identity.phone.send( to="+15551234567", body="Hi from my agent", ) ``` TypeScript: ```typescript const sms = await identity.phone?.send( "+15551234567", "Hi from my agent", ); ``` ## Read the SMS inbox List messages as a flat feed — filter to unread to see only what needs attention. CLI: ```bash ravi message sms --unread ``` Python: ```python inbox = identity.phone.inbox(unread=True) for sms in inbox: print(sms.from_number, sms.body) ``` TypeScript: ```typescript const inbox = await identity.phone?.inbox({ unread: true }); for (const sms of inbox) { console.log(sms.from_number, sms.body); } ``` ## List conversations Prefer messages grouped by the other party? List conversations instead. CLI: ```bash ravi inbox sms ``` Python: ```python conversations = identity.phone.conversations() ``` TypeScript: ```typescript const conversations = await identity.phone?.conversations(); ``` ## Read one message Fetch a single message by id to see its full body and sender. CLI: ```bash ravi message sms ``` Python: ```python sms = identity.phone.get("") print(sms.from_number) print(sms.body) ``` TypeScript: ```typescript const sms = await identity.phone?.get(""); console.log(sms.from_number); console.log(sms.body); ``` ## Wait for a one-time code The move that makes agents work: trigger a login somewhere, then block until the SMS code arrives. `wait_for` polls the inbox and returns the first message that matches. Python: ```python # Kick off a login elsewhere, then wait for the code to land. sms = identity.phone.wait_for( lambda m: "code" in m.body.lower(), timeout=120, ) print(sms.body) ``` TypeScript: ```typescript // Kick off a login elsewhere, then wait for the code to land. const sms = await identity.phone?.waitFor( (m) => m.body.toLowerCase().includes("code"), { timeoutMs: 120_000 }, ); console.log(sms.body); ``` ## Reply to an SMS Messages carry their own actions — reply straight to the sender. Python: ```python sms = identity.phone.get("") sms.reply(body="Got it, thanks!") ``` TypeScript: ```typescript const sms = await identity.phone?.get(""); await sms.reply("Got it, thanks!"); ``` ## Place a voice call Dial any number from the identity's line. CLI: ```bash ravi call --to +15551234567 ``` Python: ```python call = identity.phone.call(to="+15551234567") print(call.uuid, call.status) ``` TypeScript: ```typescript const call = await identity.phone?.call("+15551234567"); console.log(call.uuid, call.status); ``` ## Get a call transcript Pull the transcript once a call has ended. CLI: ```bash ravi call transcript ``` Python: ```python call = identity.phone.call(to="+15551234567") transcript = call.transcript() ``` TypeScript: ```typescript const call = await identity.phone?.call("+15551234567"); const transcript = await call.transcript(); ``` ## Hang up a call End a call that's still in progress. CLI: ```bash ravi call hangup ``` Python: ```python call.hangup() ``` TypeScript: ```typescript await call.hangup(); ``` --- Looking for exact request and response fields? See the full [API reference](/api/reference/).