Send a sign-in code
send_sign_in_codeSends a sign-in or verification code by SMS from your own Android phone and number, with the code as standalone digits. Use it to deliver one-time login codes and get the message ID for delivery checks.
Instructions
Send a sign-in or verification code by text (SMS) to one phone number, from the user's own Android phone and own number. Use it only for sign-in codes: it counts against the separate sign-in code allowance. For any other text, use send_sms.
The message must contain the code as digits standing on their own: 4 to 10 digits (e.g. "Your code is 482913") or two groups of three digits joined by a dash (123-456). Words, letter or mixed codes (A1B2C3), 11 or more digits, digits right after + and dates or decimals do not count, and such a text is refused.
Up to 320 characters.
One text per person, number in international format (+ and the country code).
Never resend a code automatically after an error or a failed status: tell the user and let them decide. Returns the message ID; check delivery with get_message_status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ONE phone number, in international format: + and the country code, e.g. +14155550123. | |
| message | Yes | The text with the code, e.g. "Your sign-in code is 482913". Up to 320 characters. | |
| deviceId | No | ID of the phone that should send it, from list_phones. Leave it out to use SMSTUNNEL_DEVICE_ID or, when that is not set, a phone SMSTunnel picks. | |
| defaultCountryCode | No | Country calling code for a number written without + or 00, e.g. "+1" or "44". Defaults to SMSTUNNEL_DEFAULT_COUNTRY_CODE. Leave it out for numbers that already start with +. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | The number as it was given. | |
| queued | Yes | true when the phone was offline: the text waits and goes out when the phone is back online. | |
| branded | Yes | true when the Free plan's texts for the day were used up and this one goes out with a short SMSTunnel line at the end. | |
| messageId | Yes | ID of the text; pass it to get_message_status. | |
| remainingToday | No | Texts left today on the plan (without that line). |