call

View as MarkdownOpen in Claude

Send an MFA verification code via voice call.

Request

tostringRequired
The E164 number to use as the destination.
fromstringOptional
The E164 number from your account to use as the origin of the message. SignalWire will use a special verified number if not specified.
messagestringOptionalDefaults to Your Personal Authorization Code is:
Specify a custom message to send before the token. The message must fit within one segment; either 160 characters or 70 characters when using non-GSM symbols.
token_lengthintegerOptionalDefaults to 6
The number of characters in the token, from 4 to 20. Defaults to 6.
valid_forintegerOptionalDefaults to 3600
The number of seconds the token is considered valid for. Defaults to 3600, with a maximum of 604800.
max_attemptsintegerOptionalDefaults to 3
The number of allowed verification attempts, including the first one, from 1 to 20. Defaults to 3.
allow_alphasbooleanOptionalDefaults to false
Set to true or false, whether to include letters or just numbers in the token. Defaults to false (numbers only).

Response

idstringRequiredformat: "uuid"
The MFA request ID. Save this for verification.
successbooleanRequired
Whether the request was successfully queued.
tostringRequired
The destination of the MFA request.
channelstringRequired
Can be sms for a text message or call for a phone call.

Response Example

Response
1{
2 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
3 "success": true,
4 "to": "+15554422333",
5 "channel": "call"
6}

Example

1import { RestClient } from "@signalwire/sdk";
2
3const client = new RestClient({
4 project: "your-project-id",
5 token: "your-api-token",
6 host: "your-space.signalwire.com"
7});
8
9const result = await client.mfa.call({
10 to: "+15559876543",
11 from: "+15551234567",
12 message: "Your verification code is {code}",
13});
14const requestId = result.id;