?
voice.call
Places an outbound phone call that connects the person to the app's voice agent.
voice.call({ to, assumeIdentity? }) → Promise<VoiceCallResult>
Places an outbound call: the platform dials to and connects the person to this app's voice agent, with the same persona, engine, and tools as a web session. The method is the authorization gate, so gate it with auth.requireRole like any sensitive action; assumeIdentity: true runs the call as the invoking user, and without it the call is anonymous. It returns the moment dialing starts, so the answered-or-not outcome lands on the call record rather than the return value. Production needs a dedicated phone number, which becomes the caller ID, and automated calls require prior consent.
Parameters
to
string
RequiredThe number to dial, in E.164 (e.g. +13105551234).
assumeIdentity
boolean
Run the call as the user who invoked the method, so the agent knows who it is talking to and tool calls carry their roles. Omitted, the call is anonymous and role-gated tools decline.
Call a user about their order
import { voice, auth } from '@mindstudio-ai/agent'; export async function callAboutOrder(input: { phone: string }) { auth.requireRole('member'); const call = await voice.call({ to: input.phone, assumeIdentity: true }); return { from: call.from, to: call.to }; }